/* * slurm_print_ctl_conf - output the contents of slurm control configuration * message as loaded using slurm_load_ctl_conf * IN out - file to write to * IN slurm_ctl_conf_ptr - slurm control configuration pointer */ void slurm_print_ctl_conf ( FILE* out, slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr ) { char time_str[32], tmp_str[128]; void *ret_list = NULL; char *select_title = ""; uint32_t cluster_flags = slurmdb_setup_cluster_flags(); if (cluster_flags & CLUSTER_FLAG_BGL) select_title = "\nBluegene/L configuration\n"; else if (cluster_flags & CLUSTER_FLAG_BGP) select_title = "\nBluegene/P configuration\n"; else if (cluster_flags & CLUSTER_FLAG_BGQ) select_title = "\nBluegene/Q configuration\n"; if ( slurm_ctl_conf_ptr == NULL ) return ; slurm_make_time_str((time_t *)&slurm_ctl_conf_ptr->last_update, time_str, sizeof(time_str)); snprintf(tmp_str, sizeof(tmp_str), "Configuration data as of %s\n", time_str); ret_list = slurm_ctl_conf_2_key_pairs(slurm_ctl_conf_ptr); if (ret_list) { slurm_print_key_pairs(out, ret_list, tmp_str); list_destroy((List)ret_list); } slurm_print_key_pairs(out, slurm_ctl_conf_ptr->select_conf_key_pairs, select_title); }
static void _layout_conf_ctl(GtkTreeStore *treestore, slurm_ctl_conf_info_msg_t *slurm_ctl_conf_ptr) { char temp_str[128]; int update = 0; GtkTreeIter iter; ListIterator itr = NULL; config_key_pair_t *key_pair; List ret_list = NULL; char *select_title = ""; if (cluster_flags & CLUSTER_FLAG_BGL) select_title = "Bluegene/L configuration"; else if (cluster_flags & CLUSTER_FLAG_BGP) select_title = "Bluegene/P configuration"; else if (cluster_flags & CLUSTER_FLAG_BGQ) select_title = "Bluegene/Q configuration"; if (!slurm_ctl_conf_ptr) return; slurm_make_time_str((time_t *)&slurm_ctl_conf_ptr->last_update, temp_str, sizeof(temp_str)); add_display_treestore_line_with_font( update, treestore, &iter, "Configuration data as of", temp_str, "bold"); ret_list = slurm_ctl_conf_2_key_pairs(slurm_ctl_conf_ptr); if (ret_list) { itr = list_iterator_create(ret_list); while ((key_pair = list_next(itr))) { add_display_treestore_line(update, treestore, &iter, key_pair->name, key_pair->value); } list_iterator_destroy(itr); list_destroy(ret_list); } if (!slurm_ctl_conf_ptr->select_conf_key_pairs) return; add_display_treestore_line(update, treestore, &iter, "", NULL); add_display_treestore_line_with_font(update, treestore, &iter, select_title, NULL, "bold"); itr = list_iterator_create( (List)slurm_ctl_conf_ptr->select_conf_key_pairs); while ((key_pair = list_next(itr))) { add_display_treestore_line(update, treestore, &iter, key_pair->name, key_pair->value); } list_iterator_destroy(itr); }