diff --git a/src/plugins/select/bluegene/bgl_job_place.c b/src/plugins/select/bluegene/bgl_job_place.c index b84557a1a6267d4ca0a5974e7d578355555f5e78..0ba32545fe28c4a02029324fa0644222089e82a0 100644 --- a/src/plugins/select/bluegene/bgl_job_place.c +++ b/src/plugins/select/bluegene/bgl_job_place.c @@ -5,7 +5,8 @@ * Copyright (C) 2004 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Written by Dan Phung <phung4@llnl.gov> and Morris Jette <jette1@llnl.gov> - * + * and Danny Auble <da@llnl.gov> + * * This file is part of SLURM, a resource management program. * For details, see <http://www.llnl.gov/linux/slurm/>. * diff --git a/src/plugins/select/bluegene/bluegene.c b/src/plugins/select/bluegene/bluegene.c index 1f95b31342a6f9329bfacde9758b2dd2b2564640..eb06f4644f95093249818de782b5ba04cfc860d4 100644 --- a/src/plugins/select/bluegene/bluegene.c +++ b/src/plugins/select/bluegene/bluegene.c @@ -37,6 +37,7 @@ char* bgl_conf = BLUEGENE_CONFIG_FILE; /* Global variables */ rm_BGL_t *bgl; List bgl_list = NULL; /* list of bgl_record entries */ +List bgl_curr_part_list = NULL; /* current bgl partitions */ char *bluegene_blrts = NULL, *bluegene_linux = NULL, *bluegene_mloader = NULL; char *bluegene_ramdisk = NULL; bool agent_fini = false; @@ -70,7 +71,7 @@ int create_static_partitions(List part_list) #ifdef HAVE_BGL_FILES /* FIXME: we really do want to validate configuration here in any case, * I just took this out on a temporary basis */ - ListIterator itr; + ListIterator itr, itr_curr; int number, j=0; int x, y, z; int start[PA_SYSTEM_DIMENSIONS]; @@ -108,7 +109,7 @@ int create_static_partitions(List part_list) /* printf("done copying\n"); */ /* _process_config(); */ -/* if ((rc = _validate_config_nodes())) { */ + if ((rc = _validate_config_nodes())) { /******************************************************************/ @@ -136,10 +137,11 @@ int create_static_partitions(List part_list) part_id[18]="RMP119"; part_id[19]="RMP120"; bp_num=1; - //rm_get_data(bgl, RM_BPNum, &bp_num); - //rm_get_data(bgl, RM_FirstBP, &bp); + for (i=0; i<bp_num; i++){ - // rm_get_data(bp, RM_BPPartID, &part_id); +// itr_curr = list_iterator_create(bgl_curr_part_list); +// while ((init_record = (bgl_record_t*) list_next(itr_curr))) { +// part_id=init_record->bgl_part_id; if ((rc = rm_get_partition(part_id[i], &my_part)) != STATUS_OK) { } else { @@ -236,7 +238,7 @@ int create_static_partitions(List part_list) list_iterator_destroy(itr); rc = SLURM_SUCCESS; -/* } */ + } #else if (bgl_list) { bgl_record_t *record; @@ -283,10 +285,10 @@ static int _validate_config_nodes(void) #ifdef HAVE_BGL_FILES bgl_record_t* record; /* records from configuration files */ bgl_record_t* init_record; /* records from actual BGL config */ - ListIterator itr_conf, itr_init; + ListIterator itr_conf, itr_curr; char nodes[1024]; - /* read current bgl partition info into bgl_init_part_list */ + /* read current bgl partition info into bgl_curr_part_list */ if ((rc = read_bgl_partitions())) return rc; @@ -294,8 +296,8 @@ static int _validate_config_nodes(void) while ((record = (bgl_record_t*) list_next(itr_conf))) { /* translate hostlist to ranged string for consistent format */ /* search here */ - itr_init = list_iterator_create(bgl_init_part_list); - while ((init_record = (bgl_record_t*) list_next(itr_init))) { + itr_curr = list_iterator_create(bgl_curr_part_list); + while ((init_record = (bgl_record_t*) list_next(itr_curr))) { //info("%s:%s",nodes, init_record->nodes); //info("%d:%d", record->conn_type, init_record->conn_type); //info("%d:%d", record->node_use, init_record->node_use); @@ -310,14 +312,14 @@ static int _validate_config_nodes(void) } if (!record->bgl_part_id) { info("BGL PartitionID:NONE Nodes:%s", nodes); - rc = EINVAL; + return rc; } else { info("BGL PartitionID:%s Nodes:%s Conn:%s Mode:%s", record->bgl_part_id, nodes, convert_conn_type(record->conn_type), convert_node_use(record->node_use)); } - list_iterator_destroy(itr_init); + list_iterator_destroy(itr_curr); } list_iterator_destroy(itr_conf); #endif @@ -803,9 +805,9 @@ extern void fini_bgl(void) bgl_list = NULL; } - if (bgl_init_part_list) { - list_destroy(bgl_init_part_list); - bgl_init_part_list = NULL; + if (bgl_curr_part_list) { + list_destroy(bgl_curr_part_list); + bgl_curr_part_list = NULL; } xfree(bluegene_blrts); diff --git a/src/plugins/select/bluegene/bluegene.h b/src/plugins/select/bluegene/bluegene.h index 62515bc6bee39675101ade84b6825386a6a104bd..e4ffc5a3e0cb19f9066ed9a4a96ee0291945b5d6 100644 --- a/src/plugins/select/bluegene/bluegene.h +++ b/src/plugins/select/bluegene/bluegene.h @@ -3,7 +3,7 @@ ***************************************************************************** * Copyright (C) 2004 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Dan Phung <phung4@llnl.gov> + * Written by Dan Phung <phung4@llnl.gov> and Danny Auble <da@llnl.gov> * * This file is part of SLURM, a resource management program. * For details, see <http://www.llnl.gov/linux/slurm/>. @@ -83,8 +83,8 @@ typedef int lifecycle_type_t; enum part_lifecycle {DYNAMIC, STATIC}; typedef struct bgl_record { - char* nodes; /* String of nodes in partition */ - char * owner_name; /* Owner of partition */ + char *nodes; /* String of nodes in partition */ + char *owner_name; /* Owner of partition */ pm_partition_id_t bgl_part_id; /* ID returned from CMCS */ lifecycle_type_t part_lifecycle;/* either STATIC or DYNAMIC */ rm_partition_state_t state; /* the allocated partition */ diff --git a/src/plugins/select/bluegene/partition_sys.c b/src/plugins/select/bluegene/partition_sys.c index 4b9abf93c76634efa91a7e96f2f6709a09eb54e3..fff084d4de7a22c452f35c775f4440b36757f846 100755 --- a/src/plugins/select/bluegene/partition_sys.c +++ b/src/plugins/select/bluegene/partition_sys.c @@ -3,7 +3,7 @@ ***************************************************************************** * Copyright (C) 2004 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). - * Written by Dan Phung <phung4@llnl.gov> + * Written by Dan Phung <phung4@llnl.gov> and Danny Auble <da@llnl.gov> * * This file is part of SLURM, a resource management program. * For details, see <http://www.llnl.gov/linux/slurm/>. @@ -41,9 +41,6 @@ List bgl_sys_free = NULL; /* global system = list of allocated partitions */ List bgl_sys_allocated = NULL; -/* Global variables */ -List bgl_init_part_list = NULL; /* Initial bgl partition state */ - /* static void _init_sys(partition_t*); */ /** @@ -893,42 +890,36 @@ int read_bgl_partitions() char node_name_tmp[16], *owner_name; bgl_record_t *bgl_part_ptr; - if (!bgl_init_part_list) - bgl_init_part_list = list_create(_part_list_del); + if (!bgl_curr_part_list) + bgl_curr_part_list = list_create(_part_list_del); if ((rm_rc = rm_get_data(bgl, RM_BPNum, &bp_cnt)) != STATUS_OK) { error("rm_get_data(RM_BPNum): %s", bgl_err_str(rm_rc)); rc = SLURM_ERROR; bp_cnt = 0; } - for (i=0; i<bp_cnt; i++) { - if (i) { - if ((rm_rc = rm_get_data(bgl, RM_NextBP, &bp_ptr)) - != STATUS_OK) { - error("rm_get_data(RM_NextBP): %s", - bgl_err_str(rm_rc)); - rc = SLURM_ERROR; - break; - } - } else { - if ((rm_rc = rm_get_data(bgl, RM_FirstBP, &bp_ptr)) - != STATUS_OK) { - error("rm_get_data(RM_FirstBP): %s", - bgl_err_str(rm_rc)); - rc = SLURM_ERROR; - break; - } - } - if ((rm_rc = rm_get_data(bp_ptr, RM_BPLoc, &bp_loc)) + + if ((rm_rc = rm_get_data(bgl, RM_FirstBP, &bp_ptr)) + != STATUS_OK) { + error("rm_get_data(RM_FirstBP): %s", + bgl_err_str(rm_rc)); + rc = SLURM_ERROR; + break; + } + + for (i=0; i<bp_cnt; i++) { + + +/* if ((rm_rc = rm_get_data(bp_ptr, RM_BPLoc, &bp_loc)) != STATUS_OK) { error("rm_get_data(RM_BPLoc): %s", bgl_err_str(rm_rc)); rc = SLURM_ERROR; break; - } + } sprintf(node_name_tmp, "bgl%d%d%d", bp_loc.X, bp_loc.Y, bp_loc.Z); - if ((rm_rc = rm_get_data(bp_ptr, RM_BPPartID, &part_id)) +*/ if ((rm_rc = rm_get_data(bp_ptr, RM_BPPartID, &part_id)) != STATUS_OK) { error("rm_get_data(RM_BPPartID: %s", bgl_err_str(rm_rc)); @@ -937,19 +928,22 @@ int read_bgl_partitions() } if (!part_id || (part_id[0] == '\0')) { -#if 1 - /* this is a problem on the 128 c-node system */ - part_id = "LLNL_128_16"; + error("no part_id exiting"); + rc = SLURM_ERROR; + break; +//#if 1 +// /* this is a problem on the 128 c-node system */ +// part_id = "LLNL_128_16"; -#else - info("Node %s in blue gene partition NONE", - node_name_tmp); - continue; -#endif +//#else +// info("Node %s in blue gene partition NONE", +// node_name_tmp); +// continue; +//#endif } - info("Node:%s in BglBlock:%s", node_name_tmp, part_id); + //info("Node:%s in BglBlock:%s", node_name_tmp, part_id); - bgl_part_ptr = list_find_first(bgl_init_part_list, + bgl_part_ptr = list_find_first(bgl_curr_part_list, _part_list_find, part_id); if (!bgl_part_ptr) { /* New BGL partition record */ @@ -961,9 +955,14 @@ int read_bgl_partitions() continue; } bgl_part_ptr = xmalloc(sizeof(bgl_record_t)); - list_push(bgl_init_part_list, bgl_part_ptr); - bgl_part_ptr->bgl_part_id = xstrdup(part_id); - if ((rm_rc = rm_get_data(part_ptr, + list_push(bgl_curr_part_list, bgl_part_ptr); + + bgl_part_ptr->bgl_part_id = xstrdup(part_id); + + // need to get the 000x000 range for nodes + // also need to get coords + + if ((rm_rc = rm_get_data(part_ptr, RM_PartitionConnection, &bgl_part_ptr->conn_type)) != STATUS_OK) { @@ -978,11 +977,12 @@ int read_bgl_partitions() } if ((rm_rc = rm_get_data(part_ptr, RM_PartitionUserName, - &owner_name)) != STATUS_OK) { + &bgl_part_ptr->owner_name)) + != STATUS_OK) { error("rm_get_data(RM_PartitionUserName): %s", bgl_err_str(rm_rc)); - } else - bgl_part_ptr->owner_name = xstrdup(owner_name); + } + info("BglBlock:%s Conn:%s Use:%s Owner:%s", part_id, convert_conn_type(bgl_part_ptr->conn_type), convert_node_use(bgl_part_ptr->node_use), @@ -993,13 +993,23 @@ int read_bgl_partitions() error("rm_free_partition(): %s", bgl_err_str(rm_rc)); } - } + - bgl_part_ptr->bp_count++; + //find the correct api for this and switch count + //bgl_part_ptr->bp_count++; + } + if ((rm_rc = rm_get_data(bgl, RM_NextBP, &bp_ptr)) + != STATUS_OK) { + error("rm_get_data(RM_NextBP): %s", + bgl_err_str(rm_rc)); + rc = SLURM_ERROR; + break; + } + } } /* perform post-processing for each bluegene partition */ - list_for_each(bgl_init_part_list, _post_bgl_init_read, NULL); + list_for_each(bgl_curr_part_list, _post_bgl_init_read, NULL); return rc; }