<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:2010793363;
mso-list-type:hybrid;
mso-list-template-ids:-1936808518 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level2
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level3
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level4
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level5
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level6
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
@list l0:level7
{mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level8
{mso-level-number-format:alpha-lower;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;}
@list l0:level9
{mso-level-number-format:roman-lower;
mso-level-tab-stop:none;
mso-level-number-position:right;
text-indent:-9.0pt;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Slurm: 17.11.4<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I want to run an interactive job on a compute node. I know that I’m going to need to run an MPI app, so I request a bunch of tasks upfront<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">srun -n 16 –gres=gpu:4 –pty $SHELL<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">This creates a job with 4 nodes.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> …<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_CPUS_ON_NODE=4<o:p></o:p></p>
<p class="MsoNormal" style="text-indent:.5in">SLURM_DISTRIBUTION=block<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_JOB_CPUS_PER_NODE=4(x4)<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_JOB_NODELIST=n1,n2,n3,n4<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_JOB_NUM_NODES=16<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_NNODES=4<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_NPROCS=16<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_NTASKS=16<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_STEP_NODELIST=n1,n2,n3,n4<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_STEP_NUM_NODES=4<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_STEP_NUM_TASKS=16<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_STEP_TASKS_PER_NODE=4(x4)<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">SLURM_TASKS_PER_NODE=4(x4)<o:p></o:p></p>
<p class="MsoNormal"> …<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Once on the compute node, I run an application that make a system call to a shell script. Of my 16 cores, I want to make use of 10 of them. In that shell script is the following call<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">srun -l -n 10 a.out<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">However, Slurm comes back with<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">srun: Warning: can't run 10 processes on 16 nodes, setting nnodes to 10<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in">srun: error: Only allocated 4 nodes asked for 10<o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in">Exiting with code: 1<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">If I run<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> Srun -l -n 16 a.out<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The app hangs and the debug show<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> srun: jobid 1234: nodes(4):`n1,n2,n3,n4’, cpu counts: 4(x4)<o:p></o:p></p>
<p class="MsoNormal"> srun: error: SLURM_NNODES environment variable conflicts with allocated node count (16 != 4).<o:p></o:p></p>
<p class="MsoNormal"> srun: debug: requesting job 1234, user 5678, nodes 4 including ((null))<o:p></o:p></p>
<p class="MsoNormal"> srun: debug: cpus 16, tasks 16, name a.out, relative 65534<o:p></o:p></p>
<p class="MsoNormal"> srun: Job 1234 step creation temporarily disabled, retrying<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> srun: debug: Got signal 2<o:p></o:p></p>
<p class="MsoNormal"> srun: Cancelled pending job step with signal 2<o:p></o:p></p>
<p class="MsoNormal"> srun: error: Unable to create step for job 1234: Job/step already completing or completed<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I think there are two issues:<o:p></o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">I’m asking for a gres that is being consumed by the outer
<i>srun</i> (but my inner <i>srun</i> is going to need the GPU, so I need to ensure I’m asking for them upfront)<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Even without the gres, Slurm still doesn’t seem to like srun calling srun.<o:p></o:p></li></ol>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">How do I make this work?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Raymond<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>