Skip to content
Snippets Groups Projects
Commit 55b11695 authored by Morris Jette's avatar Morris Jette
Browse files

Prevent abort if core count of node's in reservation change

parent fbb7ba27
No related branches found
No related tags found
No related merge requests found
...@@ -315,7 +315,7 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap, ...@@ -315,7 +315,7 @@ static int _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
job_ptr->details->shared = 0; job_ptr->details->shared = 0;
tmp_bitmap = bit_copy(*avail_bitmap); tmp_bitmap = bit_copy(*avail_bitmap);
if (exc_core_bitmap){ if (exc_core_bitmap) {
bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap);
debug2(" _try_sched with exclude core bitmap: %s",str); debug2(" _try_sched with exclude core bitmap: %s",str);
} }
......
...@@ -2104,9 +2104,24 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, ...@@ -2104,9 +2104,24 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap,
bit_copybits(bitmap, orig_map); bit_copybits(bitmap, orig_map);
bit_copybits(free_cores, avail_cores); bit_copybits(free_cores, avail_cores);
if (exc_core_bitmap) {
int exc_core_size = bit_size(exc_core_bitmap);
int free_core_size = bit_size(free_cores);
if (exc_core_size != free_core_size) {
/* This would indicate that cores were added to or
* removed from nodes in this reservation when the
* slurmctld daemon restarted with a new slurm.conf
* file. This can result in cores being lost from a
* reservation. */
error("Bad core_bitmap size for reservation %s "
"(%d != %d), ignoring core reservation",
job_ptr->resv_name,
exc_core_size, free_core_size);
exc_core_bitmap = NULL; /* Clear local value */
}
}
if (exc_core_bitmap) { if (exc_core_bitmap) {
char str[100]; char str[100];
bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap); bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap);
debug2("excluding cores reserved: %s", str); debug2("excluding cores reserved: %s", str);
...@@ -2499,7 +2514,7 @@ alloc_job: ...@@ -2499,7 +2514,7 @@ alloc_job:
return error_code; return error_code;
/* load memory allocated array */ /* load memory allocated array */
save_mem =details_ptr->pn_min_memory; save_mem = details_ptr->pn_min_memory;
if (save_mem & MEM_PER_CPU) { if (save_mem & MEM_PER_CPU) {
/* memory is per-cpu */ /* memory is per-cpu */
save_mem &= (~MEM_PER_CPU); save_mem &= (~MEM_PER_CPU);
......
...@@ -2623,8 +2623,8 @@ bitstr_t *sequential_pick(bitstr_t *avail_bitmap, uint32_t node_cnt, ...@@ -2623,8 +2623,8 @@ bitstr_t *sequential_pick(bitstr_t *avail_bitmap, uint32_t node_cnt,
if (cores_in_node) { if (cores_in_node) {
/* Add this node to the final node bitmap */ /* Add this node to the final node bitmap */
debug2("Reservation using %d cores in " debug2("Reservation using %d cores in node %d",
"node %d", cores_in_node, inx); cores_in_node, inx);
bit_set(sp_avail_bitmap, inx); bit_set(sp_avail_bitmap, inx);
} else { } else {
debug2("Reservation NOT using node %d", inx); debug2("Reservation NOT using node %d", inx);
......
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