<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
I'm writing my own "job_submit.lua" for controlling in what
partition a user can run a "srun" and how many CPUs and nodes are
allowed. I want to allow only "srun" in partition "interactive" with
only one core and one node. I have wrote this script but I'm getting
errors:<br>
<blockquote><tt>function slurm_job_submit(job_desc, part_list,
submit_uid)</tt><br>
<tt> local partition = "interactive"</tt><br>
<tt> if ((job_desc.script == nil or job_desc.script == '')
and job_desc.partition ~= partition) then</tt><br>
<tt> slurm.log_info("slurm_job_submit: interactive
job submitted by user_id:%d to partition:%s rejected",
job_desc.user_id, job_desc.partition)</tt><br>
<tt> return slurm.FAILURE</tt><br>
<tt> end</tt><br>
<tt> <br>
local max = 1</tt><br>
<br>
<tt> if (job_desc.cpus_per_task > max or
job_desc.max_cpus > max or job_desc.max_nodes > max) then</tt><br>
<tt> slurm.log_user("slurm_job_submit: parameter
error %s %s %u", job_desc.cpus_per_task, job_desc.max_cpus,
job_desc.max_nodes)</tt><br>
<tt> return slurm.FAILURE</tt><br>
<tt> end</tt><br>
<br>
<tt> return slurm.SUCCESS</tt><br>
<tt>end<br>
<br>
</tt></blockquote>
It seems fields "cpus_per_task" and "max_cpus" are not being printed
correctly ("max_nodes" is allright), because after running "srun"
with this:<tt> <br>
srun -p interactive.q -N 1 -n 1 -w aolin15 --pty bash<br>
<br>
</tt>...I get this error:<tt><br>
srun: error: slurm_job_submit: parameter error 65534
4294967294 1<br>
<br>
</tt>Fields "cpus_per_task" is uint16_t, while "max_cpus" and
"max_nodes" are uint32_t... but I have tried with "%u" and it didn't
work...<br>
<tt><br>
<br>
</tt>Could anybody help me?<br>
<br>
Thanks.<br>
<tt></tt><br>
<br>
</body>
</html>