Skip to content

Commit a3229c3

Browse files
committed
opal_info_support: add component to param pretty output
When listing available parameters, add the component name to the MCA framework field. Parsable option is already doing this, makes sense for the pretty print option to do it as well. Signed-off-by: Karol Mroz <[email protected]>
1 parent 9efd7f1 commit a3229c3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

opal/runtime/opal_info_support.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
639639
}
640640
}
641641

642+
const mca_base_var_group_t *curr_group = NULL;
643+
char *component_msg = NULL;
642644
for (i = 0 ; i < count ; ++i) {
643645
ret = mca_base_var_get(variables[i], &var);
644646
if (OPAL_SUCCESS != ret || ((var->mbv_flags & MCA_BASE_VAR_FLAG_INTERNAL) &&
@@ -647,14 +649,22 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
647649
continue;
648650
}
649651

652+
if (opal_info_pretty && curr_group != group) {
653+
free(component_msg);
654+
asprintf(&component_msg, " %s", group_component);
655+
curr_group = group;
656+
}
657+
650658
ret = mca_base_var_dump(variables[i], &strings, !opal_info_pretty ? MCA_BASE_VAR_DUMP_PARSABLE : MCA_BASE_VAR_DUMP_READABLE);
651659
if (OPAL_SUCCESS != ret) {
652660
continue;
653661
}
654662

655663
for (j = 0 ; strings[j] ; ++j) {
656664
if (0 == j && opal_info_pretty) {
657-
asprintf (&message, "MCA%s %s", requested ? "" : " (disabled)", group->group_framework);
665+
asprintf (&message, "MCA%s %s%s", requested ? "" : " (disabled)",
666+
group->group_framework,
667+
component_msg ? component_msg : "");
658668
opal_info_out(message, message, strings[j]);
659669
free(message);
660670
} else {

0 commit comments

Comments
 (0)