diff --git a/NEWS b/NEWS index a0932a9baa2914efd5f6a7620cacb089f5188a6b..6ceaa08bd0e99228aaf7c81f34e0518768cfbc98 100644 --- a/NEWS +++ b/NEWS @@ -42,7 +42,7 @@ documents those changes that are of interest to users and admins. -- BLUEGENE - more robust checking for states when freeing blocks. -- Added correct files to the slurm.spec file for correct perl api rpm creation. - + * Changes in SLURM 2.2.0 ======================== -- Change format of Duration field in "scontrol show reservation" output from diff --git a/src/plugins/select/bluegene/plugin/bg_job_place.c b/src/plugins/select/bluegene/plugin/bg_job_place.c index 71ebf6f8f4f6e25f007292f160fb99f8665b7229..126ab37aa2938677a959a3a2427f3acf2806770e 100644 --- a/src/plugins/select/bluegene/plugin/bg_job_place.c +++ b/src/plugins/select/bluegene/plugin/bg_job_place.c @@ -729,6 +729,7 @@ static int _dynamically_request(List block_list, int *blocks_added, List list_of_lists = NULL; List temp_list = NULL; List new_blocks = NULL; + List job_list = NULL, booted_list = NULL; ListIterator itr = NULL; int rc = SLURM_ERROR; int create_try = 0; @@ -746,20 +747,28 @@ static int _dynamically_request(List block_list, int *blocks_added, if (SELECT_IS_PREEMPT_SET(query_mode) && SELECT_IS_CHECK_FULL_SET(query_mode)) { list_append(list_of_lists, block_list); - } else if (user_req_nodes) - list_append(list_of_lists, bg_lists->job_running); - else { + } else if (user_req_nodes) { + slurm_mutex_lock(&block_state_mutex); + job_list = copy_bg_list(bg_lists->job_running); + list_append(list_of_lists, job_list); + slurm_mutex_unlock(&block_state_mutex); + } else { + slurm_mutex_lock(&block_state_mutex); list_append(list_of_lists, block_list); if (list_count(block_list) != list_count(bg_lists->booted)) { - list_append(list_of_lists, bg_lists->booted); + booted_list = copy_bg_list(bg_lists->booted); + list_append(list_of_lists, booted_list); if (list_count(bg_lists->booted) - != list_count(bg_lists->job_running)) - list_append(list_of_lists, - bg_lists->job_running); + != list_count(bg_lists->job_running)) { + job_list = copy_bg_list(bg_lists->job_running); + list_append(list_of_lists, job_list); + } } else if (list_count(block_list) != list_count(bg_lists->job_running)) { - list_append(list_of_lists, bg_lists->job_running); + job_list = copy_bg_list(bg_lists->job_running); + list_append(list_of_lists, job_list); } + slurm_mutex_unlock(&block_state_mutex); } itr = list_iterator_create(list_of_lists); while ((temp_list = (List)list_next(itr))) { @@ -838,6 +847,10 @@ static int _dynamically_request(List block_list, int *blocks_added, if (list_of_lists) list_destroy(list_of_lists); + if (job_list) + list_destroy(job_list); + if (booted_list) + list_destroy(booted_list); return rc; } diff --git a/src/plugins/select/bluegene/plugin/dynamic_block.c b/src/plugins/select/bluegene/plugin/dynamic_block.c index 8c17f5601aee7c22573dd841995b16e86b90231f..de672cb300497562fea90519dc653b48ecebde37 100644 --- a/src/plugins/select/bluegene/plugin/dynamic_block.c +++ b/src/plugins/select/bluegene/plugin/dynamic_block.c @@ -75,11 +75,15 @@ extern List create_dynamic_block(List block_list, } memset(&blockreq, 0, sizeof(blockreq_t)); - slurm_mutex_lock(&block_state_mutex); if (my_block_list) { reset_ba_system(track_down_nodes); itr = list_iterator_create(my_block_list); while ((bg_record = list_next(itr))) { + if (bg_record->magic != BLOCK_MAGIC) { + error("got a block with bad magic"); + list_remove(itr); + continue; + } if (bg_record->free_cnt) { if (bg_conf->slurm_debug_flags & DEBUG_FLAG_BG_PICK) { @@ -402,7 +406,6 @@ finished: if (results) list_destroy(results); errno = rc; - slurm_mutex_unlock(&block_state_mutex); return new_blocks; }