<div dir="ltr">Thank you for the answer.<div>I wasn't aware of that file.</div><div>I'll look into it!<div><br></div><div>Best,</div><div>Jaekyeom</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 5, 2020 at 3:27 AM Renfro, Michael <<a href="mailto:Renfro@tntech.edu">Renfro@tntech.edu</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 dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Untested, but you should be able to use a job_submit.lua file to detect if the job was started with srun or sbatch:</div>
<div>
<ul>
<li><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">Check with (job_desc.script == nil or job_desc.script == '')</span><br>
</li><li><span style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">Adjust job_desc.time_limit accordingly</span></li></ul>
<div><font color="#000000" face="Calibri, Arial, Helvetica, sans-serif"><span>Here, I just gave people a shell function "hpcshell", which automatically drops them in a time-limited partition. Easier for them, fewer idle resources
 for everyone:</span></font></div>
<div><font color="#000000" face="Calibri, Arial, Helvetica, sans-serif"><span><br>
</span></font></div>
<div><font color="#000000" face="Calibri, Arial, Helvetica, sans-serif"><span>hpcshell ()
<div>{</div>
<div>    srun --partition=interactive $@ --pty $SHELL -i</div>
}<br>
</span></font></div>
</div>
<div id="gmail-m_187588261176707095appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_187588261176707095divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> slurm-users <<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a>> on behalf of Jaekyeom Kim <<a href="mailto:btapiz@gmail.com" target="_blank">btapiz@gmail.com</a>><br>
<b>Sent:</b> Tuesday, August 4, 2020 5:35 AM<br>
<b>To:</b> <a href="mailto:slurm-users@schedmd.com" target="_blank">slurm-users@schedmd.com</a> <<a href="mailto:slurm-users@schedmd.com" target="_blank">slurm-users@schedmd.com</a>><br>
<b>Subject:</b> [slurm-users] Correct way to give srun and sbatch different MaxTime values?</font>
<div> </div>
</div>
<div>
<p align="center" style="text-align:center;background:white;margin:0px"><b><span style="font-size:12pt;color:red;background:white;font-family:Calibri,sans-serif">External Email Warning</span></b></p>
<p align="center" style="text-align:center;background:white;margin:0px 12pt"><b><span style="font-size:12pt;color:red;font-family:Calibri,sans-serif">This email originated from outside the university. Please use caution when opening attachments, clicking
 links, or responding to requests.</span></b><span style="font-size:12pt"></span></p>
<hr>
<div>
<div dir="ltr">Hi,
<div><br>
</div>
<div>I'd like to prevent my Slurm users from taking up resources with dummy shell process jobs left unaware/intentionally.</div>
<div>To that end, I simply want to put a tougher maximum time limit for srun only.</div>
<div>One possible way might be to wrap the srun binary.</div>
<div>But could someone tell me if there is any proper way to do it, please?</div>
<div><br>
</div>
<div>Best,</div>
<div>Jaekyeom</div>
<div><br>
</div>
</div>
</div>
</div>
</div>

</blockquote></div>