My purpose with job_submit.lua script is to limit a "srun" with more than one node and more than one CPU; in others words, "srun -N 1 -n 1". Because of this reason, in my future script I execute "if" for comparing that values:
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
        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_user("slurm_job_submit: parameter error %s %s %u", job_desc.cpus_per_task, job_desc.max_cpus, job_desc.max_nodes)
                return slurm.FAILURE

        return slurm.SUCCESS
I undestand that:
  • -N 1 --> job_desc.max_nodes=1
  • -n 1 --> job_desc.max_cpus=1

Am I wrong?


Reply via email to