0

I use sbatch to allocate an MPI job with (let's say) 8 ranks. I use 4 nodes: node0[01-04]. I would like to bind rank 0 to the first node (node001) and the other ranks to the other nodes (node0[02-04]). How can it be done using sbatch?

Thank you!

Yoni4949
  • 15
  • 3

1 Answers1

1

See https://slurm.schedmd.com/sbatch.html environment variables

SLURM_NODEID will give you the ID of the node in the allocation

SLURM_NNODES will give you the total amount of nodes allocated.

If you want to specific about ensuring the order of the nodes matches the rank you will also need to parse.

SLURM_JOB_NODELIST

tomgalpin
  • 1,943
  • 1
  • 4
  • 12