diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 34a33cdaa13ef1a13e2b3321be7480ebe65b4505..a79c28bce5df5dd3381f73afc7c52987f35f03f3 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -129,11 +129,16 @@ select_jobdata_type SELECT_JOBDATA_PTR /* data-> select_jobinfo_t *jobinfo */ SELECT_JOBDATA_BLOCK_PTR /* data-> bg_record_t *bg_record */ SELECT_JOBDATA_DIM_CNT /* data-> uint16_t dim_cnt */ - SELECT_JOBDATA_BLOCK_NODE_CNT /* data-> uint32_t block_cnode_cnt */ + SELECT_JOBDATA_BLOCK_NODE_CNT /* data-> uint32_t block_cnode_cnt */ + SELECT_JOBDATA_START_LOC /* data-> uint16_t + * start_loc[SYSTEM_DIMENSIONS] */ select_nodedata_type SELECT_NODEDATA_PTR /* data-> select_nodeinfo_t *nodeinfo */ +select_print_mode + SELECT_PRINT_START_LOC /* Print just the start location */ + select_type_plugin_info is no longer and it's contents are now mostly #defines DEBUG_FLAG_FRONT_END added DebugFlags of Frontend diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in index 1827b42992c2ab7c090d69e481413cbc3d42c5e7..5b721a8ac0ceda4403bbb2923ec98ecbc6df6528 100644 --- a/slurm/slurm.h.in +++ b/slurm/slurm.h.in @@ -344,6 +344,8 @@ enum select_jobdata_type { SELECT_JOBDATA_BLOCK_PTR, /* data-> bg_record_t *bg_record */ SELECT_JOBDATA_DIM_CNT, /* data-> uint16_t dim_cnt */ SELECT_JOBDATA_BLOCK_NODE_CNT, /* data-> uint32_t block_cnode_cnt */ + SELECT_JOBDATA_START_LOC, /* data-> uint16_t + * start_loc[SYSTEM_DIMENSIONS] */ }; enum select_nodedata_type { @@ -374,6 +376,7 @@ enum select_print_mode { SELECT_PRINT_RAMDISK_IMAGE,/* Print just the RAMDISK IMAGE */ SELECT_PRINT_REBOOT, /* Print just the REBOOT */ SELECT_PRINT_RESV_ID, /* Print just Cray/BASIL reservation ID */ + SELECT_PRINT_START_LOC, /* Print just the start location */ }; enum select_node_cnt { diff --git a/src/common/env.c b/src/common/env.c index 100000b341417b264ed1d5d5eed4f2c23d1ded1f..1238a7b8cf090b24523d844844ec0e9eb530a952 100644 --- a/src/common/env.c +++ b/src/common/env.c @@ -1184,6 +1184,11 @@ env_array_for_step(char ***dest, geo_char, sizeof(geo_char), SELECT_PRINT_GEOMETRY); env_array_overwrite_fmt(dest, "SLURM_STEP_GEO", "%s", geo_char); + select_g_select_jobinfo_sprint(step->select_jobinfo, + geo_char, sizeof(geo_char), + SELECT_PRINT_START_LOC); + env_array_overwrite_fmt(dest, "SLURM_STEP_START_LOC", + "%s", geo_char); } env_array_overwrite_fmt(dest, "SLURM_STEP_NUM_NODES", diff --git a/src/plugins/select/bluegene/ba_bgq/block_allocator.c b/src/plugins/select/bluegene/ba_bgq/block_allocator.c index 9b76385821a3e59ce011cdbbf82b0bf62bf29e70..bcb9455a943766f2e89c78983cb467db609092bb 100644 --- a/src/plugins/select/bluegene/ba_bgq/block_allocator.c +++ b/src/plugins/select/bluegene/ba_bgq/block_allocator.c @@ -989,7 +989,24 @@ extern ba_mp_t *ba_pick_sub_block_cnodes( g_nc_coords[ionode_num].end, ba_mp_geo_system); } + if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) + tmp_char = ba_node_map_ranged_hostlist( + ba_mp->cnode_bitmap, + ba_mp_geo_system); + bit_not(ba_mp->cnode_bitmap); + + if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) { + tmp_char2 = ba_node_map_ranged_hostlist( + ba_mp->cnode_bitmap, + ba_mp_geo_system); + info("ba_pick_sub_block_cnodes: " + "can only use %s cnodes of " + "this midplane leaving %s " + "unusable", tmp_char, tmp_char2); + xfree(tmp_char); + xfree(tmp_char2); + } } } if (bit_clear_count(ba_mp->cnode_bitmap) < *node_count) { @@ -1003,31 +1020,29 @@ extern ba_mp_t *ba_pick_sub_block_cnodes( while (geo_table) { int scan_offset = 0; - uint16_t dont_pass[ba_mp_geo_system->dim_count]; - uint16_t start_pos[ba_mp_geo_system->dim_count]; -#if 1 - /* if deny_pass argument is NULL, default is to - * deny passthroughs in all dimensions */ - for (dim = 0; dim < ba_mp_geo_system->dim_count; dim++) - dont_pass[dim] = true; -#endif + uint16_t start_loc[ba_mp_geo_system->dim_count]; + if (ba_geo_test_all(ba_mp->cnode_bitmap, &jobinfo->units_used, geo_table, &cnt, - ba_mp_geo_system, dont_pass, - start_pos, &scan_offset) + ba_mp_geo_system, NULL, + start_loc, &scan_offset) != SLURM_SUCCESS) { geo_table = geo_table->next_ptr; continue; } -#if 0 - info("scan_offset=%d", scan_offset); - for (dim=0; dim < ba_mp_geo_system->dim_count; dim++) { - info("start_pos[%d]=%u geometry[%d}=%u", - dim, start_pos[dim], dim, - geo_table->geometry[dim]); + + if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) { + info("scan_offset=%d", scan_offset); + for (dim = 0; + dim < ba_mp_geo_system->dim_count; + dim++) { + info("start_loc[%d]=%u geometry[%d]=%u", + dim, start_loc[dim], dim, + geo_table->geometry[dim]); + } } -#endif + bit_or(ba_mp->cnode_bitmap, jobinfo->units_used); if (ba_debug_flags & DEBUG_FLAG_BG_ALGO_DEEP) { tmp_char = ba_node_map_ranged_hostlist( @@ -1046,9 +1061,11 @@ extern ba_mp_t *ba_pick_sub_block_cnodes( } jobinfo->ionode_str = ba_node_map_ranged_hostlist( jobinfo->units_used, ba_mp_geo_system); - for (dim = 0; dim < jobinfo->dim_cnt; dim++) + for (dim = 0; dim < jobinfo->dim_cnt; dim++) { jobinfo->geometry[dim] = geo_table->geometry[dim]; + jobinfo->start_loc[dim] = start_loc[dim]; + } break; } diff --git a/src/plugins/select/bluegene/bg_job_info.c b/src/plugins/select/bluegene/bg_job_info.c index 5e173ea7319e44f7d93ae1fa7ef8966e9e3248ad..24d32cd9f4dab5547d79f3dafc958b39160bfb4c 100644 --- a/src/plugins/select/bluegene/bg_job_info.c +++ b/src/plugins/select/bluegene/bg_job_info.c @@ -236,6 +236,10 @@ extern int set_select_jobinfo(select_jobinfo_t *jobinfo, xfree(jobinfo->ramdiskimage); jobinfo->ramdiskimage = xstrdup(tmp_char); break; + case SELECT_JOBDATA_START_LOC: + for (i=0; i<jobinfo->dim_cnt; i++) + jobinfo->start_loc[i] = uint16[i]; + break; default: debug("set_select_jobinfo: data_type %d invalid", data_type); @@ -349,6 +353,11 @@ extern int get_select_jobinfo(select_jobinfo_t *jobinfo, else *tmp_char = xstrdup(jobinfo->ramdiskimage); break; + case SELECT_JOBDATA_START_LOC: + for (i=0; i<jobinfo->dim_cnt; i++) { + uint16[i] = jobinfo->start_loc[i]; + } + break; default: debug2("get_jobinfo data_type %d invalid", data_type); @@ -376,6 +385,8 @@ extern select_jobinfo_t *copy_select_jobinfo(select_jobinfo_t *jobinfo) memcpy(rc->geometry, jobinfo->geometry, sizeof(rc->geometry)); memcpy(rc->conn_type, jobinfo->conn_type, sizeof(rc->conn_type)); + memcpy(rc->start_loc, jobinfo->start_loc, + sizeof(rc->start_loc)); rc->reboot = jobinfo->reboot; rc->rotate = jobinfo->rotate; rc->bg_record = jobinfo->bg_record; @@ -424,6 +435,7 @@ extern int pack_select_jobinfo(select_jobinfo_t *jobinfo, Buf buffer, for (i=0; i<dims; i++) { pack16(jobinfo->geometry[i], buffer); pack16(jobinfo->conn_type[i], buffer); + pack16(jobinfo->start_loc[i], buffer); } pack16(jobinfo->reboot, buffer); pack16(jobinfo->rotate, buffer); @@ -443,9 +455,9 @@ extern int pack_select_jobinfo(select_jobinfo_t *jobinfo, Buf buffer, } else { pack16(dims, buffer); /* pack space for 3 positions for geo - * then 1 for conn_type, reboot, and rotate + * conn_type and start_loc and then, reboot, and rotate */ - for (i=0; i<((dims*2)+2); i++) { + for (i=0; i<((dims*3)+2); i++) { pack16((uint16_t) 0, buffer); } pack32((uint32_t) 0, buffer); //block_cnode_cnt @@ -579,6 +591,7 @@ extern int unpack_select_jobinfo(select_jobinfo_t **jobinfo_pptr, Buf buffer, for (i=0; i<dims; i++) { safe_unpack16(&(jobinfo->geometry[i]), buffer); safe_unpack16(&(jobinfo->conn_type[i]), buffer); + safe_unpack16(&(jobinfo->start_loc[i]), buffer); } safe_unpack16(&(jobinfo->reboot), buffer); @@ -716,7 +729,7 @@ extern char *sprint_select_jobinfo(select_jobinfo_t *jobinfo, else xstrcat(geo, "0"); } - } else + } else if (mode != SELECT_PRINT_START_LOC) geo = give_geo(jobinfo->geometry, jobinfo->dim_cnt, print_x); switch (mode) { @@ -796,6 +809,11 @@ extern char *sprint_select_jobinfo(select_jobinfo_t *jobinfo, tmp_image = jobinfo->ramdiskimage; snprintf(buf, size, "%s", tmp_image); break; + case SELECT_PRINT_START_LOC: + xfree(geo); + geo = give_geo(jobinfo->start_loc, jobinfo->dim_cnt, 0); + snprintf(buf, size, "%s", geo); + break; default: error("sprint_jobinfo: bad mode %d", mode); if (size > 0) @@ -844,7 +862,7 @@ extern char *xstrdup_select_jobinfo(select_jobinfo_t *jobinfo, int mode) else xstrcat(geo, "0"); } - } else + } else if (mode != SELECT_PRINT_START_LOC) geo = give_geo(jobinfo->geometry, jobinfo->dim_cnt, print_x); switch (mode) { @@ -915,6 +933,11 @@ extern char *xstrdup_select_jobinfo(select_jobinfo_t *jobinfo, int mode) tmp_image = jobinfo->ramdiskimage; xstrfmtcat(buf, "%s", tmp_image); break; + case SELECT_PRINT_START_LOC: + xfree(geo); + geo = give_geo(jobinfo->start_loc, jobinfo->dim_cnt, 0); + xstrfmtcat(buf, "%s", geo); + break; default: error("xstrdup_jobinfo: bad mode %d", mode); } diff --git a/src/plugins/select/bluegene/bg_job_info.h b/src/plugins/select/bluegene/bg_job_info.h index 671c8ec71e90f907786543398928e2615d3e8e7c..f778f0e2d25c4a92f471d6af335486055436711c 100644 --- a/src/plugins/select/bluegene/bg_job_info.h +++ b/src/plugins/select/bluegene/bg_job_info.h @@ -74,6 +74,8 @@ struct select_jobinfo { char *ramdiskimage; /* RamDiskImage for this block */ uint16_t reboot; /* reboot block before starting job */ uint16_t rotate; /* permit geometry rotation if set */ + uint16_t start_loc[HIGHEST_DIMENSIONS]; /* where in block we + * are starting from */ bitstr_t *units_used; /* Used for a step the cnodes used. */ }; diff --git a/src/plugins/select/bluegene/runjob_plugin.cc b/src/plugins/select/bluegene/runjob_plugin.cc index 5ebd79d62477121de5d3db25a5a1a25533f343a9..18da02e1cc936f484014bf2b5ad5bade35b60412 100644 --- a/src/plugins/select/bluegene/runjob_plugin.cc +++ b/src/plugins/select/bluegene/runjob_plugin.cc @@ -154,7 +154,7 @@ void Plugin::execute(bgsched::runjob::Verify& verify) } else if (env_var.getKey() == "SLURM_STEP_NUM_NODES") { step_cnode_cnt = atoi(env_var.getValue().c_str()); found++; - } else if (env_var.getKey() == "SLURM_STEP_SUB_MP") { + } else if (env_var.getKey() == "SLURM_STEP_START_LOC") { if (!_set_coords(env_var.getValue(), start_coords)) goto deny_job; found++;