diff --git a/src/partition_allocator/partition_allocator.c b/src/partition_allocator/partition_allocator.c index 20b3bc75d16e739fbbf094f2d55cf34d3cba4279..99704372e7d446741273b8eb80b251ffecd2db7a 100644 --- a/src/partition_allocator/partition_allocator.c +++ b/src/partition_allocator/partition_allocator.c @@ -1079,23 +1079,6 @@ static int _create_config_even(pa_node_t *grid) for(x=0;x<DIM_SIZE[X];x++) { source = &grid[x]; - /* if(x<(DIM_SIZE[X]-1)) { */ -/* target_1 = &grid[x+1]; */ -/* } else */ -/* target_1 = NULL; */ -/* if(x<(DIM_SIZE[X]-2)) */ -/* target_2 = &grid[x+2]; */ -/* else */ -/* target_2 = target_1; */ -/* target_first = &grid[0]; */ -/* if (DIM_SIZE[X] > 1) */ -/* target_second = &grid[1]; */ -/* else */ -/* target_second = target_first; */ - /* _set_external_wires(X, x, source, */ -/* target_1, target_2, */ -/* target_first, target_second); */ - target_1 = &grid[x+1]; _set_external_wires(X, x, source, @@ -1496,20 +1479,20 @@ static void _set_external_wires(int dim, int count, pa_node_t* source, _switch_config(source, source, dim, 0, 0); _switch_config(source, source, dim, 1, 1); if(dim!=X) { - _switch_config(source, target_1, dim, 2, 5); - _switch_config(source, source, dim, 3, 3); - _switch_config(source, source, dim, 4, 4); + _switch_config(source, target_1, dim, 2, 5); + _switch_config(source, source, dim, 3, 3); + _switch_config(source, source, dim, 4, 4); return; } if(count==0) { /* First Even Node */ - /* 4->3 of next */ - _switch_config(source, target_1, dim, 4, 3); - /* 5->2 of next */ - _switch_config(source, target_1, dim, 5, 2); - /* 2->5 of next even */ - _switch_config(source, target_2, dim, 2, 5); + /* 3->4 of next */ + _switch_config(source, target_1, dim, 3, 4); + /* 2->5 of next */ + _switch_config(source, target_1, dim, 2, 5); + /* 5->2 of next even */ + _switch_config(source, target_2, dim, 5, 2); } else if(!(count%2)) { if(count<DIM_SIZE[dim]-2) { @@ -1518,26 +1501,24 @@ static void _set_external_wires(int dim, int count, pa_node_t* source, _switch_config(source, target_1, dim, 3, 4); /* 4->3 of next */ _switch_config(source, target_1, dim, 4, 3); - /* 2->5 of next even */ - _switch_config(source, target_2, dim, 2, 5); /* 5->2 of next even */ _switch_config(source, target_2, dim, 5, 2); } else { /* Last Even Node */ - /* 3->4 of next */ - _switch_config(source, target_1, dim, 3, 4); + /* 4->3 of next */ + _switch_config(source, target_1, dim, 4, 3); /* 2->5 of previous */ /********** fix me: on the full system this is needed ******/ - //_switch_config(source, target_1, dim, 2, 5); + //_switch_config(source, target_1, dim, 5, 2); /********** fix me: not this ******/ - _switch_config(source, target_1, dim, 4, 3); + _switch_config(source, target_1, dim, 3, 4); } } else { if(count<DIM_SIZE[dim]-2) { /* Not Last Odd Node */ - /* 5->2 of next odd */ - _switch_config(source, target_2, dim, 5, 2); + /* 2->5 of next odd */ + _switch_config(source, target_2, dim, 2, 5); } else { /* Last Odd Node */ /* nothing */ diff --git a/src/plugins/select/bluegene/bgl_job_run.c b/src/plugins/select/bluegene/bgl_job_run.c index 30465db35d500256dae4b61224a02ce33a94e870..95015fec8a535a1adf662f88d3951eeec12a997f 100644 --- a/src/plugins/select/bluegene/bgl_job_run.c +++ b/src/plugins/select/bluegene/bgl_job_run.c @@ -285,10 +285,10 @@ static void _start_agent(bgl_update_t *bgl_update_ptr) } slurm_mutex_lock(&part_state_mutex); - if(bgl_record->target_name) { + if(bgl_record->target_name) xfree(bgl_record->target_name); - bgl_record->target_name = xstrdup(user_name); - } + bgl_record->target_name = xstrdup(user_name); + if(bgl_record->state == RM_PARTITION_READY) set_part_user(bgl_record); slurm_mutex_unlock(&part_state_mutex); @@ -377,15 +377,18 @@ static void _term_agent(bgl_update_t *bgl_update_ptr) slurm_mutex_lock(&part_state_mutex); /*remove user from list */ if(bgl_record->target_name) { - if(strcmp(bgl_record->target_name, USER_NAME)) { + if(strcmp(bgl_record->target_name, + slurmctld_conf.slurm_user_name)) { xfree(bgl_record->target_name); - bgl_record->target_name = xstrdup(USER_NAME); + bgl_record->target_name = + xstrdup(slurmctld_conf. + slurm_user_name); } - if(update_partition_user(bgl_record) == 1) - last_bgl_update = time(NULL); + update_partition_user(bgl_record); } else { - bgl_record->target_name = xstrdup(USER_NAME); + bgl_record->target_name = + xstrdup(slurmctld_conf.slurm_user_name); } if(bgl_record->state != RM_PARTITION_CONFIGURING) { bgl_record->boot_state = 0; @@ -518,10 +521,10 @@ static int _excise_block(List block_list, pm_partition_id_t bgl_part_id, int rc = SLURM_SUCCESS; ListIterator iter; bgl_record_t *block = NULL; - xassert(iter); - + if(block_list) { iter = list_iterator_create(block_list); + xassert(iter); while ((block = list_next(iter))) { rc = SLURM_ERROR; if (strcmp(block->bgl_part_id, bgl_part_id)) @@ -769,11 +772,11 @@ extern int boot_part(bgl_record_t *bgl_record, rm_partition_mode_t node_use) #ifdef HAVE_BGL_FILES int rc; - if ((rc = rm_set_part_owner(bgl_record->bgl_part_id, USER_NAME)) + if ((rc = rm_set_part_owner(bgl_record->bgl_part_id, slurmctld_conf.slurm_user_name)) != STATUS_OK) { error("rm_set_part_owner(%s,%s): %s", bgl_record->bgl_part_id, - USER_NAME, + slurmctld_conf.slurm_user_name, bgl_err_str(rc)); return SLURM_ERROR; } diff --git a/src/plugins/select/bluegene/bgl_part_info.c b/src/plugins/select/bluegene/bgl_part_info.c index 50b9833c3a46817c205eb38fe7af18c55dc91be9..45a002c20e45d473678487ca7c9a267fce6cdd5e 100644 --- a/src/plugins/select/bluegene/bgl_part_info.c +++ b/src/plugins/select/bluegene/bgl_part_info.c @@ -216,7 +216,8 @@ extern int update_partition_list() "users from partition %s", bgl_record->bgl_part_id); } - if(!strcmp(bgl_record->target_name, USER_NAME) + if(!strcmp(bgl_record->target_name, + slurmctld_conf.slurm_user_name) && strcmp(bgl_record->target_name, bgl_record->user_name)) { info("partition %s was in a " diff --git a/src/plugins/select/bluegene/bluegene.c b/src/plugins/select/bluegene/bluegene.c index c18a02e2e618d3642cc9481a77ace3ff179f3916..3409b07145001aabb45432eecded48783e570c2e 100644 --- a/src/plugins/select/bluegene/bluegene.c +++ b/src/plugins/select/bluegene/bluegene.c @@ -325,7 +325,8 @@ extern int update_partition_user(bgl_record_t *bgl_record) bgl_record->bgl_part_id); return -1; } else if (rc == REMOVE_USER_NONE) { - if (strcmp(bgl_record->target_name, USER_NAME)) { + if (strcmp(bgl_record->target_name, + slurmctld_conf.slurm_user_name)) { info("Adding user %s to Partition %s", bgl_record->target_name, bgl_record->bgl_part_id); @@ -412,7 +413,7 @@ extern int remove_all_users(char *bgl_part_id, char *user_name) } } - if(!strcmp(user, USER_NAME)) + if(!strcmp(user, slurmctld_conf.slurm_user_name)) continue; if(user_name) { @@ -454,7 +455,7 @@ extern void set_part_user(bgl_record_t *bgl_record) if(bgl_record->target_name) { xfree(bgl_record->target_name); bgl_record->target_name = - xstrdup(USER_NAME); + xstrdup(slurmctld_conf.slurm_user_name); } } @@ -725,10 +726,12 @@ extern int create_static_partitions(List part_list) list_append(bgl_list, bgl_record); bgl_record->conn_type = SELECT_TORUS; - bgl_record->user_name = xstrdup(USER_NAME); - bgl_record->target_name = xstrdup(USER_NAME); + bgl_record->user_name = xstrdup(slurmctld_conf.slurm_user_name); + bgl_record->target_name = xstrdup(slurmctld_conf.slurm_user_name); if((pw_ent = getpwnam(bgl_record->user_name)) == NULL) { error("getpwnam(%s): %m", bgl_record->user_name); + slurm_mutex_unlock(&part_state_mutex); + return SLURM_ERROR; } else { bgl_record->user_uid = pw_ent->pw_uid; } @@ -788,7 +791,6 @@ no_total: } else { error("create_static_partitions: no bgl_list 5"); } - debug("Setting time up"); last_bgl_update = time(NULL); slurm_mutex_unlock(&part_state_mutex); #ifdef _PRINT_PARTS_AND_EXIT @@ -937,7 +939,7 @@ static int _validate_config_nodes(void) if(bgl_curr_part_list) { itr_curr = list_iterator_create( - bgl_curr_part_list); + bgl_curr_part_list); while ((init_record = (bgl_record_t*) list_next(itr_curr)) != NULL) { @@ -968,8 +970,8 @@ static int _validate_config_nodes(void) "no bgl_curr_part_list"); } if (!record->bgl_part_id) { - info("Existing partition not in bluegene.conf " - "BGL PartitionID:NONE Nodes:%s", + info("Partition found in bluegene.conf to be " + "created: Nodes:%s", record->nodes); rc = SLURM_ERROR; } else { @@ -986,7 +988,7 @@ static int _validate_config_nodes(void) if(bgl_curr_part_list) { itr_curr = list_iterator_create( - bgl_curr_part_list); + bgl_curr_part_list); while ((init_record = (bgl_record_t*) list_next(itr_curr)) != NULL) { @@ -1376,7 +1378,7 @@ static int _parse_bgl_spec(char *in_line) bgl_record = (bgl_record_t*) xmalloc(sizeof(bgl_record_t)); list_push(bgl_list, bgl_record); - bgl_record->user_name = xstrdup(USER_NAME); + bgl_record->user_name = xstrdup(slurmctld_conf.slurm_user_name); if((pw_ent = getpwnam(bgl_record->user_name)) == NULL) { error("getpwnam(%s): %m", bgl_record->user_name); } else { diff --git a/src/plugins/select/bluegene/bluegene.h b/src/plugins/select/bluegene/bluegene.h index ab8f9e68184e2d2cba8a328156c44d76a5759616..adaccf8110517af1f4002f49588aacf726b12ad8 100644 --- a/src/plugins/select/bluegene/bluegene.h +++ b/src/plugins/select/bluegene/bluegene.h @@ -44,8 +44,6 @@ #include "src/partition_allocator/partition_allocator.h" #include "src/plugins/select/bluegene/wrap_rm_api.h" -#define USER_NAME "slurm" - /* Global variables */ extern rm_BGL_t *bgl; extern char *bluegene_blrts; diff --git a/src/plugins/select/bluegene/partition_sys.c b/src/plugins/select/bluegene/partition_sys.c index ad0fac47b2428a9f4a4f8972d0a5fba8d6b2400c..62a3ae380e24aa1d55348f53cfaee4734d48ae2c 100755 --- a/src/plugins/select/bluegene/partition_sys.c +++ b/src/plugins/select/bluegene/partition_sys.c @@ -121,7 +121,7 @@ static void _pre_allocate(bgl_record_t *bgl_record) error("rm_set_data(RM_PartitionPsetsPerBP)", bgl_err_str(rc)); if ((rc = rm_set_data(bgl_record->bgl_part, RM_PartitionUserName, - USER_NAME)) != STATUS_OK) + slurmctld_conf.slurm_user_name)) != STATUS_OK) error("rm_set_data(RM_PartitionUserName)", bgl_err_str(rc)); /* info("setting it here"); */ /* bgl_record->bgl_part_id = "RMP101"; */ @@ -156,31 +156,16 @@ static int _post_allocate(bgl_record_t *bgl_record) } else { bgl_record->bgl_part_id = xstrdup(part_id); -/* if ((rc = rm_set_part_owner(bgl_record->bgl_part_id, */ -/* USER_NAME)) != STATUS_OK) { */ -/* error("rm_set_part_owner(%s,%s): %s", */ -/* bgl_record->bgl_part_id, USER_NAME, */ -/* bgl_err_str(rc)); */ -/* rc = SLURM_ERROR; */ -/* goto cleanup; */ -/* } */ - /* info("Booting partition %s", bgl_record->bgl_part_id); */ -/* if ((rc = pm_create_partition(bgl_record->bgl_part_id)) */ -/* != STATUS_OK) { */ -/* error("pm_create_partition(%s): %s", */ -/* bgl_record->bgl_part_id, bgl_err_str(rc)); */ -/* rc = SLURM_ERROR; */ -/* goto cleanup; */ -/* } */ - - /* reset state and owner right now, don't wait for - * update_partition_list() to run or epilog could - * get old/bad data. */ -/* bgl_record->state = RM_PARTITION_CONFIGURING; */ -/* debug("Setting bootflag for %s", bgl_record->bgl_part_id); */ -/* bgl_record->boot_state = 1; */ -/* bgl_record->boot_count = 0; */ - bgl_record->user_name = xstrdup(USER_NAME); + if(bgl_record->target_name) + xfree(bgl_record->target_name); + bgl_record->target_name = + xstrdup(slurmctld_conf.slurm_user_name); + + if(bgl_record->user_name) + xfree(bgl_record->user_name); + bgl_record->user_name = + xstrdup(slurmctld_conf.slurm_user_name); + if((pw_ent = getpwnam(bgl_record->user_name)) == NULL) { error("getpwnam(%s): %m", bgl_record->user_name); } else { @@ -379,15 +364,20 @@ int read_bgl_partitions() bgl_err_str(rc)); } else { if(bp_cnt==0) { - bgl_record->user_name = xstrdup(USER_NAME); - bgl_record->target_name = xstrdup(USER_NAME); + bgl_record->user_name = + xstrdup(slurmctld_conf. + slurm_user_name); + bgl_record->target_name = + xstrdup(slurmctld_conf. + slurm_user_name); } else { rm_get_data(part_ptr, RM_PartitionFirstUser, &user_name); bgl_record->user_name = xstrdup(user_name); if(!bgl_record->boot_state) bgl_record->target_name = - xstrdup(USER_NAME); + xstrdup(slurmctld_conf. + slurm_user_name); else bgl_record->target_name = xstrdup(user_name);