pankajd <pank...@cdac.in> writes:

> We have slurm 21.08.6 and GPUs in our compute nodes. We want to restrict /
> disable the use of "exclusive" flag in srun for users. How should we do it?

Two options would be to use the CLI_filter plugin or the job_submit
plugin.  If you want the enforcement to be guaranteed, then the
job_submit plugin is the place (cli_filter can be circumvented by user).

For instance, in job_submit.lua:

   if job_desc.shared == 0 or job_desc.shared == 2 or job_desc.shared == 3 then
        slurm.user_msg ("Warning! Please do not use --exclusive unless you 
really know what you are doing.  Your job might be accounted for more CPUs than 
it actually uses, sometimes many times more.  There are better ways to specify 
using whole nodes, for instance using all cpus on the node or all memory on the 
node.")
    end

or in cli_filter.lua:

   is_bad_exclusive = { exclusive = true, user = true, mcs = true }
   if is_bad_exclusive[options["exclusive"]] then
      slurm.log_info("Warning! Please do not use --exclusive unless you really 
know what you are doing.  Your job might be accounted for more CPUs than it 
actually uses, sometimes many times more.  There are better ways to specify 
using whole nodes, for instance using all cpus on the node or all memory on the 
node.")
   end

(both of these just warn, though, but should be easy to change into
rejecting the job.)

-- 
Regards,
Bjørn-Helge Mevik, dr. scient,
Department for Research Computing, University of Oslo

Attachment: signature.asc
Description: PGP signature

Reply via email to