<div dir="ltr">Hi, <br><br>I would like to block jobs submitted in our GPU partition when gres=gpu:1 (or any number between 1 and 4) is not specified when submitting a job through sbatch or requesting an interactive session with srun. <div>Currently, /etc/slurm/slurm.conf has JobSumitPlugins=lua commented. <br>The liblua.so is now installed. </div><div>I would like to use something similar as the example mentioned at the end of the page: <br><a href="https://slurm.schedmd.com/resource_limits.html">https://slurm.schedmd.com/resource_limits.html<br></a>Can I use the following code : <br><pre style="box-sizing:border-box;margin-top:0px;margin-bottom:1.5em;padding:12px 18px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;font-size:0.85em;line-height:1.5em;font-family:"Source Code Pro",monospace;vertical-align:baseline;background:rgb(51,51,51);color:rgb(238,238,238);overflow:auto">function slurm_job_submit(job_desc, part_list, submit_uid)
   if (job_desc.gres ~= nil)
   then
      for g in job_desc.gres:gmatch("[^,]+")
      do
         bad = string.match(g,'^gpu[:]*[0-9]*$')
         if (bad ~= nil)
         then
            slurm.log_info("User specified gpu GRES without type: %s", bad)
            slurm.user_msg("You must always specify a type when requesting gpu GRES")
            return slurm.ERROR
         end
      end
   end
end</pre>I do not need to check if the model is specified though. In that case, </div><div>1/ Should I change the line bad = string.match(g,'^gpu[:]*[0-9]*$') to string.match(g,'^gpu[:]*[0-9]') </div><div>2/ Do I need to uncomment 

JobSumitPlugins=lua</div><div>3/ Where to specify the function call slurm_job_submit so I make sure the check to see if gres=gpu:1 is happening?<br>4/ I would need job_submit_lua.so, where can I find that library and if it is not there, how can i dowload it? <br><br>Thanks for your help. I am new to regular expressions, lua and Slurm so I apologize if my questions do not make sense. <br><br><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><b><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#9c1d21">Fritz Ratnasamy</span></b><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#9c1d21">Data Scientist</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Arial",sans-serif;color:#9c1d21">Information Technology</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="color:rgb(103,110,115);font-family:Times,serif;font-size:10.5pt">The University of Chicago</span></p><p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">Booth School of Business</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">5807 S. Woodlawn</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">Chicago,</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"> </span><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">Illinois</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"> </span><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">60637</span></p>

<p class="MsoNormal" style="background-image:initial;background-position:initial;background-repeat:initial"><span style="font-size:10.5pt;font-family:"Times",serif;color:#676e73">Phone: +(1) 773-834-4556</span><span style="font-size:10.5pt;font-family:"Helvetica Neue";color:#333333"></span></p></div></div></div></div></div>