[slurm-users] Getting nodes in a partition

SLIM, HENK A. h.a.slim at durham.ac.uk
Fri May 18 02:35:32 MDT 2018


Does

sinfo -h -O nodehost -p partition | sort

help?

Also 

scontrol show hostname nodelist

where nodelist is compute-0-\[4-6\]

would work.

Regards

Henk


-----Original Message-----
From: slurm-users <slurm-users-bounces at lists.schedmd.com> On Behalf Of Mahmood Naderan
Sent: 18 May 2018 08:12
To: Slurm User Community List <slurm-users at lists.schedmd.com>
Subject: [slurm-users] Getting nodes in a partition

Hi,
Is there any slurm variable to read the node names of a partition?
There is an MPI option --hostfile  which we can write the node names.
I want to use something like this in the sbatch script:


#SBATCH --partition=MYPART
... --hostfile $SLURM_NODES_IN_PARTITION ....

I can manually manipulate the output of scontrol to extract node
names. Like this:

[mahmood at rocks7 ~]$ scontrol show partition MYPART | grep -w Nodes |
cut -d '=' -f 2
compute-0-[4-6]

But that basically is not
compute-0-4
compute-0-5
compute-0-6

Which I have to post process more. Any better idea?



Regards,
Mahmood



More information about the slurm-users mailing list