diff --git a/NEWS b/NEWS index 05961e024cccc1906e30fba7e23d3e80f652e46c..8d37ad7caf95e33e3c474e1a892275fb1ef159c0 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ documents those changes that are of interest to users and admins. -- CRAY - fix for handling memory requests from user for an allocation. -- Add support for switches parameter to the job_submit/lua plugin. Work by Par Andersson, NSC. + -- Fix to job preemption logic to preempt multiple jobs at the same time. * Changes in SLURM 2.3.4 ======================== diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c index 02413b03d8d34548271002b28e9b6cfcc1a2afaf..7534a9292c9b3f558dff905e9767b03519ffb263 100644 --- a/src/plugins/select/cons_res/select_cons_res.c +++ b/src/plugins/select/cons_res/select_cons_res.c @@ -1577,22 +1577,34 @@ top: orig_map = bit_copy(save_bitmap); cr_type, job_node_req, select_node_cnt, future_part, future_usage); - tmp_job_ptr->details->usable_nodes = - bit_overlap(bitmap, tmp_job_ptr->node_bitmap); + tmp_job_ptr->details->usable_nodes = 0; /* * If successful, set the last job's usable count to a * large value so that it will be first after sorting. + * usable_nodes count set to zero above to eliminate + * values previously set to 9999. * Note: usable_count is only used for sorting purposes */ if (rc == SLURM_SUCCESS) { - if (pass_count++ || - (list_count(preemptee_candidates) == 1)) - break; tmp_job_ptr->details->usable_nodes = 9999; + list_iterator_reset(job_iterator); + while ((tmp_job_ptr = (struct job_record *) + list_next(job_iterator))) { + if (tmp_job_ptr->details->usable_nodes + == 9999) + break; + tmp_job_ptr->details->usable_nodes = + bit_overlap(bitmap, + tmp_job_ptr-> + node_bitmap); + } while ((tmp_job_ptr = (struct job_record *) list_next(job_iterator))) { tmp_job_ptr->details->usable_nodes = 0; } + if (pass_count++ || + (list_count(preemptee_candidates) == 1)) + break; list_sort(preemptee_candidates, (ListCmpF)_sort_usable_nodes_dec); FREE_NULL_BITMAP(orig_map); @@ -1622,9 +1634,6 @@ top: orig_map = bit_copy(save_bitmap); (mode != PREEMPT_MODE_CHECKPOINT) && (mode != PREEMPT_MODE_CANCEL)) continue; - if (bit_overlap(bitmap, - tmp_job_ptr->node_bitmap) == 0) - continue; if (tmp_job_ptr->details->usable_nodes == 0) continue; list_append(*preemptee_job_list,