<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=utf-8"><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;}
@font-face
{font-family:DokChampa;
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
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:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></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-GB link="#0563C1" vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Thank you Loris!<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Like many of our jobs, this is an embarrassingly parallel analysis, where we have to strike a compromise between what would be a completely granular array of >100,000 small jobs or some kind of serialisation through loops. So the individual jobs where I noticed this behaviour are actually already part of an array :)<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'>Cheers,<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><br>Arthur<o:p></o:p></span></p><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><p class=MsoNormal>-------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal>Dr. Arthur Gilly<o:p></o:p></p><p class=MsoNormal>Head of Analytics<o:p></o:p></p><p class=MsoNormal>Institute of Translational Genomics<o:p></o:p></p><p class=MsoNormal>Helmholtz-Centre Munich (HMGU)<o:p></o:p></p><p class=MsoNormal>-------------------------------------------------------------<o:p></o:p></p></div><p class=MsoNormal><span style='mso-fareast-language:EN-US'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US>From:</span></b><span lang=EN-US> slurm-users <slurm-users-bounces@lists.schedmd.com> <b>On Behalf Of </b>Loris Bennett<br><b>Sent:</b> Tuesday, 8 June 2021 16:05<br><b>To:</b> Slurm User Community List <slurm-users@lists.schedmd.com><br><b>Subject:</b> Re: [slurm-users] Kill job when child process gets OOM-killed<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Dear Arthur,<br><br>Arthur Gilly <<a href="mailto:arthur.gilly@helmholtz-muenchen.de">arthur.gilly@helmholtz-muenchen.de</a>> writes:<br><br>> Dear Slurm users,<br>><br>> <br>><br>> I am looking for a SLURM setting that will kill a job immediately when any subprocess of that job hits an OOM limit. Several posts have touched upon that, e.g: <a href="https://www.mail-archive.com/slurm-users@lists.schedmd.com/msg04091.html">https://www.mail-archive.com/slurm-users@lists.schedmd.com/msg04091.html</a> and<br>> <a href="https://www.mail-archive.com/slurm-users@lists.schedmd.com/msg04190.html">https://www.mail-archive.com/slurm-users@lists.schedmd.com/msg04190.html</a> or <a href="https://bugs.schedmd.com/show_bug.cgi?id=3216">https://bugs.schedmd.com/show_bug.cgi?id=3216</a> but I cannot find an answer that works in our setting.<br>><br>> <br>><br>> The two options I have found are:<br>><br>> 1 Set shebang to #!/bin/bash -e, which we don’t want to do as we’d need to change this for hundreds of scripts from another cluster where we had a different scheduler, AND it would kill tasks for other runtime errors (e.g. if one command in the<br>> script doesn’t find a file).<br>><br>> 2 Set KillOnBadExit=1. I am puzzled by this one. This is supposed to be overridden by srun’s -K option. Using the example below, srun -K --mem=1G ./multalloc.sh would be expected to kill the job at the first OOM. But it doesn’t, and happily<br>> keeps reporting 3 oom-kill events. So, will this work?<br>><br>> <br>><br>> The reason we want this is that we have script that execute programs in loops. These programs are slow and memory intensive. When the first one crashes for OOM, the next iterations also crash. In the current setup, we are wasting days<br>> executing loops where every iteration crashes after an hour or so due to OOM.<br><br>Not an answer to your question, but if your runs are independent, would<br>using a job array help you here?<br><br>Cheers,<br><br>Loris<br><br>> We are using cgroups (and we want to keep them) with the following config:<br>><br>> CgroupAutomount=yes<br>><br>> ConstrainCores=yes<br>><br>> ConstrainDevices=yes<br>><br>> ConstrainKmemSpace=no<br>><br>> ConstrainRAMSpace=yes<br>><br>> ConstrainSwapSpace=yes<br>><br>> MaxSwapPercent=10<br>><br>> TaskAffinity=no<br>><br>> <br>><br>> Relevant bits from slurm.conf:<br>><br>> SelectTypeParameters=CR_Core_Memory,CR_ONE_TASK_PER_CORE<br>><br>> SelectType=select/cons_tres<br>><br>> GresTypes=gpu,mps,bandwidth<br>><br>> <br>><br>> <br>><br>> Very simple example:<br>><br>> #!/bin/bash<br>><br>> # multalloc.sh – each line is a very simple cpp program that allocates a 8Gb vector and fills it with random floats<br>><br>> echo one<br>><br>> ./alloc8Gb<br>><br>> echo two<br>><br>> ./alloc8Gb<br>><br>> echo three<br>><br>> ./alloc8Gb<br>><br>> echo done.<br>><br>> <br>><br>> This is submitted as follows:<br>><br>> <br>><br>> sbatch --mem=1G ./multalloc.sh<br>><br>> <br>><br>> The log is :<br>><br>> one<br>><br>> ./multalloc.sh: line 4: 231155 Killed ./alloc8Gb<br>><br>> two<br>><br>> ./multalloc.sh: line 6: 231181 Killed ./alloc8Gb<br>><br>> three<br>><br>> ./multalloc.sh: line 8: 231263 Killed ./alloc8Gb<br>><br>> done.<br>><br>> slurmstepd: error: Detected 3 oom-kill event(s) in StepId=3130111.batch cgroup. Some of your processes may have been killed by the cgroup out-of-memory handler.<br>><br>> <br>><br>> I am expecting an OOM job kill right before “two”.<br>><br>> <br>><br>> Any help appreciated.<br>><br>> <br>><br>> Best regards,<br>><br>> <br>><br>> Arthur<br>><br>> <br>><br>> <br>><br>> -------------------------------------------------------------<br>><br>> Dr. Arthur Gilly<br>><br>> Head of Analytics<br>><br>> Institute of Translational Genomics<br>><br>> Helmholtz-Centre Munich (HMGU)<br>><br>> -------------------------------------------------------------<br>><br>> <br>><br>> Helmholtz Zentrum München <br>> Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) <br>> Ingolstädter Landstr. 1 <br>> 85764 Neuherberg <br>> <a href="http://www.helmholtz-muenchen.de">www.helmholtz-muenchen.de</a> <br>> Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling <br>> Geschäftsführung: Prof. Dr. med. Dr. h.c. Matthias Tschöp, Kerstin Günther<br>> Registergericht: Amtsgericht München HRB 6466 <br>> USt-IdNr: DE 129521671 <br>><br>-- <br>Dr. Loris Bennett (Hr./Mr.)<br>ZEDAT, Freie Universität Berlin Email <a href="mailto:loris.bennett@fu-berlin.de">loris.bennett@fu-berlin.de</a><o:p></o:p></p></div>
<br><html><body>Helmholtz Zentrum München <br>
Deutsches Forschungszentrum für Gesundheit und Umwelt (GmbH) <br>
Ingolstädter Landstr. 1 <br>
85764 Neuherberg <br>
www.helmholtz-muenchen.de <br>
Aufsichtsratsvorsitzende: MinDir.in Prof. Dr. Veronika von Messling <br>
Geschäftsführung: Prof. Dr. med. Dr. h.c. Matthias Tschöp, Kerstin Günther<br>
Registergericht: Amtsgericht München HRB 6466 <br>
USt-IdNr: DE 129521671
<br>
<br></body></html>
<br>
<br>
<br></body></html>