diff --git a/src/sview/block_info.c b/src/sview/block_info.c index b8fa2892b3dab3f67c24d07bf1c9d31591d2c13d..2a86960f04ab163cf4eed24e0764b39183d4aa7d 100644 --- a/src/sview/block_info.c +++ b/src/sview/block_info.c @@ -41,7 +41,6 @@ typedef struct { enum connection_type bg_conn_type; enum node_use_type bg_node_use; rm_partition_state_t state; - List nodelist; int size; uint16_t quarter; uint16_t nodecard; @@ -111,13 +110,10 @@ static display_data_t *local_display_data = NULL; static char* _convert_conn_type(enum connection_type conn_type); static char* _convert_node_use(enum node_use_type node_use); static char *_part_state_str(rm_partition_state_t state); -static void _block_list_del(void *object); -static void _nodelist_del(void *object); static int _in_slurm_partition(int *part_inx, int *block_inx); -static int _make_nodelist(char *nodes, List nodelist); static void _append_block_record(sview_block_info_t *block_ptr, - GtkTreeStore *treestore, GtkTreeIter *iter, - int line); + GtkTreeStore *treestore, GtkTreeIter *iter, + int line); @@ -157,21 +153,12 @@ static void _block_list_del(void *object) xfree(block_ptr->bg_block_name); xfree(block_ptr->slurm_part_name); xfree(block_ptr->nodes); - if(block_ptr->nodelist) - list_destroy(block_ptr->nodelist); xfree(block_ptr); } } -static void _nodelist_del(void *object) -{ - int *coord = (int *)object; - xfree(coord); - return; -} - static int _in_slurm_partition(int *part_inx, int *bp_inx) { int found = 0; @@ -196,79 +183,6 @@ static int _in_slurm_partition(int *part_inx, int *bp_inx) return 1; } -static int _addto_nodelist(List nodelist, int *start, int *end) -{ - int *coord = NULL; - int x,y,z; - -// assert(end[X] < DIM_SIZE[X]); - assert(start[X] >= 0); - //assert(end[Y] < DIM_SIZE[Y]); - assert(start[Y] >= 0); - //assert(end[Z] < DIM_SIZE[Z]); - assert(start[Z] >= 0); - - for (x = start[X]; x <= end[X]; x++) { - for (y = start[Y]; y <= end[Y]; y++) { - for (z = start[Z]; z <= end[Z]; z++) { - coord = xmalloc(sizeof(int)*3); - coord[X] = x; - coord[Y] = y; - coord[Z] = z; - list_append(nodelist, coord); - } - } - } - return 1; -} - -static int _make_nodelist(char *nodes, List nodelist) -{ - int j = 0; - int number; - int start[BA_SYSTEM_DIMENSIONS]; - int end[BA_SYSTEM_DIMENSIONS]; - - if(!nodelist) - nodelist = list_create(_nodelist_del); - while (nodes[j] != '\0') { - if ((nodes[j] == '[' - || nodes[j] == ',') - && (nodes[j+8] == ']' - || nodes[j+8] == ',') - && (nodes[j+4] == 'x' - || nodes[j+4] == '-')) { - j++; - number = atoi(nodes + j); - start[X] = number / 100; - start[Y] = (number % 100) / 10; - start[Z] = (number % 10); - j += 4; - number = atoi(nodes + j); - end[X] = number / 100; - end[Y] = (number % 100) / 10; - end[Z] = (number % 10); - j += 3; - _addto_nodelist(nodelist, start, end); - if(nodes[j] != ',') - break; - j--; - } else if((nodes[j] < 58 - && nodes[j] > 47)) { - - number = atoi(nodes + j); - start[X] = number / 100; - start[Y] = (number % 100) / 10; - start[Z] = (number % 10); - j+=3; - _addto_nodelist(nodelist, start, start); - if(nodes[j] != ',') - break; - } - j++; - } - return 1; -} static char* _convert_conn_type(enum connection_type conn_type) { @@ -513,8 +427,6 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr, bg_info_array[i].bg_block_id); block_ptr->nodes = xstrdup(node_select_ptr->bg_info_array[i].nodes); - block_ptr->nodelist = list_create(_nodelist_del); - _make_nodelist(block_ptr->nodes, block_ptr->nodelist); block_ptr->bg_user_name = xstrdup(node_select_ptr-> diff --git a/src/sview/grid.c b/src/sview/grid.c index 8f6f91e5688f54a1943e7d4d32afa4d76df03844..85a8a7e047f32d1f84681af30ea6fff7ebc98d42 100644 --- a/src/sview/grid.c +++ b/src/sview/grid.c @@ -450,7 +450,11 @@ extern int setup_grid_table(GtkTable *table, List button_list, List node_list) return SLURM_ERROR; } -#ifndef HAVE_BG +#ifdef HAVE_BG + node_count = DIM_SIZE[X]; + table_x = DIM_SIZE[X] + DIM_SIZE[Z]; + table_y = (DIM_SIZE[Z] * DIM_SIZE[Y]) + DIM_SIZE[Y]; +#else node_count = list_count(node_list); if(node_count < 50) { table_x = 1; @@ -461,11 +465,6 @@ extern int setup_grid_table(GtkTable *table, List button_list, List node_list) } table_y = node_count/table_x; table_y++; - -#else - node_count = DIM_SIZE[X]; - table_x = DIM_SIZE[X] + DIM_SIZE[Z]; - table_y = (DIM_SIZE[Z] * DIM_SIZE[Y]) + DIM_SIZE[Y]; #endif gtk_table_resize(table, table_y, table_x); @@ -484,9 +483,6 @@ extern int setup_grid_table(GtkTable *table, List button_list, List node_list) coord_x = x + x_offset; grid_button = xmalloc(sizeof(grid_button_t)); - grid_button->coord[X] = x; - grid_button->coord[Y] = y; - grid_button->coord[Z] = z; grid_button->inx = i++; grid_button->table = table; grid_button->table_x = coord_x; diff --git a/src/sview/sview.h b/src/sview/sview.h index 5b758f95707048933781d82fe1e23da7f6c40081..86f5c0eb487c0df34f7e003cbe86c3e1fa5e7a4d 100644 --- a/src/sview/sview.h +++ b/src/sview/sview.h @@ -185,7 +185,6 @@ typedef struct { int state; int table_x; int table_y; - int coord[BA_SYSTEM_DIMENSIONS]; } grid_button_t; typedef struct {