Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 5829498

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]> (cherry picked from commit a3229c3)
1 parent 260727b commit 5829498

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
@@ -646,6 +646,8 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
646646
}
647647
}
648648

649+
const mca_base_var_group_t *curr_group = NULL;
650+
char *component_msg = NULL;
649651
for (i = 0 ; i < count ; ++i) {
650652
ret = mca_base_var_get(variables[i], &var);
651653
if (OPAL_SUCCESS != ret || ((var->mbv_flags & MCA_BASE_VAR_FLAG_INTERNAL) &&
@@ -654,14 +656,22 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
654656
continue;
655657
}
656658

659+
if (opal_info_pretty && curr_group != group) {
660+
free(component_msg);
661+
asprintf(&component_msg, " %s", group_component);
662+
curr_group = group;
663+
}
664+
657665
ret = mca_base_var_dump(variables[i], &strings, !opal_info_pretty ? MCA_BASE_VAR_DUMP_PARSABLE : MCA_BASE_VAR_DUMP_READABLE);
658666
if (OPAL_SUCCESS != ret) {
659667
continue;
660668
}
661669

662670
for (j = 0 ; strings[j] ; ++j) {
663671
if (0 == j && opal_info_pretty) {
664-
asprintf (&message, "MCA%s %s", requested ? "" : " (disabled)", group->group_framework);
672+
asprintf (&message, "MCA%s %s%s", requested ? "" : " (disabled)",
673+
group->group_framework,
674+
component_msg ? component_msg : "");
665675
opal_info_out(message, message, strings[j]);
666676
free(message);
667677
} else {

0 commit comments

Comments
 (0)