diff --git a/src/sview/block_info.c b/src/sview/block_info.c index c44031961ca574af9097d7f58e8695ec76e22448..9b92847fc3bbf5c663da2cd2183dc5db40eb9b96 100644 --- a/src/sview/block_info.c +++ b/src/sview/block_info.c @@ -567,7 +567,7 @@ extern void refresh_block(GtkAction *action, gpointer user_data) extern int get_new_info_node_select(node_select_info_msg_t **node_select_ptr, int force) { - int error_code = SLURM_SUCCESS; + int error_code = SLURM_NO_CHANGE_IN_DATA; #ifdef HAVE_BG static node_select_info_msg_t *bg_info_ptr = NULL; static node_select_info_msg_t *new_bg_ptr = NULL; @@ -595,8 +595,6 @@ extern int get_new_info_node_select(node_select_info_msg_t **node_select_ptr, bg_info_ptr = new_bg_ptr; *node_select_ptr = new_bg_ptr; -#else - error_code = SLURM_NO_CHANGE_IN_DATA; #endif return error_code; } @@ -764,10 +762,8 @@ extern void get_info_block(GtkTable *table, display_data_t *display_data) if((part_error_code = get_new_info_part(&part_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - goto get_node_select; - } - if (part_error_code != SLURM_SUCCESS) { + } else if (part_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; view = ERROR_VIEW; @@ -784,7 +780,6 @@ extern void get_info_block(GtkTable *table, display_data_t *display_data) goto end_it; } -get_node_select: if((block_error_code = get_new_info_node_select(&node_select_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { @@ -792,10 +787,7 @@ get_node_select: || (part_error_code != SLURM_NO_CHANGE_IN_DATA)) goto display_it; changed = 0; - goto display_it; - } - - if (block_error_code != SLURM_SUCCESS) { + } else if (block_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; view = ERROR_VIEW; @@ -813,7 +805,7 @@ get_node_select: } display_it: - + block_list = _create_block_list(part_info_ptr, node_select_ptr, changed); if(!block_list) @@ -895,10 +887,8 @@ extern void specific_info_block(popup_info_t *popup_win) if((part_error_code = get_new_info_part(&part_info_ptr, popup_win->force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - goto get_node_select; - } - - if (part_error_code != SLURM_SUCCESS) { + + } else if (part_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; spec_info->view = ERROR_VIEW; @@ -915,7 +905,6 @@ extern void specific_info_block(popup_info_t *popup_win) goto end_it; } -get_node_select: if((block_error_code = get_new_info_node_select(&node_select_ptr, popup_win->force_refresh)) @@ -926,10 +915,8 @@ get_node_select: goto display_it; } changed = 0; - goto display_it; - } - - if (block_error_code != SLURM_SUCCESS) { + + } else if (block_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; spec_info->view = ERROR_VIEW; diff --git a/src/sview/grid.c b/src/sview/grid.c index 8b2549a7f48de364e211c6557b97a8b65d641115..531cb17e616acdf924e909f961ff112667c8a102 100644 --- a/src/sview/grid.c +++ b/src/sview/grid.c @@ -352,12 +352,10 @@ extern char *change_grid_color(List button_list, int start, int end, itr = list_iterator_create(button_list); color_inx %= sview_colors_cnt; gdk_color_parse(sview_colors[color_inx], &color); - while((grid_button = list_next(itr))) { if ((grid_button->inx < start) || (grid_button->inx > end)) continue; - node_base_state = grid_button->state & NODE_STATE_BASE; if (node_base_state == NODE_STATE_DOWN) { _put_button_as_down(grid_button, NODE_STATE_DOWN); @@ -634,9 +632,7 @@ extern int get_system_stats(GtkTable *table) if((error_code = get_new_info_node(&node_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { changed = 0; - goto update_it; - } - if (error_code != SLURM_SUCCESS) { + } else if (error_code != SLURM_SUCCESS) { snprintf(error_char, 100, "slurm_load_node: %s\n", slurm_strerror(error_code)); label = gtk_label_new(error_char); @@ -645,7 +641,7 @@ extern int get_system_stats(GtkTable *table) return SLURM_ERROR; } -update_it: + ba_init(node_info_ptr); if(grid_button_list) return SLURM_SUCCESS; @@ -825,10 +821,10 @@ extern void sview_init_grid() if((error_code = get_new_info_node(&node_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { return; - } - if (error_code != SLURM_SUCCESS) { + } else if (error_code != SLURM_SUCCESS) { return; } + if(!grid_button_list) { g_print("you need to run get_system_stats() first\n"); exit(0); diff --git a/src/sview/job_info.c b/src/sview/job_info.c index cc748a07df0b003dfc88603f02fb87a8f8c57c09..c1b80610add34ce65c88434db8f14488c5199f0b 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -2297,7 +2297,7 @@ extern int get_new_info_job(job_info_msg_t **info_ptr, { static job_info_msg_t *job_info_ptr = NULL, *new_job_ptr = NULL; uint16_t show_flags = 0; - int error_code = SLURM_SUCCESS; + int error_code = SLURM_NO_CHANGE_IN_DATA; time_t now = time(NULL); static time_t last; @@ -2331,7 +2331,7 @@ extern int get_new_info_job_step(job_step_info_response_msg_t **info_ptr, static job_step_info_response_msg_t *old_step_ptr = NULL; static job_step_info_response_msg_t *new_step_ptr = NULL; uint16_t show_flags = 0; - int error_code = SLURM_SUCCESS; + int error_code = SLURM_NO_CHANGE_IN_DATA; time_t now = time(NULL); static time_t last; @@ -2573,10 +2573,8 @@ extern void get_info_job(GtkTable *table, display_data_t *display_data) if((job_error_code = get_new_info_job(&job_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA){ - goto get_steps; - } - - if (job_error_code != SLURM_SUCCESS) { + + } else if (job_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; if(display_widget) @@ -2590,7 +2588,7 @@ extern void get_info_job(GtkTable *table, display_data_t *display_data) display_widget = gtk_widget_ref(GTK_WIDGET(label)); goto end_it; } -get_steps: + if((step_error_code = get_new_info_job_step(&step_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA){ @@ -2598,10 +2596,7 @@ get_steps: || (job_error_code != SLURM_NO_CHANGE_IN_DATA)) goto display_it; changed = 0; - goto display_it; - } - - if (step_error_code != SLURM_SUCCESS) { + } else if (step_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; if(display_widget) @@ -2621,7 +2616,7 @@ display_it: changed, 0); if(!info_list) return; - i=0; + /* set up the grid */ itr = list_iterator_create(info_list); while ((sview_job_info_ptr = list_next(itr))) { @@ -2701,10 +2696,8 @@ extern void specific_info_job(popup_info_t *popup_win) if((job_error_code = get_new_info_job(&job_info_ptr, popup_win->force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - goto get_steps; - } - - if (job_error_code != SLURM_SUCCESS) { + + } else if (job_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; spec_info->view = ERROR_VIEW; @@ -2721,7 +2714,7 @@ extern void specific_info_job(popup_info_t *popup_win) spec_info->display_widget = gtk_widget_ref(GTK_WIDGET(label)); goto end_it; } -get_steps: + if((step_error_code = get_new_info_job_step(&step_info_ptr, popup_win->force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { @@ -2730,10 +2723,7 @@ get_steps: || (job_error_code != SLURM_NO_CHANGE_IN_DATA)) goto display_it; changed = 0; - goto display_it; - } - - if (step_error_code != SLURM_SUCCESS) { + } else if (step_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; if(spec_info->display_widget) diff --git a/src/sview/node_info.c b/src/sview/node_info.c index ebaae19cf4dc2de52a60b14059be7974d1776de7..5ed29be40a43e61b229905403b67e6e9ba9bd9fe 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -411,7 +411,7 @@ extern int get_new_info_node(node_info_msg_t **info_ptr, int force) { static node_info_msg_t *node_info_ptr = NULL, *new_node_ptr = NULL; uint16_t show_flags = 0; - int error_code = SLURM_SUCCESS; + int error_code = SLURM_NO_CHANGE_IN_DATA; time_t now = time(NULL); static time_t last; @@ -745,10 +745,7 @@ extern void get_info_node(GtkTable *table, display_data_t *display_data) if(!display_widget || view == ERROR_VIEW) goto display_it; changed = 0; - goto display_it; - } - - if (error_code != SLURM_SUCCESS) { + } else if (error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; view = ERROR_VIEW; @@ -839,10 +836,7 @@ extern void specific_info_node(popup_info_t *popup_win) if(!spec_info->display_widget || spec_info->view == ERROR_VIEW) goto display_it; changed = 0; - goto display_it; - } - - if (error_code != SLURM_SUCCESS) { + } else if(error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; spec_info->view = ERROR_VIEW; diff --git a/src/sview/part_info.c b/src/sview/part_info.c index 2110bac0848a3da300113b663a01e866693811f0..4b8f7244d708deaed12a4ef0a27b32b28cd6178f 100644 --- a/src/sview/part_info.c +++ b/src/sview/part_info.c @@ -1618,7 +1618,7 @@ extern int get_new_info_part(partition_info_msg_t **part_ptr, int force) { static partition_info_msg_t *part_info_ptr = NULL; static partition_info_msg_t *new_part_ptr = NULL; - int error_code = SLURM_SUCCESS; + int error_code = SLURM_NO_CHANGE_IN_DATA; time_t now = time(NULL); static time_t last; @@ -1857,15 +1857,14 @@ extern void get_info_part(GtkTable *table, display_data_t *display_data) if(display_widget && toggled) { gtk_widget_destroy(display_widget); display_widget = NULL; + g_print("got here\n"); goto display_it; } if((part_error_code = get_new_info_part(&part_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - goto get_node; - } - - if (part_error_code != SLURM_SUCCESS) { + // just goto the new info node + } else if (part_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; if(display_widget) @@ -1880,15 +1879,10 @@ extern void get_info_part(GtkTable *table, display_data_t *display_data) goto end_it; } -get_node: if((node_error_code = get_new_info_node(&node_info_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - if((!display_widget || view == ERROR_VIEW) - || (part_error_code != SLURM_NO_CHANGE_IN_DATA)) - goto get_node_select; - } - - if (node_error_code != SLURM_SUCCESS) { + // just goto the new info node select + } else if (node_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; if(display_widget) @@ -1903,19 +1897,16 @@ get_node: goto end_it; } -get_node_select: if((block_error_code = get_new_info_node_select(&node_select_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { if((!display_widget || view == ERROR_VIEW) || (part_error_code != SLURM_NO_CHANGE_IN_DATA) - || (node_error_code != SLURM_NO_CHANGE_IN_DATA)) + || (node_error_code != SLURM_NO_CHANGE_IN_DATA)) { goto display_it; + } changed = 0; - goto display_it; - } - - if (block_error_code != SLURM_SUCCESS) { + } else if (block_error_code != SLURM_SUCCESS) { if(view == ERROR_VIEW) goto end_it; view = ERROR_VIEW; @@ -2017,10 +2008,8 @@ extern void specific_info_part(popup_info_t *popup_win) if((part_error_code = get_new_info_part(&part_info_ptr, popup_win->force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - goto get_node; - } - if (part_error_code != SLURM_SUCCESS) { + } else if (part_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; if(spec_info->display_widget) { @@ -2036,17 +2025,12 @@ extern void specific_info_part(popup_info_t *popup_win) gtk_widget_show(label); goto end_it; } -get_node: + if((node_error_code = get_new_info_node(&node_info_ptr, popup_win->force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { - if((!spec_info->display_widget - || spec_info->view == ERROR_VIEW) - || (part_error_code != SLURM_NO_CHANGE_IN_DATA)) - goto get_node_select; - } - - if (node_error_code != SLURM_SUCCESS) { + + } else if (node_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; if(spec_info->display_widget) @@ -2061,7 +2045,6 @@ get_node: goto end_it; } -get_node_select: if((block_error_code = get_new_info_node_select(&node_select_ptr, force_refresh)) == SLURM_NO_CHANGE_IN_DATA) { @@ -2071,10 +2054,7 @@ get_node_select: || (node_error_code != SLURM_NO_CHANGE_IN_DATA)) goto display_it; changed = 0; - goto display_it; - } - - if (block_error_code != SLURM_SUCCESS) { + } else if (block_error_code != SLURM_SUCCESS) { if(spec_info->view == ERROR_VIEW) goto end_it; if(spec_info->display_widget)