<html 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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@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;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
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;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:70.85pt 70.85pt 56.7pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:1832257318;
mso-list-type:hybrid;
mso-list-template-ids:219959286 1077570656 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:Calibri;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-.25in;
font-family:Wingdings;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">I think the answer depends on why you’re trying to prevent the observed behavior:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Do you want to ensure that one job requesting 9 tasks (and 1 CPU per task) can’t overstep its reservation and take resources away from other jobs on those nodes? Cgroups [1] should
be able to confine the job to its 9 CPUs, and even if 8 processes get started at once in the job, they’ll only drive up the nodes’ load average, and not affect others’ performance.<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo1">Are you trying to define a workflow where these 8 jobs can be run in parallel, and you want to wait until they’ve all completed before starting another job? Job dependencies using
the --dependency flag to sbatch [2] should be able to handle that.<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[1] <a href="https://slurm.schedmd.com/cgroups.html">https://slurm.schedmd.com/cgroups.html</a><o:p></o:p></p>
<p class="MsoNormal">[2] <a href="https://slurm.schedmd.com/sbatch.html">https://slurm.schedmd.com/sbatch.html</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:12.0pt;color:black">From: </span></b><span style="font-size:12.0pt;color:black">slurm-users <slurm-users-bounces@lists.schedmd.com> on behalf of Max Quast <max@quast.de><br>
<b>Reply-To: </b>Slurm User Community List <slurm-users@lists.schedmd.com><br>
<b>Date: </b>Saturday, October 10, 2020 at 6:06 AM<br>
<b>To: </b><slurm-users@lists.schedmd.com><br>
<b>Subject: </b>[slurm-users] sbatch overallocation<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">Dear slurm-users, <o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">I built a slurm system consisting of two nodes (Ubuntu 20.04.1, slurm 20.02.5):<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> # COMPUTE NODES<o:p></o:p></p>
<p class="MsoNormal"> GresTypes=gpu<o:p></o:p></p>
<p class="MsoNormal"> NodeName=lsm[216-217] Gres=gpu:tesla:1 CPUs=64 RealMemory=192073 Sockets=2 CoresPerSocket=16 ThreadsPerCore=2 State=UNKNOWN<o:p></o:p></p>
<p class="MsoNormal"> PartitionName=admin Nodes=lsm[216-217] Default=YES MaxTime=INFINITE State=UP<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">The slurmctl is running on a separate Ubuntu system where no slurmd is installed.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">If a user executes this script (sbatch srun2.bash)<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal"> #!/bin/bash<o:p></o:p></p>
<p class="MsoNormal"> #SBATCH -N 2 -n9<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-10 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-11 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-12 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-13 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-14 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-15 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-16 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> srun pimpleFoam -case /mnt/NFS/users/quast/channel395-17 -parallel > /dev/null &<o:p></o:p></p>
<p class="MsoNormal"> wait<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">8 jobs with 9 threads are launched and distributed on two nodes.<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">If more such scripts get started at the same time, all the srun commands will be executed even though no free cores are available. So the nodes are overallocated.<o:p></o:p></p>
<p class="MsoNormal">How can this be prevented?<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Thx :)<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal">Greetings <o:p></o:p></p>
<p class="MsoNormal">max<o:p></o:p></p>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</body>
</html>