diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c index 5aa62a482b09260e7bb7a064b1de1bfd5ae7e97b..a5cdeb82c4b070fd6dbe1d927fded5b4283475e8 100644 --- a/src/common/slurm_protocol_defs.c +++ b/src/common/slurm_protocol_defs.c @@ -1440,9 +1440,12 @@ extern char *node_state_string(uint16_t inx) bool power_up_flag = (inx & NODE_STATE_POWER_UP); if (maint_flag) { - if (no_resp_flag) + if ((base == NODE_STATE_ALLOCATED) || + (base == NODE_STATE_MIXED)) + ; + else if (no_resp_flag) return "MAINT*"; - if (base != NODE_STATE_ALLOCATED) + else return "MAINT"; } if (drain_flag) { @@ -1558,9 +1561,11 @@ extern char *node_state_string_compact(uint16_t inx) inx = (uint16_t) (inx & NODE_STATE_BASE); if (maint_flag) { - if (no_resp_flag) + if ((inx == NODE_STATE_ALLOCATED) || (inx == NODE_STATE_MIXED)) + ; + else if (no_resp_flag) return "MAINT*"; - if (inx != NODE_STATE_ALLOCATED) + else return "MAINT"; } if (drain_flag) { diff --git a/src/sinfo/print.c b/src/sinfo/print.c index e4c391779e231854253e0219209bd498e0aa6c65..a8c0da53418bbe774ed3a0217bed0dcde126e66a 100644 --- a/src/sinfo/print.c +++ b/src/sinfo/print.c @@ -988,10 +988,18 @@ int _print_size(sinfo_data_t * sinfo_data, int width, int _print_state_compact(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix) { + char *upper_state, *lower_state; + uint16_t my_state; + if (sinfo_data && sinfo_data->nodes_total) { - char *upper_state = node_state_string_compact( - sinfo_data->node_state); - char *lower_state = _str_tolower(upper_state); + my_state = sinfo_data->node_state; + if (sinfo_data->cpus_alloc && + (sinfo_data->cpus_alloc != sinfo_data->cpus_total)) { + my_state &= NODE_STATE_FLAGS; + my_state |= NODE_STATE_MIXED; + } + upper_state = node_state_string_compact(my_state); + lower_state = _str_tolower(upper_state); _print_str(lower_state, width, right_justify, true); xfree(lower_state); } else if (sinfo_data) @@ -1007,9 +1015,18 @@ int _print_state_compact(sinfo_data_t * sinfo_data, int width, int _print_state_long(sinfo_data_t * sinfo_data, int width, bool right_justify, char *suffix) { + char *upper_state, *lower_state; + uint16_t my_state; + if (sinfo_data && sinfo_data->nodes_total) { - char *upper_state = node_state_string(sinfo_data->node_state); - char *lower_state = _str_tolower(upper_state); + my_state = sinfo_data->node_state; + if (sinfo_data->cpus_alloc && + (sinfo_data->cpus_alloc != sinfo_data->cpus_total)) { + my_state &= NODE_STATE_FLAGS; + my_state |= NODE_STATE_MIXED; + } + upper_state = node_state_string(my_state); + lower_state = _str_tolower(upper_state); _print_str(lower_state, width, right_justify, true); xfree(lower_state); } else if (sinfo_data)