Re: [slurm-users] Limit to "-N1" and "-n1" with job_submit.lua

2018-04-17 Thread Chris Samuel
On Monday, 16 April 2018 11:00:59 PM AEST Sysadmin CAOS wrote:

> However, this script is not working as I desire because logged value for
> job_desc.max_cpus return a value too big. I get "4294967294" for
> job_desc.max_cpus and "1" for job_desc.max_nodes...

That large number means the limit has not been specified by the user.

All the best,
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC




[slurm-users] Limit to "-N1" and "-n1" with job_submit.lua

2018-04-16 Thread Sysadmin CAOS

  
  
Hello,

Some days ago, I posted a question about a job_submit.lua I was
writing to limit "srun" to only one node and one core. My script was
this:
function slurm_job_submit(job_desc, part_list,
submit_uid)
      local partition = "interactive"
      if ((job_desc.script == nil or job_desc.script == '')
and job_desc.partition ~= partition) then
      slurm.log_info("slurm_job_submit: interactive
job submitted by user_id:%d to partition:%s rejected",
job_desc.user_id, job_desc.partition)
      return slurm.FAILURE
      end
      local max = 1
  
      if (job_desc.cpus_per_task > max or
job_desc.max_cpus > max or job_desc.max_nodes > max) then
      slurm.log_info("slurm_job_submit: error de
parametros %s %s %u", job_desc.cpus_per_task, job_desc.max_cpus,
job_desc.max_nodes)
      return slurm.FAILURE
      end
  
      return slurm.SUCCESS
  end
  

However, this script is not working as I desire because logged value
for job_desc.max_cpus return a value too big.
  I get "4294967294" for job_desc.max_cpus and "1" for
  job_desc.max_nodes...
  
  
  Thanks.