#!/bin/bash
# This runs on login machine to launch the real task (named by $1) on two machines
# Any further args are passed to $task.sh
echo $(date) Launching master workers for "$@"
task=$1
shift
nodes=($(scontrol show hostname "$SLURM_JOB_NODELIST"))
seq 1 -1 0 | parallel --will-cite --joblog master_$task.log -S ${nodes[1]} -S ${nodes[0]} -N 1 --workdir /dev/shm --transferfile ${task}_'{}'.txt $* $HOME/bin/$task.sh '{}' "$@"
echo $(date) $task "$@" workers done
