From a3229c3a1f855ecf31b379705ce46937ef4c0654 Mon Sep 17 00:00:00 2001 From: Karol Mroz Date: Sun, 3 Apr 2016 09:51:07 +0200 Subject: [PATCH 1/2] 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 --- opal/runtime/opal_info_support.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/opal/runtime/opal_info_support.c b/opal/runtime/opal_info_support.c index 189fc9a314..16ab0b7a0d 100644 --- a/opal/runtime/opal_info_support.c +++ b/opal/runtime/opal_info_support.c @@ -639,6 +639,8 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m } } + const mca_base_var_group_t *curr_group = NULL; + char *component_msg = NULL; for (i = 0 ; i < count ; ++i) { ret = mca_base_var_get(variables[i], &var); if (OPAL_SUCCESS != ret || ((var->mbv_flags & MCA_BASE_VAR_FLAG_INTERNAL) && @@ -647,6 +649,12 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m continue; } + if (opal_info_pretty && curr_group != group) { + free(component_msg); + asprintf(&component_msg, " %s", group_component); + curr_group = group; + } + ret = mca_base_var_dump(variables[i], &strings, !opal_info_pretty ? MCA_BASE_VAR_DUMP_PARSABLE : MCA_BASE_VAR_DUMP_READABLE); if (OPAL_SUCCESS != ret) { continue; @@ -654,7 +662,9 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m for (j = 0 ; strings[j] ; ++j) { if (0 == j && opal_info_pretty) { - asprintf (&message, "MCA%s %s", requested ? "" : " (disabled)", group->group_framework); + asprintf (&message, "MCA%s %s%s", requested ? "" : " (disabled)", + group->group_framework, + component_msg ? component_msg : ""); opal_info_out(message, message, strings[j]); free(message); } else { From e1eb23e7eb3e1a8cd6f2739abad6a1ec420d6d1d Mon Sep 17 00:00:00 2001 From: Karol Mroz Date: Sun, 3 Apr 2016 10:34:58 +0200 Subject: [PATCH 2/2] opal_info_support: separate parameter groups in pretty output Use a dashed line to separate parameters based on component when pretty printing. Signed-off-by: Karol Mroz --- opal/runtime/opal_info_support.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/opal/runtime/opal_info_support.c b/opal/runtime/opal_info_support.c index 16ab0b7a0d..2e1cac2f30 100644 --- a/opal/runtime/opal_info_support.c +++ b/opal/runtime/opal_info_support.c @@ -652,6 +652,11 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m if (opal_info_pretty && curr_group != group) { free(component_msg); asprintf(&component_msg, " %s", group_component); + asprintf(&message, "MCA%s %s%s", requested ? "" : " (disabled)", + group->group_framework, + component_msg ? component_msg : ""); + opal_info_out(message, message, "---------------------------------------------------"); + free(message); curr_group = group; }