Re: [slurm-users] memory in job_submit.lua

2020-02-27 Thread Bjørn-Helge Mevik
Marcus Wagner  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


signature.asc
Description: PGP signature


[slurm-users] memory in job_submit.lua

2020-02-27 Thread Marcus Wagner

Hi folks,


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?

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


Best
Marcus

--
Marcus Wagner, Dipl.-Inf.

IT Center
Abteilung: Systeme und Betrieb
RWTH Aachen University
Seffenter Weg 23
52074 Aachen
Tel: +49 241 80-24383
Fax: +49 241 80-624383
wag...@itc.rwth-aachen.de
www.itc.rwth-aachen.de