Skip to content
Snippets Groups Projects
Commit eee63695 authored by Brian Christiansen's avatar Brian Christiansen
Browse files

Set block distribution when srun requests 0 memory.

Bug 1810
parent 23f6ec89
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,7 @@ documents those changes that are of interest to users and administrators.
-- Correct sacct.a man pages describing -i option.
-- Capture salloc/srun information in sdiag statistics.
-- Fix bug in node selection with topology optimization.
-- Set block distribution when srun requests 0 memory.
* Changes in Slurm 14.11.8
==========================
......
......@@ -2128,6 +2128,13 @@ step_create(job_step_create_request_msg_t *step_specs,
(job_ptr->end_time <= time(NULL)))
return ESLURM_ALREADY_DONE;
/* Set to block in the case that mem is 0. srun leaves the dist
* set to unknown if mem is 0.
* ex. SallocDefaultCommand=srun -n1 -N1 --mem=0 ... */
if ((step_specs->task_dist == SLURM_DIST_UNKNOWN) &&
(!(step_specs->pn_min_memory &(~MEM_PER_CPU))))
step_specs->task_dist = SLURM_DIST_BLOCK;
if ((step_specs->task_dist != SLURM_DIST_CYCLIC) &&
(step_specs->task_dist != SLURM_DIST_BLOCK) &&
(step_specs->task_dist != SLURM_DIST_CYCLIC_CYCLIC) &&
......
......@@ -264,9 +264,16 @@ extern int launch_common_create_job_step(srun_job_t *job, bool use_all_cpus,
job->ctx_params.plane_size = opt.plane_size;
break;
default:
job->ctx_params.task_dist = (job->ctx_params.task_count <=
job->ctx_params.min_nodes)
? SLURM_DIST_CYCLIC : SLURM_DIST_BLOCK;
/* Leave distribution set to unknown if taskcount <= nodes and
* memory is set to 0. step_mgr will handle the 0mem case.
* ex. SallocDefaultCommand=srun -n1 -N1 --mem=0 ... */
if (!opt.mem_per_cpu || !opt.pn_min_memory)
job->ctx_params.task_dist = SLURM_DIST_UNKNOWN;
else
job->ctx_params.task_dist =
(job->ctx_params.task_count <=
job->ctx_params.min_nodes)
? SLURM_DIST_CYCLIC : SLURM_DIST_BLOCK;
if (opt.ntasks_per_node != NO_VAL)
job->ctx_params.plane_size = opt.ntasks_per_node;
opt.distribution = job->ctx_params.task_dist;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment