<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: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:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
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
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        color:black;
        mso-fareast-language:EN-US;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;
        color:black;
        mso-fareast-language:SV;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1368288141;
        mso-list-type:hybrid;
        mso-list-template-ids:-1029154388 69009409 69009411 69009413 69009409 69009411 69009413 69009409 69009411 69009413;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        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:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        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:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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 bgcolor="white" lang="SV" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Brian,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks for your response. I am looking into that option. I am a bit confused about which signal is sent though. I thought it was SIGSTOP not SIGSTP. And I read you can’t really catch and stop SIGSTOP
 or SIGCONT signals but I am not very good at sys admin stuff anyway.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So in the end, these feel like dirty tricks to me. The select/* plugins should have  mechanisms to run scripts and such before sending signals. But apparently there is no such mechanism.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">So probably I will dig deeper into what you suggested.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Thanks <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;line-height:11.0pt"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:SV"><br>
<br>
<o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:375.0pt">
<tbody>
<tr>
<td colspan="3" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:10.0pt"><b><span lang="EN-US" style="font-size:10.0pt;mso-fareast-language:SV">Oytun Peksel</span></b><span lang="EN-US" style="font-size:10.0pt;mso-fareast-language:SV"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-line-height-alt:10.0pt"><a href="mailto:oytun.peksel@semcon.com"><span lang="EN-US" style="font-size:10.0pt;color:black;mso-fareast-language:SV">oytun.peksel@semcon.com
</span></a><span lang="EN-US" style="font-size:10.0pt;mso-fareast-language:SV"><o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
</tr>
<tr>
<td width="460" style="width:345.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:10.0pt"><span lang="EN-US" style="font-size:10.0pt;mso-fareast-language:SV">+4673920</span><span style="font-size:10.0pt;mso-fareast-language:SV">5917<o:p></o:p></span></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="color:#1F497D"><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" style="color:windowtext;mso-fareast-language:SV">From:</span></b><span lang="EN-US" style="color:windowtext;mso-fareast-language:SV"> slurm-users <slurm-users-bounces@lists.schedmd.com>
<b>On Behalf Of </b>Brian Andrus<br>
<b>Sent:</b> den 15 oktober 2019 20:58<br>
<b>To:</b> slurm-users@lists.schedmd.com<br>
<b>Subject:</b> Re: [slurm-users] Execute scripts on suspend and cancel<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p><span lang="EN-US">It seems that there are some details that would need addressed.</span><span lang="EN-US" style="font-size:12.0pt;mso-fareast-language:SV"><o:p></o:p></span></p>
<p><span lang="EN-US">A suspend signal is nothing more than sending a SIGSTP (like hitting ctrl-s), so the application is still in memory awaiting SIGCONT<o:p></o:p></span></p>
<p><span lang="EN-US">So what should happen when it continues and there are no more licenses? So the proper place for what you are looking for is in the application itself. If it is given a SIGSTP, it could release the licenses and then check them out again
 when SIGCONT is received.<o:p></o:p></span></p>
<p><span lang="EN-US">If you are able to tell your app to release/request a license externally, you may want to have a wrapper to do the signal handling until they have it as part of their app.<o:p></o:p></span></p>
<p><span lang="EN-US">Brian Andrus<o:p></o:p></span></p>
<p><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">On 10/14/2019 4:40 AM, Oytun Peksel wrote:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">It is quite weird if slurm has no mechanism as described. I have been digging more into it and someone suggested a workaround using mail notifications. You use a script instead of the mail application
 and catch the event then use use sacct to see what is happening.</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Two problems with this:
</span><o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span lang="EN-US" style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">       
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">There is no mail sent with suspended preemption</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo2"><![if !supportLists]><span style="font-family:Symbol"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">       
</span></span></span><![endif]><span lang="EN-US" style="color:#1F497D">If you use requeue instead there will be a mail event and you can catch it. Sacct will flag it as “preempted” so you know it is requeued. But then it would change it pending. So you really
 need to be quick to catch it. Also there is no distinctive flag for resuming.</span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Anyone has any other method to execute scripts during preemption?</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt;line-height:11.0pt"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:SV"><br>
<br>
<br>
</span><span lang="EN-US"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="0" style="width:375.0pt">
<tbody>
<tr>
<td colspan="3" style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:10.0pt"><b><span style="font-size:10.0pt;mso-fareast-language:SV">Oytun Peksel</span></b><o:p></o:p></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-line-height-alt:10.0pt"><a href="mailto:oytun.peksel@semcon.com"><span style="font-size:10.0pt;color:black;mso-fareast-language:SV">oytun.peksel@semcon.com
</span></a><o:p></o:p></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
</tr>
<tr>
<td width="460" style="width:345.0pt;padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="line-height:10.0pt"><span style="font-size:10.0pt;mso-fareast-language:SV">+46739205917</span><o:p></o:p></p>
</td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
<td style="padding:0cm 0cm 0cm 0cm"></td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="color:#1F497D"> </span><o:p></o:p></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" style="mso-fareast-language:SV">From:</span></b><span lang="EN-US" style="mso-fareast-language:SV"> slurm-users
</span><a href="mailto:slurm-users-bounces@lists.schedmd.com"><span lang="EN-US" style="mso-fareast-language:SV"><slurm-users-bounces@lists.schedmd.com></span></a><span style="mso-fareast-language:SV">
<b><span lang="EN-US">On Behalf Of </span></b><span lang="EN-US">Oytun Peksel<br>
<b>Sent:</b> den 11 oktober 2019 09:10<br>
<b>To:</b> </span></span><a href="mailto:slurm-users@lists.schedmd.com"><span lang="EN-US" style="mso-fareast-language:SV">slurm-users@lists.schedmd.com</span></a><span lang="EN-US" style="mso-fareast-language:SV"><br>
<b>Subject:</b> [slurm-users] Execute scripts on suspend and cancel</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I was wondering is there an option in Slurm to execute custom scripts before Suspend signal.  What I need to do is to tell an application to release it’s licenses before sending the suspend signal during preemption. I
 think went through all the documentation but could not find a mechanism like this.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">BR<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/Oytun<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:12.0pt"><br>
</span><span lang="EN-US" style="font-size:7.5pt;color:gray;mso-fareast-language:SV"><br>
<i>When you communicate with us or otherwise interact with Semcon, we will process personal data that you provide to us or we collect about you, please read more in our
</i></span><a href="https://semcon.com/data-privacy-policy/"><i><span lang="EN-US" style="font-size:7.5pt;mso-fareast-language:SV">Privacy Policy</span></i></a><i><span lang="EN-US" style="font-size:7.5pt;color:gray;mso-fareast-language:SV">.</span></i><span lang="EN-US"><o:p></o:p></span></p>
</blockquote>
</div>
</body>
</html>