I don't think there is a one liner slurm command to do this. Even the
"pbsnodes" wrapper that comes with slurm punts on this:
# find job(s) on node
my $jobs;
if ( $state eq "allocated" ) {
# how to get list of jobs on node efficiently?
}
# this isn't really defined in SLURM, so I am not sure how to get it
We have a perl script that runs "scontrol show jobs" to get the list of nodes
each job is running on and then combines that with a "scontrol show nodes"
output to get what you describe.
# nodeinfo.pl
CPU's
Node use/tot state reserv job info
-------- ------- ------------- --------- ----------------------------------
r1i0n0 12/12 job-exclusive ----- 45360,gsalaza3
r1i0n1 12/12 job-exclusive ----- 45360,gsalaza3
r1i0n2 12/12 job-exclusive ----- 45360,gsalaza3
r1i0n3 12/12 job-exclusive ----- 45360,gsalaza3
r1i0n4 0/12 idle -----
r1i0n5 0/12 idle -----
.
.
.
-----Original Message-----
From: Mark London <[email protected]>
Reply-To: slurm-dev <[email protected]>
Date: Thursday, April 27, 2017 at 3:18 PM
To: slurm-dev <[email protected]>
Subject: [slurm-dev] New slurm user question.
Hi - I want a method to create a list all the cluster nodes, with one
node line per line, and include the job(s) running, for each node. I
haven't quite found a command that will do this. Before I write a
script to do this, I was wondering if someone else has already done
this. Or whether there is a command to do it, that I'm not aware of.
Thanks very much.
Mark London