[slurm-users] Getting nodes in a partition

Marcus Wagner wagner at itc.rwth-aachen.de
Fri May 18 02:35:57 MDT 2018


Hi Mahmood,

slurm comes with hostlist extraction:

[mahmood at rocks7 ~]$ scontrol show hostnames $(scontrol show partition MYPART | grep -w Nodes | cut -d '=' -f 2)


This would then be

compute-0-4
compute-0-5
compute-0-6


Best
Marcus

On 05/18/2018 09:11 AM, Mahmood Naderan wrote:
> 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
>

-- 
Marcus Wagner, Dipl.-Inf.

IT Center
Abteilung: Systeme und Betrieb
RWTH Aachen University
Seffenter Weg 23
52074 Aachen
Tel: +49 241 80-24383
Fax: +49 241 80-624383
wagner at itc.rwth-aachen.de
www.itc.rwth-aachen.de




More information about the slurm-users mailing list