<div dir="ltr">Thanks, Greg! This looks like the right way to do this. I will have to stop putting off learning to use spank plugins :) <div><br></div><div>griznog</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 6, 2022 at 1:40 AM Greg Wickham <<a href="mailto:greg.wickham@kaust.edu.sa">greg.wickham@kaust.edu.sa</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="en-SA" style="overflow-wrap: break-word;">
<div class="gmail-m_7966814574017706937WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt">Hi John, Mark,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt">We use a spank plugin
<a href="https://gitlab.com/greg.wickham/slurm-spank-private-tmpdir" target="_blank">https://gitlab.com/greg.wickham/slurm-spank-private-tmpdir</a> (this was derived from other authors but modified for functionality required on site).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt">It can bind tmpfs mount points to the users cgroup allocation, additionally bind options can be provided (ie: limit memory by size, limit memory by % as supported by tmpfs(5))<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt">More information is in the README.md<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11pt">  -Greg<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">On 05/04/2022, 23:17, "slurm-users" <<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a>> wrote:<u></u><u></u></span></p>
</div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">I've thought-experimented this in the past, wanting to do the same thing but haven't found any way to get a/dev/shm or a tmpfs into a job's cgroups to be accounted against the job's
 allocation. The best I have come up with is creating a per-job tmpfs from a prolog, removing from epilog and setting its size to be some amount of memory that at least puts some restriction on how much damage the job could do. Another alternative is to only
 allow access to a memory filesystem if the job request is exclusive and takes the whole node. Crude, but effective at least to the point of preventing one job from killing others. If you happen to find a real solution, please post it :) <u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">griznog<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
<div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">On Mon, Apr 4, 2022 at 10:19 AM Mark Coatsworth <<a href="mailto:mark.coatsworth@vectorinstitute.ai" target="_blank">mark.coatsworth@vectorinstitute.ai</a>> wrote:<u></u><u></u></span></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">Hi all,<u></u><u></u></span></p>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">We have a GPU cluster (Slurm 19.05.3) that typically runs large PyTorch jobs dependent on shared memory (/dev/shm). When our machines get busy, we often run into a problem where
 one job exhausts all the shared memory on a system, causing any other jobs landing there to fail immediately.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">We're trying to figure out a good way to manage this resource. I know that Slurm counts shared memory as part of a job's total memory allocation, so we could use cgroups to OOM kill
 jobs that exceed this. But that doesn't prevent a user from just making a large request and exhausting it all anyway.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">Does anybody have any thoughts or experience with setting real limits on shared memory, and either swapping it out or killing the job if this gets exceeded? One thought we had was
 to use a new generic resource (GRES). This is pretty easy to add in the configuration, but seems like it would be a huge task to write a plugin that actually enforces it.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">Is this something where the Job Container plugin might be useful?<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">Any thoughts or suggestions would be appreciated,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:11pt">Mark<u></u><u></u></span></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div>