I am using GNU parallel
to run 3 scripts simultaneously. This is my current shell script.
#!/bin/bash
#SBATCH --array=0-0
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=3
#SBATCH --cpus-per-task=1
#SBATCH --time=07:30:00
#SBATCH --mail-type=FAIL
module load julia
parallel -j $SLURM_TASKS_PER_NODE << EOF
julia main.jl $SLURM_ARRAY_TASK_ID 0.025 0
julia main.jl $SLURM_ARRAY_TASK_ID 0.025 1
julia main.jl $SLURM_ARRAY_TASK_ID 0.025 2
EOF
However, this fails to run. I used bash -x jobs.sh
, to get some more insight, but found nothing of note. At first I suspected that it may be from the $SLURM_TASKS_PER_NODE
argument rather than just using the integer 3. However swapping this does nothing.
Any suggestions?
8
It appears that in the process of debugging, I removed SBATCH --array
. Hence $SLURM_ARRAY_TASK_ID
was left blank. This is rather embarising and clearly a night of good sleep was needed.
I will not remove this post since there were good ideas in the comments.
1