<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Matt,</p>
<p>you may have a look to sinfo/squeue command with the --format /
-o output options, e.g.:<br>
</p>
<p><font face="monospace">[root@ma1 slurm]# sinfo -t idle -o "%P
%.5a %.10l %.6D %.6t %N %b"<br>
PARTITION AVAIL TIMELIMIT NODES STATE NODELIST
ACTIVE_FEATURES<br>
compute up 8:00:00 44 idle
m[10474-10475,10594-10596,10598,10600-10608,10924-10925,10927,10934-10935,10990-11013]
64G<br>
prepost up 12:00:00 0 n/a (null)<br>
shared up 7-00:00:00 0 n/a (null)<br>
gpu up 12:00:00 5 idle mg[106-109,111] k80,256G<br>
gpu up 12:00:00 2 idle mg[201,203] m40,512G<br>
gpu up 12:00:00 1 idle mg207 v100,512G<br>
miklip up 2-00:00:00 2 idle m[21431,21588] 256G<br>
compute2 up 8:00:00 30 idle
m[20058,20110-20112,20233,20373-20375,20513,20521,20706,20709,20828-20831,20936-20941,20943-20944,21047,21053-21055,21733-21734]
64G<br>
compute2 up 8:00:00 20 idle
m[21167-21168,21368-21385] 128G<br>
</font></p>
<p>Cheers,<br>
Carsten<br>
</p>
<pre class="moz-signature" cols="72">--
Carsten Beyer
Abteilung Systeme
Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstraße 45a * D-20146 Hamburg * Germany
Phone: +49 40 460094-221
Fax: +49 40 460094-270
Email: <a class="moz-txt-link-abbreviated" href="mailto:beyer@dkrz.de">beyer@dkrz.de</a>
URL: <a class="moz-txt-link-freetext" href="http://www.dkrz.de">http://www.dkrz.de</a>
Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784</pre>
<p><br>
</p>
<div class="moz-cite-prefix">Am 14.10.2021 um 14:44 schrieb
Thompson, Matt (GSFC-610.1)[SCIENCE SYSTEMS AND APPLICATIONS INC]:<br>
</div>
<blockquote type="cite"
cite="mid:C63E4986-B8DB-42CF-8E3B-5629AEBF83AE@nasa.gov">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 2 6 3 5 4 5 2 3 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Consolas;
color:windowtext;
font-weight:normal;
font-style:normal;}.MsoChpDefault
{mso-style-type:export-only;
font-size:12.0pt;
font-family:"Calibri",sans-serif;}div.WordSection1
{page:WordSection1;}</style>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:Consolas">All,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">I work
on a cluster that uses SLURM which has various types of
nodes that are are controlled via --constraint flags in
sbatch.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Now, I
started thinking "How can I figure out how many jobs are
running/pending/etc on a certain type of node?". I first
thought obviously "squeue --constraint=foo", but...nope. No
--constraint flag with squeue. Okay. Constraints are just
Features by another name, but...you can't seem to just
squeue a feature either.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">I asked
a SLURM guru here and they suggested using --nodelist/-w a
la:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"> squeue
-a -w nodea[001-100],nodeb[001-100],... -t r<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">where
you pass in all the nodes of a certain type. And, yep, that
works! But that also means I have to know what nodes are
what type. I could obviously do a one-time parsing of
"scontrol show nodes" and see what each chunk is and be done
with it...but dangit I'm lazy and SLURM has so many programs
and options there might just be something and I haven't read
the right manpage! :)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">So I was
wondering if anyone out there knows of a
cool/elegant/efficient way of doing this?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">Matt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">PS: I
still might write a bash script where I've listed what the
node names are of constraint and realize I might have to
update it once every year or two. Now time to look at what
parser SLURM uses for nodelist. Can you use regexes and use
*, etc? Or just use nodea[001-100]? Time to find out!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-family:Consolas">-- <o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-family:Consolas">Matt Thompson, SSAI, Ld
Scientific Programmer/Analyst<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-family:Consolas">NASA GSFC, Global Modeling
and Assimilation Office<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-family:Consolas">Code 610.1, 8800 Greenbelt
Rd, Greenbelt, MD 20771<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span
style="font-family:Consolas">Phone:
301-614-6712 Fax: 301-614-6246<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><u><span
style="font-family:Consolas;color:#0000E9"><a class="moz-txt-link-freetext" href="http://science.gsfc.nasa.gov/sed/bio/matthew.thompson">http://science.gsfc.nasa.gov/sed/bio/matthew.thompson</a></span></u><o:p></o:p></p>
</div>
</blockquote>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>