diff --git a/NEWS b/NEWS index 3efe9ff9580a0d28a0ea63ff08a6108d0781b990..1695f3d27f484f731f4590ca66ea89b604b4406b 100644 --- a/NEWS +++ b/NEWS @@ -32,7 +32,7 @@ documents those changes that are of interest to users and admins. -- Fix squeue/scancel to query correctly against accounts of different case. -- Abort an srun command when it's associated job gets aborted due to a dependency that can not be satisfied. - -- When srun is used with the --exclusive and --m plane=# options, insure + -- When srun is used with the --exclusive and --m plane=# options, always allocate tasks in blocks of the plane size. -- In jobcomp plugins, report start time of zeroif pending job is cancelled. Previously may report expected start time. diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h index 588b10452a3e1d22b26c9a676965ca0a53a9ff0b..96afd1db7007dae50d2c32440dec2383b4fd3960 100644 --- a/src/slurmctld/slurmctld.h +++ b/src/slurmctld/slurmctld.h @@ -1527,7 +1527,7 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr, uint32_t num_tasks, uint16_t cpus_per_task, uint16_t task_dist, - uint32_t plane_size); + uint16_t plane_size); /* start_power_mgr - Start power management thread as needed. The thread * terminates automatically at slurmctld shutdown time. diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index 75b65bad9d8900fea544d9ddd57c4517225e8baf..b4c79faeb4fe2a49116c41710f4bbc95f0c89a20 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -1727,7 +1727,7 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr, uint32_t num_tasks, uint16_t cpus_per_task, uint16_t task_dist, - uint32_t plane_size) + uint16_t plane_size) { uint16_t cpus_per_node[node_count]; uint32_t cpu_count_reps[node_count], gres_cpus; @@ -1769,6 +1769,12 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr, if (step_ptr->exclusive) { usable_cpus = job_resrcs_ptr->cpus[pos] - job_resrcs_ptr->cpus_used[pos]; + if (plane_size && + (plane_size != (uint16_t)NO_VAL)) { + /* Round count down */ + usable_cpus /= plane_size; + usable_cpus *= plane_size; + } } else usable_cpus = job_resrcs_ptr->cpus[pos]; if (step_ptr->mem_per_cpu && _is_mem_resv()) {