Skip to content
Snippets Groups Projects
Commit 6a67d20e authored by Danny Auble's avatar Danny Auble
Browse files

fix for displaying job and other info for bluegene blocks

parent 60c7336a
No related branches found
No related tags found
No related merge requests found
...@@ -186,9 +186,7 @@ static void _layout_block_record(GtkTreeView *treeview, ...@@ -186,9 +186,7 @@ static void _layout_block_record(GtkTreeView *treeview,
sview_block_info_t *block_ptr, sview_block_info_t *block_ptr,
int update) int update)
{ {
char *nodes = NULL;
char tmp_cnt[7]; char tmp_cnt[7];
char tmp_nodes[30];
GtkTreeIter iter; GtkTreeIter iter;
GtkTreeStore *treestore = GtkTreeStore *treestore =
GTK_TREE_STORE(gtk_tree_view_get_model(treeview)); GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
...@@ -217,31 +215,17 @@ static void _layout_block_record(GtkTreeView *treeview, ...@@ -217,31 +215,17 @@ static void _layout_block_record(GtkTreeView *treeview,
add_display_treestore_line(update, treestore, &iter, add_display_treestore_line(update, treestore, &iter,
display_data_block[SORTID_NODES].name, display_data_block[SORTID_NODES].name,
tmp_cnt); tmp_cnt);
nodes = block_ptr->nodes;
if(block_ptr->quarter != (uint16_t) NO_VAL) {
if(block_ptr->nodecard != (uint16_t) NO_VAL)
sprintf(tmp_nodes, "%s.%d.%d", nodes,
block_ptr->quarter,
block_ptr->nodecard);
else
sprintf(tmp_nodes, "%s.%d", nodes,
block_ptr->quarter);
nodes = tmp_nodes;
}
add_display_treestore_line(update, treestore, &iter, add_display_treestore_line(update, treestore, &iter,
display_data_block[SORTID_NODELIST].name, display_data_block[SORTID_NODELIST].name,
nodes); block_ptr->nodes);
} }
static void _update_block_record(sview_block_info_t *block_ptr, static void _update_block_record(sview_block_info_t *block_ptr,
GtkTreeStore *treestore, GtkTreeIter *iter) GtkTreeStore *treestore, GtkTreeIter *iter)
{ {
char *nodes = NULL;
char tmp_cnt[7]; char tmp_cnt[7];
char tmp_nodes[30];
gtk_tree_store_set(treestore, iter, SORTID_POINTER, block_ptr, -1); gtk_tree_store_set(treestore, iter, SORTID_POINTER, block_ptr, -1);
gtk_tree_store_set(treestore, iter, SORTID_BLOCK, gtk_tree_store_set(treestore, iter, SORTID_BLOCK,
...@@ -260,18 +244,8 @@ static void _update_block_record(sview_block_info_t *block_ptr, ...@@ -260,18 +244,8 @@ static void _update_block_record(sview_block_info_t *block_ptr,
convert_num_unit((float)block_ptr->node_cnt, tmp_cnt, UNIT_NONE); convert_num_unit((float)block_ptr->node_cnt, tmp_cnt, UNIT_NONE);
gtk_tree_store_set(treestore, iter, SORTID_NODES, tmp_cnt, -1); gtk_tree_store_set(treestore, iter, SORTID_NODES, tmp_cnt, -1);
nodes = block_ptr->nodes; gtk_tree_store_set(treestore, iter, SORTID_NODELIST,
if(block_ptr && (block_ptr->quarter != (uint16_t) NO_VAL)) { block_ptr->nodes, -1);
if(block_ptr->nodecard != (uint16_t) NO_VAL)
sprintf(tmp_nodes, "%s.%d.%d", nodes,
block_ptr->quarter,
block_ptr->nodecard);
else
sprintf(tmp_nodes, "%s.%d", nodes,
block_ptr->quarter);
nodes = tmp_nodes;
}
gtk_tree_store_set(treestore, iter, SORTID_NODELIST, nodes, -1);
gtk_tree_store_set(treestore, iter, SORTID_UPDATED, 1, -1); gtk_tree_store_set(treestore, iter, SORTID_UPDATED, 1, -1);
...@@ -378,6 +352,8 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr, ...@@ -378,6 +352,8 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr,
static List block_list = NULL; static List block_list = NULL;
partition_info_t part; partition_info_t part;
sview_block_info_t *block_ptr = NULL; sview_block_info_t *block_ptr = NULL;
char *nodes = NULL;
char tmp_nodes[50];
if(!changed && block_list) { if(!changed && block_list) {
return block_list; return block_list;
...@@ -413,6 +389,22 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr, ...@@ -413,6 +389,22 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr,
= node_select_ptr->bg_info_array[i].quarter; = node_select_ptr->bg_info_array[i].quarter;
block_ptr->nodecard block_ptr->nodecard
= node_select_ptr->bg_info_array[i].nodecard; = node_select_ptr->bg_info_array[i].nodecard;
if(block_ptr->quarter != (uint16_t) NO_VAL) {
nodes = block_ptr->nodes;
if(block_ptr->nodecard != (uint16_t) NO_VAL)
snprintf(tmp_nodes, sizeof(tmp_nodes),
"%s.%d.%d", nodes,
block_ptr->quarter,
block_ptr->nodecard);
else
snprintf(tmp_nodes, sizeof(tmp_nodes),
"%s.%d", nodes,
block_ptr->quarter);
xfree(block_ptr->nodes);
block_ptr->nodes = xstrdup(tmp_nodes);
}
block_ptr->node_cnt block_ptr->node_cnt
= node_select_ptr->bg_info_array[i].node_cnt; = node_select_ptr->bg_info_array[i].node_cnt;
block_ptr->bp_inx block_ptr->bp_inx
...@@ -467,7 +459,8 @@ need_refresh: ...@@ -467,7 +459,8 @@ need_refresh:
itr = list_iterator_create(block_list); itr = list_iterator_create(block_list);
while ((block_ptr = (sview_block_info_t*) list_next(itr))) { while ((block_ptr = (sview_block_info_t*) list_next(itr))) {
i++; i++;
if(!strcmp(block_ptr->bg_block_name, name)) { if(!strcmp(block_ptr->bg_block_name, name)
|| !strcmp(block_ptr->nodes, name)) {
j = 0; j = 0;
while(block_ptr->bp_inx[j] >= 0) { while(block_ptr->bp_inx[j] >= 0) {
change_grid_color( change_grid_color(
......
...@@ -99,7 +99,7 @@ static void _open_block(GtkWidget *widget, GdkEventButton *event, ...@@ -99,7 +99,7 @@ static void _open_block(GtkWidget *widget, GdkEventButton *event,
popup_info_t *popup_win = NULL; popup_info_t *popup_win = NULL;
snprintf(title, 100, snprintf(title, 100,
"Info about block %s", grid_button->node_name); "Info about block containing %s", grid_button->node_name);
itr = list_iterator_create(popup_list); itr = list_iterator_create(popup_list);
while((popup_win = list_next(itr))) { while((popup_win = list_next(itr))) {
...@@ -112,6 +112,8 @@ static void _open_block(GtkWidget *widget, GdkEventButton *event, ...@@ -112,6 +112,8 @@ static void _open_block(GtkWidget *widget, GdkEventButton *event,
if(!popup_win) { if(!popup_win) {
popup_win = create_popup_info(INFO_PAGE, BLOCK_PAGE, title); popup_win = create_popup_info(INFO_PAGE, BLOCK_PAGE, title);
popup_win->spec_info->search_info->search_type =
SEARCH_BLOCK_NODENAME;
popup_win->spec_info->search_info->gchar_data = popup_win->spec_info->search_info->gchar_data =
g_strdup(grid_button->node_name); g_strdup(grid_button->node_name);
if (!g_thread_create((gpointer)popup_thr, popup_win, if (!g_thread_create((gpointer)popup_thr, popup_win,
......
...@@ -313,6 +313,12 @@ static void _layout_job_record(GtkTreeView *treeview, ...@@ -313,6 +313,12 @@ static void _layout_job_record(GtkTreeView *treeview,
job_state_string(job_ptr->job_state)); job_state_string(job_ptr->job_state));
#ifdef HAVE_BG #ifdef HAVE_BG
select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_QUARTER,
&quarter);
select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_NODECARD,
&nodecard);
select_g_get_jobinfo(job_ptr->select_jobinfo, select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_NODE_CNT, SELECT_DATA_NODE_CNT,
&node_cnt); &node_cnt);
...@@ -410,6 +416,12 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr, ...@@ -410,6 +416,12 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
job_state_string(job_ptr->job_state), -1); job_state_string(job_ptr->job_state), -1);
#ifdef HAVE_BG #ifdef HAVE_BG
select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_QUARTER,
&quarter);
select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_NODECARD,
&nodecard);
select_g_get_jobinfo(job_ptr->select_jobinfo, select_g_get_jobinfo(job_ptr->select_jobinfo,
SELECT_DATA_NODE_CNT, SELECT_DATA_NODE_CNT,
&node_cnt); &node_cnt);
......
...@@ -104,6 +104,7 @@ typedef enum { SEARCH_JOB_ID = 1, ...@@ -104,6 +104,7 @@ typedef enum { SEARCH_JOB_ID = 1,
SEARCH_JOB_USER, SEARCH_JOB_USER,
SEARCH_JOB_STATE, SEARCH_JOB_STATE,
SEARCH_BLOCK_NAME, SEARCH_BLOCK_NAME,
SEARCH_BLOCK_NODENAME,
SEARCH_BLOCK_SIZE, SEARCH_BLOCK_SIZE,
SEARCH_BLOCK_STATE, SEARCH_BLOCK_STATE,
SEARCH_PARTITION_NAME, SEARCH_PARTITION_NAME,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment