Currently I am doing following
#!/bin/bash -l
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=4
scontrol show hostname $SLURM_JOB_NODELIST | perl -ne 'chomb; print "$_" x4' > myhostfile
This generates the following myhostfile
compute-0
compute-0
compute-0
compute-0
compute-1
compute-1
compute-1
compute-1
I would like to have the following outcome
compute-0
compute-1
compute-0
compute-1
compute-0
compute-1
compute-0
compute-1
So that we alternate between all specified nodes
question from:https://stackoverflow.com/questions/65844698/how-to-write-hostfile-in-slurm-script