diff --git a/doc/man/man1/sview.1 b/doc/man/man1/sview.1 index f1b90363a582a27f24facce48ed77d278872522c..f70e642b954e44ceae2e3bf714e15e2df792a5d6 100644 --- a/doc/man/man1/sview.1 +++ b/doc/man/man1/sview.1 @@ -45,6 +45,15 @@ The sview command can only be build if \fIgtk+\-2.0\fR is installed. Systems lacking these libraries will have SLURM installed without the sview command. +On larger systems (2000+ nodes) some gtk themes can considerably slow down +the grid display. If you think this is happening you may +try defining SVIEW_GRID_SPEEDUP=1 in your environment. This will use +a code path to try to avoid functions that typically take a +relatively large amount of time. THIS OPTION DOESN'T WORK FOR EVERY +GTK THEME, but if it does work for your theme this provides an +outrageous amount of speedup. We have found it to work very well with +QT based themes. + .SH "COPYING" Copyright (C) 2006 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). diff --git a/src/sview/block_info.c b/src/sview/block_info.c index cb3e50bedadb514886958238cf69102e12c510e8..1429e9359bcdf3097ae3154710ecf4ee8a2a94c2 100644 --- a/src/sview/block_info.c +++ b/src/sview/block_info.c @@ -909,10 +909,11 @@ display_it: } list_iterator_destroy(itr); change_grid_color(grid_button_list, -1, -1, MAKE_WHITE, true, 0); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); + } + if(view == ERROR_VIEW && display_widget) { gtk_widget_destroy(display_widget); display_widget = NULL; diff --git a/src/sview/common.c b/src/sview/common.c index 8616da1fb547b1a25418603f1a9fb081bbd7b555..7fcf70955abcb7b5a897c835f948337bc3b4ccff 100644 --- a/src/sview/common.c +++ b/src/sview/common.c @@ -1236,24 +1236,25 @@ extern void sview_widget_modify_bg(GtkWidget *widget, GtkStateType state, /* DEF_TIMERS; */ /* START_TIMER; */ -#ifdef HAVE_QT_THEME - /* For some reason, QT Themes have a very slow call to for - * gtk_widget_modify_bg as of 7-6-09. - * Here we only take around 40 microsecs where - * gtk_widget_modify_bg takes around 2500. This isn't that big of a - * deal on most systems, but if you have like 10000 nodes this makes - * an outrageous difference. You must follow this up by doing a - * gtk_widget_set_sensitive 0, and then 1 on the parent container to - * make the color stick. - */ - GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget); - widget->style->bg[state] = color; - rc_style->bg[state] = color; - rc_style->color_flags[state] |= GTK_RC_BG; - gtk_widget_reset_rc_styles (widget); -#else - gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &color); -#endif + if(grid_speedup) { + /* For some reason, QT Themes have a very slow call to for + * gtk_widget_modify_bg as of 7-6-09. + * Here we only take around 40 microsecs where + * gtk_widget_modify_bg takes around 2500. This isn't + * that big of a deal on most systems, but if you have + * like 10000 nodes this makes an outrageous + * difference. You must follow this up by doing a + * gtk_widget_set_sensitive 0, and then 1 on the + * parent container to make the color stick. + */ + GtkRcStyle *rc_style = gtk_widget_get_modifier_style (widget); + widget->style->bg[state] = color; + rc_style->bg[state] = color; + rc_style->color_flags[state] |= GTK_RC_BG; + gtk_widget_reset_rc_styles (widget); + } else + gtk_widget_modify_bg(widget, GTK_STATE_NORMAL, &color); + /* END_TIMER; */ /* g_print("got %s\n", TIME_STR); */ diff --git a/src/sview/grid.c b/src/sview/grid.c index 2051b17f9738a5f2d4a102d0e7bfce76fa0bfcba..57ca84e2b7ca85d08de1e004c77ff30ea2c067a9 100644 --- a/src/sview/grid.c +++ b/src/sview/grid.c @@ -779,8 +779,6 @@ extern int get_system_stats(GtkTable *table) setup_grid_table(main_grid_table, grid_button_list, node_list); gtk_widget_show_all(GTK_WIDGET(main_grid_table)); - fast_bg = GTK_CHECK_VERSION(2,16,0); - return SLURM_SUCCESS; } @@ -1013,8 +1011,8 @@ extern void post_setup_popup_grid_list(popup_info_t *popup_win) change_grid_color(popup_win->grid_button_list, -1, -1, MAKE_BLACK, true, NODE_STATE_IDLE); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(popup_win->grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(popup_win->grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(popup_win->grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(popup_win->grid_table), 1); + } } diff --git a/src/sview/job_info.c b/src/sview/job_info.c index e779af0090f476692140269b3f7ef2ebb3e7acd5..730f0cd4a7c9bbd7ad23fa83af886244a6196c22 100644 --- a/src/sview/job_info.c +++ b/src/sview/job_info.c @@ -2776,10 +2776,11 @@ display_it: } list_iterator_destroy(itr); change_grid_color(grid_button_list, -1, -1, MAKE_WHITE, true, 0); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); + } + if(view == ERROR_VIEW && display_widget) { gtk_widget_destroy(display_widget); display_widget = NULL; diff --git a/src/sview/node_info.c b/src/sview/node_info.c index fcb2a5cf416a71013a477e220f0dfacddd2065b8..ec0effe777cf6eda3632b9f570a39ac08715a4de 100644 --- a/src/sview/node_info.c +++ b/src/sview/node_info.c @@ -927,10 +927,11 @@ display_it: } list_iterator_destroy(itr); change_grid_color(grid_button_list, -1, -1, MAKE_WHITE, true, 0); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); + } + if(view == ERROR_VIEW && display_widget) { gtk_widget_destroy(display_widget); display_widget = NULL; diff --git a/src/sview/part_info.c b/src/sview/part_info.c index 4f555041b7fe30cbc12048170a689ea71e6309be..3a14f709fe9d28e12ecc8d11a5567cef1a0d2a94 100644 --- a/src/sview/part_info.c +++ b/src/sview/part_info.c @@ -1980,10 +1980,11 @@ display_it: } list_iterator_destroy(itr); change_grid_color(grid_button_list, -1, -1, MAKE_WHITE, true, 0); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); + } + if(view == ERROR_VIEW && display_widget) { gtk_widget_destroy(display_widget); display_widget = NULL; diff --git a/src/sview/resv_info.c b/src/sview/resv_info.c index de13e741f29e779f542c3e318b78eeb1545854d8..640ff949c4f71b2ca23756550afd967e5a003431 100644 --- a/src/sview/resv_info.c +++ b/src/sview/resv_info.c @@ -1011,10 +1011,11 @@ display_it: } list_iterator_destroy(itr); change_grid_color(grid_button_list, -1, -1, MAKE_WHITE, true, 0); -#ifdef HAVE_QT_THEME - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); - gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); -#endif + if(grid_speedup) { + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 0); + gtk_widget_set_sensitive(GTK_WIDGET(main_grid_table), 1); + } + if(view == ERROR_VIEW && display_widget) { gtk_widget_destroy(display_widget); display_widget = NULL; diff --git a/src/sview/sview.c b/src/sview/sview.c index 8fdfd52326d93f694eaf8ab7ce9bb3705f1af09a..8afe467bc3fdca8a220d23315f23679ed06fb380 100644 --- a/src/sview/sview.c +++ b/src/sview/sview.c @@ -66,7 +66,7 @@ GStaticMutex sview_mutex = G_STATIC_MUTEX_INIT; GMutex *grid_mutex = NULL; GCond *grid_cond = NULL; GtkActionGroup *admin_action_group = NULL; -int fast_bg = 0; +int grid_speedup = 0; display_data_t main_display_data[] = { {G_TYPE_NONE, JOB_PAGE, "Jobs", TRUE, -1, @@ -590,6 +590,9 @@ int main(int argc, char *argv[]) GtkBin *bin = NULL; GtkViewport *view = NULL; int i=0; + + if(getenv("SVIEW_GRID_SPEEDUP")) + grid_speedup = 1; _init_pages(); g_thread_init(NULL); diff --git a/src/sview/sview.h b/src/sview/sview.h index 68e1a778ff2418b7548604bf231df4ed35e13492..e7739875b1c52fd3d429e11f11a58bdd7c615519 100644 --- a/src/sview/sview.h +++ b/src/sview/sview.h @@ -84,11 +84,6 @@ #define OPT_LONG_USAGE 0x101 #define OPT_LONG_HIDE 0x102 -/* If you are noticing a slow down with your grid it may be the gtk theme - * you are using. Defining this may speed up things dramatically. - */ -/* #define HAVE_QT_THEME 1 */ - #define POS_LOC 0 #define DEFAULT_ENTRY_LENGTH 500 @@ -268,7 +263,7 @@ extern GtkTable *main_grid_table; extern GStaticMutex sview_mutex; extern int cpus_per_node; extern int g_node_scaling; -extern int fast_bg; +extern int grid_speedup; extern void init_grid(node_info_msg_t *node_info_ptr); extern int set_grid(int start, int end, int count);