<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!-- p { margin-top: 0px; margin-bottom: 0px; }--></style>
</head>
<body dir="ltr" style="font-size:14pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Yair,</p>
<p><br>
</p>
<p>You can set maxsubmitjob=0 on an account.<br>
</p>
<p><br>
</p>
<p>The error message isn't helpful beyond the obvious though:<br>
</p>
<p><br>
</p>
<div><span style="font-family: Consolas, monospace; font-size: 12pt;">] salloc</span></div>
<div><span style="font-family: Consolas, monospace; font-size: 12pt;">salloc: error: AssocMaxSubmitJobLimit</span></div>
<div><span style="font-family: Consolas, monospace; font-size: 12pt;">salloc: error: Job submit/allocate failed: Job violates accounting/QOS policy (job submit limit, user's size and/or time limits)</span></div>
<div><br>
So the lua script is preferable.<br>
</div>
<div><br>
</div>
<p>Kind regards,<br>
</p>
<p> Sam<br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div class="BodyFragment"> </div>
</div>
</div>
<div style="color: rgb(33, 33, 33);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> slurm-users <slurm-users-bounces@lists.schedmd.com> on behalf of Yair Yarom <irush@cs.huji.ac.il><br>
<b>Sent:</b> Wednesday, 7 November 2018 00:58<br>
<b>To:</b> Slurm User Community List<br>
<b>Subject:</b> Re: [slurm-users] Accounting: set default account with no access</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>Hi,</div>
<div><br>
</div>
<div>You can set the maxsubmitjob=0 on that default account. That should prevent anyone from using it, but it won't have a specific message like with the lua plugin. E.g.</div>
<div>sacctmgr update account default set maxsubmitjob=0</div>
<div><br>
</div>
<div>Regards,<br>
</div>
<div> Yair.<br>
</div>
<div><br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Tue, Nov 6, 2018 at 12:58 AM Renfro, Michael <<a href="mailto:Renfro@tntech.edu">Renfro@tntech.edu</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
>From <a href="https://stackoverflow.com/a/46176694" rel="noreferrer" target="_blank">
https://stackoverflow.com/a/46176694</a>:<br>
<br>
>> I had the same requirement to force users to specify accounts and, after finding several ways to fulfill it with slurm, I decided to revive this post with the shortest/easiest solution.<br>
>> <br>
>> The slurm lua submit plugin sees the job description before the default account is applied. Hence, you can install the slurm-lua package, add "JobSubmitPlugins=lua" to the slurm.conf, restart the slurmctld, and directly test against whether the account was
defined via the job_submit.lua script (create the script wherever you keep your slurm.conf; typically in /etc/slurm/):<br>
>> <br>
>> -- /etc/slurm/job_submit.lua to reject jobs with no account specified<br>
>> <br>
>> function slurm_job_submit(job_desc, part_list, submit_uid)<br>
>> if job_desc.account == nil then<br>
>> slurm.log_error("User %s did not specify an account.", job_desc.user_id)<br>
>> slurm.log_user("You must specify an account!")<br>
>> return slurm.ERROR<br>
>> end<br>
>> return slurm.SUCCESS<br>
>> end<br>
>> <br>
>> function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)<br>
>> return slurm.SUCCESS<br>
>> end<br>
>> <br>
>> return slurm.SUCCESS<br>
<br>
> On Nov 5, 2018, at 4:09 PM, Brian Andrus <<a href="mailto:toomuchit@gmail.com" target="_blank">toomuchit@gmail.com</a>> wrote:<br>
> <br>
> All,<br>
> <br>
> I am trying to figure the best way to require users to explicitly specify an account when submitting jobs (--account= )<br>
> <br>
> What I was thinking was to create a default account for the users that has no ability to submit any jobs, so if they don't specify, any submission would fail.<br>
> <br>
> What I'm not seeing is how to set such an option on an account. I was hoping to do something like cluster=none for it's access, but that is not allowed.<br>
> <br>
> <br>
> Is there a way to set an account to not have access to submit jobs?<br>
> Alternatively is there an easier way to require the --account= option for jobs?<br>
> <br>
> <br>
> Brian Andrus<br>
> <br>
> <br>
<br>
<br>
</blockquote>
</div>
</div>
</div>
</body>
</html>