> I searched the slurm.conf documentation, the mailing list and also the
> changelog, but found no reference to a matching parameter.
> Do anyone of you know the behavior and how to change it?

Hi,

This was an annoying change:

22.05.x RELEASE_NOTES:
 -- srun will no longer read in SLURM_CPUS_PER_TASK. This means you will
    implicitly have to specify --cpus-per-task on your srun calls, or set the
    new SRUN_CPUS_PER_TASK env var to accomplish the same thing.

Here one can find relevant discussion:

https://bugs.schedmd.com/show_bug.cgi?id=15632

I'll attach our cli-filter pre_submit function which works for us.

BR,
Tommi Tervo
CSC


function slurm_cli_pre_submit(options, pack_offset)
  --slurm.log_info("Function: %s", "CSC pre_submit")
  p = require("posix")
  -- cpus_per_task = p.getenv("SLURM_CPUS_PER_TASK")
  cpus_per_task = options['cpus-per-task']
  if (cpus_per_task ~= nil and tonumber(cpus_per_task) > 0) then
    --Set the environment variable:
    p.setenv("SRUN_CPUS_PER_TASK", cpus_per_task)
    cpus_per_task=p.getenv("SRUN_CPUS_PER_TASK")
    --slurm.log_info("SRUN_CPUS_PER_TASK=%u", cpus_per_task)

    --Or set the command-line option:
    --options['cpus-per-task'] = cpus_per_task
    --slurm.log_info("SRUN_CPUS_PER_TASK=%u", options['cpus-per-task'])
  end
    return slurm.SUCCESS
end

Reply via email to