Marcus Wagner <wag...@itc.rwth-aachen.de> writes:

> does anyone know how to detect in the lua submission script, if the
> user used --mem or --mem-per-cpu?
>
> And also, if it is possible to "unset" this setting?

Something like this should work:

if job_desc.pn_min_memory ~= slurm.NO_VAL64 then
   -- --mem or --mem-per-cpu was used; unset it
   job_desc.pn_min_memory = slurm.NO_VAL64
end

> The reason is, we want to remove all memory thingies set by the user
> for exclusive jobs.

We just reject jobs if they use a setting we don't allow -- that avoids
jobs running differently than what the user believed.  For instance:

   -- Bigmem jobs should specify memory, no other job should
   if job_desc.pn_min_memory == slurm.NO_VAL64 then
      -- If bigmem: fail
      if job_desc.partition == "bigmem" then
         slurm.log_info(
            "bigmem job from uid %d without memory specification: Denying.",
            job_desc.user_id)
         slurm.user_msg("--mem or --mem-per-cpu required for bigmem jobs")
         return 2044 -- Signal ESLURM_INVALID_TASK_MEMORY
      end
   else
      -- If not bigmem: fail
      if job_desc.partition ~= "bigmem" then
         slurm.log_info(
            "non-bigmem job from uid %d with memory specification: Denying.",
            job_desc.user_id)
         slurm.user_msg("Memory specification only allowed for bigmem jobs")
         return 2044 -- Signal ESLURM_INVALID_TASK_MEMORY
      end
   end

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

Attachment: signature.asc
Description: PGP signature

Reply via email to