Good afternoon,

I know this question has been asked a million times, but what is the canonical way to convert the list of nodes for a job that is container in a Slurm variable, I use SLURM_JOB_NODELIST, to a host list appropriate for mpirun in OpenMPI (perhaps MPICH as well)?

Before anyone says, compile OpenMPI with Slurm, I can't change the Slurm installation.

I have a script that does the conversion on a single node, but when I try a cluster that does not include the single node, I get an error:

scontrol: error: host list is empty

The line in the script corresponding to this is,

list=$(scontrol show hostname $SLURM_NODELIST)

I've tried using the env variable SLURM_JOB_NODELIST and I get the same error message.

Thanks!

Jeff