<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>Typo on my part. Yes, it is SIGSTOP, which cannot be caught..<br>
    </p>
    <p>Maybe you could,  "pre-signal" any running job with SIGUSR1
      before sending the suspend command. At least, if you are manually
      suspending the job(s). That could be caught and acted upon before
      the SIGSTOP was received.<br>
    </p>
    <p>Brian</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 10/15/2019 10:52 PM, Oytun Peksel
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:c87a15409b2241af976fdb8de2664e0a@semcon.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <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]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Brian,<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">So
            probably I will dig deeper into what you suggested.<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">Thanks
            <o:p></o:p></span></p>
        <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"><o:p> </o:p></span></p>
        <div>
          <p class="MsoNormal"
            style="margin-bottom:12.0pt;line-height:11.0pt"><span
              style="color:#1F497D;mso-fareast-language:SV" lang="EN-US"><br>
              <br>
              <o:p></o:p></span></p>
          <table class="MsoNormalTable" style="width:375.0pt" width="0"
            cellspacing="0" cellpadding="0" border="0">
            <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"
                        lang="EN-US">Oytun Peksel</span></b><span
                      style="font-size:10.0pt;mso-fareast-language:SV"
                      lang="EN-US"><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"
                      moz-do-not-send="true"><span
                        style="font-size:10.0pt;color:black;mso-fareast-language:SV"
                        lang="EN-US">oytun.peksel@semcon.com
                      </span></a><span
                      style="font-size:10.0pt;mso-fareast-language:SV"
                      lang="EN-US"><o:p></o:p></span></p>
                </td>
                <td style="padding:0cm 0cm 0cm 0cm"><br>
                </td>
                <td style="padding:0cm 0cm 0cm 0cm"><br>
                </td>
              </tr>
              <tr>
                <td style="width:345.0pt;padding:0cm 0cm 0cm 0cm"
                  width="460">
                  <p class="MsoNormal" style="line-height:10.0pt"><span
                      style="font-size:10.0pt;mso-fareast-language:SV"
                      lang="EN-US">+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"><br>
                </td>
                <td style="padding:0cm 0cm 0cm 0cm"><br>
                </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
                  style="color:windowtext;mso-fareast-language:SV"
                  lang="EN-US">From:</span></b><span
                style="color:windowtext;mso-fareast-language:SV"
                lang="EN-US"> slurm-users
                <a class="moz-txt-link-rfc2396E" href="mailto:slurm-users-bounces@lists.schedmd.com"><slurm-users-bounces@lists.schedmd.com></a>
                <b>On Behalf Of </b>Brian Andrus<br>
                <b>Sent:</b> den 15 oktober 2019 20:58<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:slurm-users@lists.schedmd.com">slurm-users@lists.schedmd.com</a><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
            style="font-size:12.0pt;mso-fareast-language:SV"
            lang="EN-US"><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 style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"> </span><span
              lang="EN-US"><o:p></o:p></span></p>
          <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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
              style="font-family:Symbol" lang="EN-US"><span
                style="mso-list:Ignore">·<span style="font:7.0pt
                  "Times New Roman"">       
                </span></span></span><!--[endif]--><span
              style="color:#1F497D" lang="EN-US">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
              style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US"> </span><o:p></o:p></p>
          <p class="MsoNormal"><span style="color:#1F497D" lang="EN-US">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 style="color:#1F497D" lang="EN-US"> </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
                style="color:#1F497D;mso-fareast-language:SV"
                lang="EN-US"><br>
                <br>
                <br>
              </span><span lang="EN-US"><o:p></o:p></span></p>
            <table class="MsoNormalTable" style="width:375.0pt"
              width="0" cellspacing="0" cellpadding="0" border="0">
              <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"
                        moz-do-not-send="true"><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"><br>
                  </td>
                  <td style="padding:0cm 0cm 0cm 0cm"><br>
                  </td>
                </tr>
                <tr>
                  <td style="width:345.0pt;padding:0cm 0cm 0cm 0cm"
                    width="460">
                    <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"><br>
                  </td>
                  <td style="padding:0cm 0cm 0cm 0cm"><br>
                  </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
                    style="mso-fareast-language:SV" lang="EN-US">From:</span></b><span
                  style="mso-fareast-language:SV" lang="EN-US">
                  slurm-users
                </span><a
                  href="mailto:slurm-users-bounces@lists.schedmd.com"
                  moz-do-not-send="true"><span
                    style="mso-fareast-language:SV" lang="EN-US"><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"
                  moz-do-not-send="true"><span
                    style="mso-fareast-language:SV" lang="EN-US">slurm-users@lists.schedmd.com</span></a><span
                  style="mso-fareast-language:SV" lang="EN-US"><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 style="font-size:12.0pt"
              lang="EN-US"><br>
            </span><span
              style="font-size:7.5pt;color:gray;mso-fareast-language:SV"
              lang="EN-US"><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/"
              moz-do-not-send="true"><i><span
                  style="font-size:7.5pt;mso-fareast-language:SV"
                  lang="EN-US">Privacy Policy</span></i></a><i><span
                style="font-size:7.5pt;color:gray;mso-fareast-language:SV"
                lang="EN-US">.</span></i><span lang="EN-US"><o:p></o:p></span></p>
        </blockquote>
      </div>
    </blockquote>
  </body>
</html>