Many people have listed alternatives, so why not? :)
Another alternative, that we use, is to use the lua job submit plugin.
Then there is no need for a new plugin, and changes are easy to make:
just edit the lua script, and restart slurm.
Here is our lua code for enforcing a time limit:
-- If walltime is missing: fail
-- (0xfffffffe is slurm's NO_VAL)
if job_desc.time_limit == 0xfffffffe then
log_info("slurm_job_submit: job from uid %d with missing time:
Denying.",
job_desc.user_id)
return 2051 -- Signal ESLURM_INVALID_TIME_LIMIT
end
--
Regards,
Bjørn-Helge Mevik, dr. scient,
Department for Research Computing, University of Oslo