diff --git a/NEWS b/NEWS index 280dd513635..9977c3c7d37 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ documents those changes that are of interest to users and administrators. -- Fix handling of --prefer for job arrays. -- Fix regression in 22.05.5 that causes some jobs that request --ntasks-per-node to be incorrectly rejected. + -- Fix slurmctld crash when a step requests fewer tasks than nodes. * Changes in Slurm 22.05.8 ========================== diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c index 5fb17390575..0c4def82c2b 100644 --- a/src/slurmctld/step_mgr.c +++ b/src/slurmctld/step_mgr.c @@ -2135,7 +2135,10 @@ static int _pick_step_cores(step_record_t *step_ptr, job_resrcs_ptr->core_bitmap); } } - cpus_per_task = cpu_cnt / task_cnt; + if (task_cnt) + cpus_per_task = cpu_cnt / task_cnt; + else + cpus_per_task = cpu_cnt; /* select idle cores that fit all gres binding first */ if (_handle_core_select(step_ptr, job_resrcs_ptr, all_gres_core_bitmap, job_node_inx,