diff --git a/src/common/hostlist.c b/src/common/hostlist.c index bc8d0b823fb3a2bd6c70b8d4001c351b5827a548..f9ef3876adb74ef3ba81856f11cd04c936d5998d 100644 --- a/src/common/hostlist.c +++ b/src/common/hostlist.c @@ -1558,7 +1558,8 @@ error: * RET 1 if str contained a valid number or range, * 0 if conversion of str to a range failed. */ -static int _parse_box_range(char *str, struct _range *ranges, int len, int *count) +static int _parse_box_range(char *str, struct _range *ranges, + int len, int *count) { int a[3], b[3], i1, i2, i; char new_str[8]; @@ -2411,14 +2412,28 @@ _get_boxes(char *buf, int max_len) start_box = i; end_box = i; } + + if (((len+8) < max_len) && (start_box != -1) && ((is_box == 0) || (i == axis_max_x))) { - sprintf(buf+len,"%c%c%cx%c%c%c,", - alpha_num[start_box], alpha_num[axis_min_y], - alpha_num[axis_min_z], - alpha_num[end_box], alpha_num[axis_max_y], - alpha_num[axis_max_z]); - len += 8; + if(start_box == end_box + && axis_min_y == axis_max_y + && axis_min_z == axis_max_z) { + sprintf(buf+len,"%c%c%c,", + alpha_num[start_box], + alpha_num[axis_min_y], + alpha_num[axis_min_z]); + len += 4; + } else { + sprintf(buf+len,"%c%c%cx%c%c%c,", + alpha_num[start_box], + alpha_num[axis_min_y], + alpha_num[axis_min_z], + alpha_num[end_box], + alpha_num[axis_max_y], + alpha_num[axis_max_z]); + len += 8; + } start_box = -1; end_box = -1; } diff --git a/src/common/node_select.c b/src/common/node_select.c index 935ef4fdf4bc5cdfe702be0b6bf521e9b8f8b963..711870f6e0f6bad5b37dd0d3849c4a9bd6c75bee 100644 --- a/src/common/node_select.c +++ b/src/common/node_select.c @@ -1177,16 +1177,20 @@ extern char *select_g_sprint_jobinfo(select_jobinfo_t jobinfo, sprintf(start_char, "None"); else { snprintf(start_char, sizeof(start_char), - "%1ux%1ux%1u", jobinfo->start[0], - jobinfo->start[1], jobinfo->start[2]); + "%cx%cx%c", + alpha_num[jobinfo->start[0]], + alpha_num[jobinfo->start[1]], + alpha_num[jobinfo->start[2]]); } snprintf(buf, size, - "%7.7s %6.6s %6.6s %9s %1ux%1ux%1u %5s %-16s", + "%7.7s %6.6s %6.6s %9s %cx%cx%c %5s %-16s", _job_conn_type_string(jobinfo->conn_type), _yes_no_string(jobinfo->reboot), _yes_no_string(jobinfo->rotate), max_procs_char, - geometry[0], geometry[1], geometry[2], + alpha_num[geometry[0]], + alpha_num[geometry[1]], + alpha_num[geometry[2]], start_char, jobinfo->bg_block_id); break; case SELECT_PRINT_MIXED: @@ -1200,18 +1204,22 @@ extern char *select_g_sprint_jobinfo(select_jobinfo_t jobinfo, sprintf(start_char, "None"); else { snprintf(start_char, sizeof(start_char), - "%1ux%1ux%1u", jobinfo->start[0], - jobinfo->start[1], jobinfo->start[2]); + "%cx%cx%c", + alpha_num[jobinfo->start[0]], + alpha_num[jobinfo->start[1]], + alpha_num[jobinfo->start[2]]); } snprintf(buf, size, "Connection=%s Reboot=%s Rotate=%s MaxProcs=%s " - "Geometry=%1ux%1ux%1u Start=%s Block_ID=%s", + "Geometry=%cx%cx%c Start=%s Block_ID=%s", _job_conn_type_string(jobinfo->conn_type), _yes_no_string(jobinfo->reboot), _yes_no_string(jobinfo->rotate), max_procs_char, - geometry[0], geometry[1], geometry[2], + alpha_num[geometry[0]], + alpha_num[geometry[1]], + alpha_num[geometry[2]], start_char, jobinfo->bg_block_id); break; case SELECT_PRINT_BG_ID: @@ -1237,16 +1245,20 @@ extern char *select_g_sprint_jobinfo(select_jobinfo_t jobinfo, _yes_no_string(jobinfo->rotate)); break; case SELECT_PRINT_GEOMETRY: - snprintf(buf, size, "%1ux%1ux%1u", - geometry[0], geometry[1], geometry[2]); + snprintf(buf, size, "%cx%cx%c", + alpha_num[geometry[0]], + alpha_num[geometry[1]], + alpha_num[geometry[2]]); break; case SELECT_PRINT_START: if (jobinfo->start[0] == (uint16_t) NO_VAL) sprintf(buf, "None"); else { snprintf(buf, size, - "%1ux%1ux%1u", jobinfo->start[0], - jobinfo->start[1], jobinfo->start[2]); + "%cx%cx%c", + alpha_num[jobinfo->start[0]], + alpha_num[jobinfo->start[1]], + alpha_num[jobinfo->start[2]]); } case SELECT_PRINT_MAX_PROCS: if (jobinfo->max_procs == NO_VAL) diff --git a/src/plugins/select/bluegene/block_allocator/block_allocator.h b/src/plugins/select/bluegene/block_allocator/block_allocator.h index ee7c01c0bcbe9eea6fc38489dce3886e88b0a8c6..b9b1c5a15f50cf00277d71ace11aceb01ff5788e 100644 --- a/src/plugins/select/bluegene/block_allocator/block_allocator.h +++ b/src/plugins/select/bluegene/block_allocator/block_allocator.h @@ -173,7 +173,7 @@ typedef struct * ba_node_t: node within the allocation system. */ typedef struct { - /* set if using this node in a block*/ + /* set if using this node in a block */ bool used; /* coordinates */ diff --git a/src/plugins/select/bluegene/plugin/bg_job_place.c b/src/plugins/select/bluegene/plugin/bg_job_place.c index 3ce2c0bcb36eaed3e0ea42b9f12d8f6e69d4da00..b13c2bd919fe0cce2de2085c83ec3c90897e3ebc 100644 --- a/src/plugins/select/bluegene/plugin/bg_job_place.c +++ b/src/plugins/select/bluegene/plugin/bg_job_place.c @@ -64,9 +64,6 @@ static int _get_user_groups(uint32_t user_id, uint32_t group_id, gid_t *groups, int max_groups, int *ngroups); static int _test_image_perms(char *image_name, List image_list, struct job_record* job_ptr); -static int _check_requests(uint16_t *start, uint32_t req_procs, int start_req); -static int _add_to_request_list(uint16_t *start, - uint32_t req_procs, int start_req); static int _check_images(struct job_record* job_ptr, char **blrtsimage, char **linuximage, char **mloaderimage, char **ramdiskimage); @@ -297,77 +294,6 @@ static int _test_image_perms(char *image_name, List image_list, return allow; } -static int _check_requests(uint16_t *start, - uint32_t req_procs, int start_req) -{ - int found = 0; - ListIterator itr = NULL; - ba_request_t *try_request = NULL; - - slurm_mutex_lock(&request_list_mutex); - itr = list_iterator_create(bg_request_list); - - while ((try_request = list_next(itr))) { - if(start_req) { - if ((try_request->start[X] != start[X]) - || (try_request->start[Y] != start[Y]) - || (try_request->start[Z] != start[Z])) { - debug4("got %c%c%c looking for %c%c%c", - alpha_num[try_request->start[X]], - alpha_num[try_request->start[Y]], - alpha_num[try_request->start[Z]], - alpha_num[start[X]], - alpha_num[start[Y]], - alpha_num[start[Z]]); - continue; - } - debug3("found %c%c%c looking for %c%c%c", - alpha_num[try_request->start[X]], - alpha_num[try_request->start[Y]], - alpha_num[try_request->start[Z]], - alpha_num[start[X]], - alpha_num[start[Y]], - alpha_num[start[Z]]); - } - - if(try_request->procs == req_procs) { - debug("already tried to create but can't right now."); - found = 1; - break; - } - } - list_iterator_destroy(itr); - slurm_mutex_unlock(&request_list_mutex); - - return found; -} - -static int _add_to_request_list(uint16_t *start, - uint32_t req_procs, int start_req) -{ - ba_request_t *try_request = NULL; - - /* - add request to list so we don't try again until - something happens like a job finishing or - something so we can try again - */ - debug2("adding request for %d", req_procs); - try_request = xmalloc(sizeof(ba_request_t)); - try_request->procs = req_procs; - try_request->save_name = NULL; - try_request->elongate_geos = NULL; - try_request->start_req = start_req; - - memcpy(try_request->start, start, - sizeof(uint16_t) * BA_SYSTEM_DIMENSIONS); - slurm_mutex_lock(&request_list_mutex); - list_push(bg_request_list, try_request); - slurm_mutex_unlock(&request_list_mutex); - - return SLURM_SUCCESS; -} - static int _check_images(struct job_record* job_ptr, char **blrtsimage, char **linuximage, char **mloaderimage, char **ramdiskimage) @@ -826,19 +752,6 @@ static int _find_best_block_match(List block_list, if(start[X] != (uint16_t)NO_VAL) start_req = 1; - if((num_unused_cpus != total_cpus) && !test_only) { - /* - see if we have already tried to create this - size but couldn't make it right now no reason - to try again - */ - if(_check_requests(start, req_procs, start_req)) { - if(test_only) - return SLURM_SUCCESS; - else - return SLURM_ERROR; - } - } select_g_get_jobinfo(job_ptr->select_jobinfo, SELECT_DATA_CONN_TYPE, &conn_type); select_g_get_jobinfo(job_ptr->select_jobinfo, @@ -946,7 +859,11 @@ static int _find_best_block_match(List block_list, request.linuximage = linuximage; request.mloaderimage = mloaderimage; request.ramdiskimage = ramdiskimage; - request.avail_node_bitmap = slurm_block_bitmap; + if(job_ptr->details->req_node_bitmap) + request.avail_node_bitmap = + job_ptr->details->req_node_bitmap; + else + request.avail_node_bitmap = slurm_block_bitmap; select_g_get_jobinfo(job_ptr->select_jobinfo, SELECT_DATA_MAX_PROCS, &max_procs); @@ -1016,15 +933,6 @@ static int _find_best_block_match(List block_list, continue; } - if(bluegene_layout_mode != LAYOUT_DYNAMIC) { - if(test_only) { - _add_to_request_list(start, - req_procs, - start_req); - } - goto no_match; - } - if(create_try) goto no_match; @@ -1077,9 +985,6 @@ static int _find_best_block_match(List block_list, destroy_bg_record(bg_record); } list_destroy(new_blocks); - _add_to_request_list(start, - req_procs, - start_req); break; } goto end_it; diff --git a/src/plugins/select/bluegene/plugin/bg_job_run.c b/src/plugins/select/bluegene/plugin/bg_job_run.c index 0393c765988c9793f9b8f649ab80ce4853a06d78..297285793f79ce245e6af0eb4545af7c38b435dc 100644 --- a/src/plugins/select/bluegene/plugin/bg_job_run.c +++ b/src/plugins/select/bluegene/plugin/bg_job_run.c @@ -594,9 +594,6 @@ static void _term_agent(bg_update_t *bg_update_ptr) bg_record->bg_block_id, bg_record->user_name); - if(bluegene_layout_mode == LAYOUT_DYNAMIC) - remove_from_request_list(); - if(job_remove_failed) { char time_str[32]; slurm_make_time_str(&now, time_str, sizeof(time_str)); diff --git a/src/plugins/select/bluegene/plugin/bg_record_functions.c b/src/plugins/select/bluegene/plugin/bg_record_functions.c index e66ef5308590cdc4f6439e2a20f615d22c526831..3234507cf07a5f974b4a3d07f374796bc3d438ff 100644 --- a/src/plugins/select/bluegene/plugin/bg_record_functions.c +++ b/src/plugins/select/bluegene/plugin/bg_record_functions.c @@ -227,6 +227,7 @@ extern void process_nodes(bg_record_t *bg_record) start); if(bg_record->nodes[j] != ',') break; + j--; } j++; } @@ -243,6 +244,8 @@ extern void process_nodes(bg_record_t *bg_record) itr = list_iterator_create(bg_record->bg_block_list); while ((ba_node = list_next(itr)) != NULL) { + if(!ba_node->used) + continue; debug4("%c%c%c is included in this block", alpha_num[ba_node->coord[X]], alpha_num[ba_node->coord[Y]], @@ -794,7 +797,7 @@ static int _addto_node_list(bg_record_t *bg_record, int *start, int *end) alpha_num[DIM_SIZE[X]], alpha_num[DIM_SIZE[Y]], alpha_num[DIM_SIZE[Z]]); } - debug3("bluegene.conf: %c%c%cx%c%c%c", + debug3("adding bps: %c%c%cx%c%c%c", alpha_num[start[X]], alpha_num[start[Y]], alpha_num[start[Z]], alpha_num[end[X]], alpha_num[end[Y]], alpha_num[end[Z]]); debug3("slurm.conf: %c%c%c", @@ -813,6 +816,7 @@ static int _addto_node_list(bg_record_t *bg_record, int *start, int *end) slurm_conf_unlock(); ba_node = ba_copy_node( &ba_system_ptr->grid[x][y][z]); + ba_node->used = 1; list_append(bg_record->bg_block_list, ba_node); node_count++; } diff --git a/src/plugins/select/bluegene/plugin/bluegene.c b/src/plugins/select/bluegene/plugin/bluegene.c index 5f0493ed19cbf9a1bb9fabc1db7158da273f79c5..da96c74c8dbc5aea2a5e625c818a6d1833e7e1aa 100644 --- a/src/plugins/select/bluegene/plugin/bluegene.c +++ b/src/plugins/select/bluegene/plugin/bluegene.c @@ -56,8 +56,6 @@ List bg_curr_block_list = NULL; /* current bg blocks in bluegene.conf*/ List bg_job_block_list = NULL; /* jobs running in these blocks */ List bg_booted_block_list = NULL; /* blocks that are booted */ List bg_freeing_list = NULL; /* blocks that being freed */ -List bg_request_list = NULL; /* list of request that can't - be made just yet */ List bg_blrtsimage_list = NULL; List bg_linuximage_list = NULL; @@ -77,7 +75,6 @@ uint16_t bridge_api_verb = 0; bool agent_fini = false; time_t last_bg_update; pthread_mutex_t block_state_mutex = PTHREAD_MUTEX_INITIALIZER; -pthread_mutex_t request_list_mutex = PTHREAD_MUTEX_INITIALIZER; int num_block_to_free = 0; int num_block_freed = 0; int blocks_are_created = 0; @@ -169,13 +166,6 @@ extern void fini_bg(void) while(destroy_cnt > 0) usleep(1000); - slurm_mutex_lock(&request_list_mutex); - if (bg_request_list) { - list_destroy(bg_request_list); - bg_request_list = NULL; - } - slurm_mutex_unlock(&request_list_mutex); - if(bg_blrtsimage_list) { list_destroy(bg_blrtsimage_list); bg_blrtsimage_list = NULL; @@ -480,31 +470,6 @@ extern int remove_from_bg_list(List my_bg_list, bg_record_t *bg_record) return rc; } -extern int remove_from_request_list() -{ - ba_request_t *try_request = NULL; - ListIterator itr; - int rc = SLURM_ERROR; - - /* - remove all requests out of the list. - */ - - slurm_mutex_lock(&request_list_mutex); - itr = list_iterator_create(bg_request_list); - while ((try_request = list_next(itr)) != NULL) { - debug3("removing size %d", - try_request->procs); - list_remove(itr); - delete_ba_request(try_request); - //list_iterator_reset(itr); - rc = SLURM_SUCCESS; - } - list_iterator_destroy(itr); - slurm_mutex_unlock(&request_list_mutex); - return rc; -} - extern int bg_free_block(bg_record_t *bg_record) { #ifdef HAVE_BG_FILES @@ -651,8 +616,6 @@ extern void *mult_destroy_block(void *args) sort_bg_record_inc_size(bg_freeing_list); slurm_mutex_unlock(&block_state_mutex); - remove_from_request_list(); - slurm_mutex_lock(&block_state_mutex); if(remove_from_bg_list(bg_job_block_list, bg_record) == SLURM_SUCCESS) { @@ -1095,12 +1058,6 @@ static void _set_bg_lists() list_destroy(bg_list); bg_list = list_create(destroy_bg_record); - slurm_mutex_lock(&request_list_mutex); - if(bg_request_list) - list_destroy(bg_request_list); - bg_request_list = list_create(delete_ba_request); - slurm_mutex_unlock(&request_list_mutex); - slurm_mutex_unlock(&block_state_mutex); if(bg_blrtsimage_list) diff --git a/src/plugins/select/bluegene/plugin/bluegene.h b/src/plugins/select/bluegene/plugin/bluegene.h index de8f76aa80ee27c2415b3e5a88e8b27c35fbcd5f..7f39fe348e20a707f72c3901397bad235524b803 100644 --- a/src/plugins/select/bluegene/plugin/bluegene.h +++ b/src/plugins/select/bluegene/plugin/bluegene.h @@ -72,8 +72,6 @@ extern List bg_list; /* List of configured BG blocks */ extern List bg_job_block_list; /* jobs running in these blocks */ extern List bg_booted_block_list; /* blocks that are booted */ extern List bg_freeing_list; /* blocks that being freed */ -extern List bg_request_list; /* list of request that can't - be made just yet */ extern List bg_blrtsimage_list; extern List bg_linuximage_list; extern List bg_mloaderimage_list; @@ -133,7 +131,6 @@ extern void *bluegene_agent(void *args); extern int bg_free_block(bg_record_t *bg_record); extern int remove_from_bg_list(List my_bg_list, bg_record_t *bg_record); -extern int remove_from_request_list(); extern void *mult_free_block(void *args); extern void *mult_destroy_block(void *args); extern int free_block_list(List delete_list); diff --git a/src/plugins/select/bluegene/plugin/dynamic_block.c b/src/plugins/select/bluegene/plugin/dynamic_block.c index 58b5e7d01b38ba1286af30b11359001513035d07..ce3ffdacd54205632cba010f51e861b8d5d552a3 100644 --- a/src/plugins/select/bluegene/plugin/dynamic_block.c +++ b/src/plugins/select/bluegene/plugin/dynamic_block.c @@ -111,6 +111,8 @@ extern List create_dynamic_block(List block_list, int x,y,z; char *nodes = NULL; bitstr_t *bitmap = bit_alloc(node_record_count); + int start[BA_SYSTEM_DIMENSIONS]; + int end[BA_SYSTEM_DIMENSIONS]; /* we want the bps that aren't in this partition to * mark them as used @@ -119,12 +121,11 @@ extern List create_dynamic_block(List block_list, bit_not(bitmap); nodes = bitmap2node_name(bitmap); + //info("not using %s", nodes); while(nodes[j] != '\0') { if ((nodes[j] == '[' || nodes[j] == ',') && (nodes[j+8] == ']' || nodes[j+8] == ',') && (nodes[j+4] == 'x' || nodes[j+4] == '-')) { - int start[BA_SYSTEM_DIMENSIONS]; - int end[BA_SYSTEM_DIMENSIONS]; j++; number = xstrntol(nodes + j, @@ -183,6 +184,7 @@ extern List create_dynamic_block(List block_list, if(nodes[j] != ',') break; + j--; } j++; } diff --git a/src/plugins/select/bluegene/plugin/select_bluegene.c b/src/plugins/select/bluegene/plugin/select_bluegene.c index 4e4dd83cf507a4889863763e0ea0388225db313d..ec74c524f441f5a5f1922edd8fe38717331ef305 100644 --- a/src/plugins/select/bluegene/plugin/select_bluegene.c +++ b/src/plugins/select/bluegene/plugin/select_bluegene.c @@ -1127,8 +1127,6 @@ extern int select_p_update_node_state (int index, uint16_t state) } } #endif - if(bluegene_layout_mode == LAYOUT_DYNAMIC) - remove_from_request_list(); return SLURM_ERROR; } diff --git a/src/salloc/opt.c b/src/salloc/opt.c index 117c810ace0e9ebbe38b371ccd80b11bc5fda68e..1b5e2f8e555ee9122e03e3b1862ee565192367d9 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -676,6 +676,9 @@ void set_options(const int argc, char **argv) #ifdef HAVE_BG info("\tThe nodelist option should only be used if\n" "\tthe block you are asking for can be created.\n" + "\tIt should also include all the midplanes you\n" + "\twant to use, partial lists may not\n" + "\twork correctly.\n" "\tPlease consult smap before using this option\n" "\tor your job may be stuck with no way to run."); #endif diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index 1636895309f2d6c4be7a6e9f31462bd69be880c4..be1014d50ab56ffe2d173351873a558f4d14cc5e 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -1056,6 +1056,9 @@ static void _set_options(int argc, char **argv) #ifdef HAVE_BG info("\tThe nodelist option should only be used if\n" "\tthe block you are asking for can be created.\n" + "\tIt should also include all the midplanes you\n" + "\twant to use, partial lists may not\n" + "\twork correctly.\n" "\tPlease consult smap before using this option\n" "\tor your job may be stuck with no way to run."); #endif diff --git a/src/smap/configure_functions.c b/src/smap/configure_functions.c index f6f5abed1c54be0111952dd7b6efab1f76bc9969..a05a325beb5f118f920a56f8c5af9273987f4c39 100644 --- a/src/smap/configure_functions.c +++ b/src/smap/configure_functions.c @@ -1107,6 +1107,7 @@ static int _add_bg_record(blockreq_t *blockreq, List allocated_blocks) bp_count++; if(nodes[j] != ',') break; + j--; } j++; } diff --git a/src/smap/partition_functions.c b/src/smap/partition_functions.c index 2dd270b00740fe0bfd3aece334267731ad25059b..9e8c6743b9a86961221d96d6070903ae83ac0614 100644 --- a/src/smap/partition_functions.c +++ b/src/smap/partition_functions.c @@ -425,6 +425,7 @@ static int _marknodes(db2_block_info_t *block_ptr, int count) 0); if(block_ptr->nodes[j] != ',') break; + j--; } j++; } @@ -914,6 +915,7 @@ static int _make_nodelist(char *nodes, List nodelist) _addto_nodelist(nodelist, start, start); if(nodes[j] != ',') break; + j--; } j++; } diff --git a/src/srun/opt.c b/src/srun/opt.c index 086f608904411a8c4ef1c7eb673345bb5cf2a44f..158bfa380bca6425d1059c514d3f90af63c4abb0 100644 --- a/src/srun/opt.c +++ b/src/srun/opt.c @@ -1666,6 +1666,8 @@ static void _opt_args(int argc, char **argv) #ifdef HAVE_BG info("\tThe nodelist option should only be used if\n" "\tthe block you are asking for can be created.\n" + "\tIt should also include all the midplanes you\n" + "\twant to use, partial lists will not work correctly.\n" "\tPlease consult smap before using this option\n" "\tor your job may be stuck with no way to run."); #endif