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

Commit bfea21c

Browse files
committed
Merge pull request #1057 from kmroz/wip-ompi-info-to-v2.x
ompi_info: enhancements to information displayed
2 parents 9304284 + 55edfa3 commit bfea21c

File tree

4 files changed

+45
-7
lines changed

4 files changed

+45
-7
lines changed

ompi/tools/ompi_info/ompi_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
128128
if (OMPI_ERR_BAD_PARAM == ret) {
129129
/* output what we got */
130130
opal_info_do_params(true, opal_cmd_line_is_taken(ompi_info_cmd_line, "internal"),
131-
&mca_types, NULL);
131+
&mca_types, &component_map, NULL);
132132
}
133133
exit(1);
134134
}
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
158158
if (want_all || opal_cmd_line_is_taken(ompi_info_cmd_line, "param") ||
159159
opal_cmd_line_is_taken(ompi_info_cmd_line, "params")) {
160160
opal_info_do_params(want_all, opal_cmd_line_is_taken(ompi_info_cmd_line, "internal"),
161-
&mca_types, ompi_info_cmd_line);
161+
&mca_types, &component_map, ompi_info_cmd_line);
162162
acted = true;
163163
}
164164
if (opal_cmd_line_is_taken(ompi_info_cmd_line, "type")) {

opal/runtime/opal_info_support.c

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ void opal_info_do_path(bool want_all, opal_cmd_line_t *cmd_line)
429429

430430
void opal_info_do_params(bool want_all_in, bool want_internal,
431431
opal_pointer_array_t *mca_types,
432+
opal_pointer_array_t *component_map,
432433
opal_cmd_line_t *opal_info_cmd_line)
433434
{
434435
mca_base_var_info_lvl_t max_level = OPAL_INFO_LVL_1;
@@ -482,6 +483,9 @@ void opal_info_do_params(bool want_all_in, bool want_internal,
482483
/* Show the params */
483484

484485
if (want_all) {
486+
opal_info_show_component_version(mca_types, component_map, opal_info_type_all,
487+
opal_info_component_all, opal_info_ver_full,
488+
opal_info_ver_all);
485489
for (i = 0; i < mca_types->size; ++i) {
486490
if (NULL == (type = (char *)opal_pointer_array_get_item(mca_types, i))) {
487491
continue;
@@ -510,6 +514,9 @@ void opal_info_do_params(bool want_all_in, bool want_internal,
510514
exit(1);
511515
}
512516

517+
opal_info_show_component_version(mca_types, component_map, type,
518+
component, opal_info_ver_full,
519+
opal_info_ver_all);
513520
opal_info_show_mca_params(type, component, max_level, want_internal);
514521
}
515522
}
@@ -639,6 +646,10 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
639646
}
640647
}
641648

649+
const mca_base_var_group_t *curr_group = NULL;
650+
char *component_msg = NULL;
651+
asprintf(&component_msg, " %s", group_component);
652+
642653
for (i = 0 ; i < count ; ++i) {
643654
ret = mca_base_var_get(variables[i], &var);
644655
if (OPAL_SUCCESS != ret || ((var->mbv_flags & MCA_BASE_VAR_FLAG_INTERNAL) &&
@@ -647,14 +658,25 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
647658
continue;
648659
}
649660

661+
if (opal_info_pretty && curr_group != group) {
662+
asprintf(&message, "MCA%s %s%s", requested ? "" : " (disabled)",
663+
group->group_framework,
664+
component_msg ? component_msg : "");
665+
opal_info_out(message, message, "---------------------------------------------------");
666+
free(message);
667+
curr_group = group;
668+
}
669+
650670
ret = mca_base_var_dump(variables[i], &strings, !opal_info_pretty ? MCA_BASE_VAR_DUMP_PARSABLE : MCA_BASE_VAR_DUMP_READABLE);
651671
if (OPAL_SUCCESS != ret) {
652672
continue;
653673
}
654674

655675
for (j = 0 ; strings[j] ; ++j) {
656676
if (0 == j && opal_info_pretty) {
657-
asprintf (&message, "MCA%s %s", requested ? "" : " (disabled)", group->group_framework);
677+
asprintf (&message, "MCA%s %s%s", requested ? "" : " (disabled)",
678+
group->group_framework,
679+
component_msg ? component_msg : "");
658680
opal_info_out(message, message, strings[j]);
659681
free(message);
660682
} else {
@@ -682,14 +704,25 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
682704
continue;
683705
}
684706

707+
if (opal_info_pretty && curr_group != group) {
708+
asprintf(&message, "MCA%s %s%s", requested ? "" : " (disabled)",
709+
group->group_framework,
710+
component_msg ? component_msg : "");
711+
opal_info_out(message, message, "---------------------------------------------------");
712+
free(message);
713+
curr_group = group;
714+
}
715+
685716
ret = mca_base_pvar_dump (variables[i], &strings, !opal_info_pretty ? MCA_BASE_VAR_DUMP_PARSABLE : MCA_BASE_VAR_DUMP_READABLE);
686717
if (OPAL_SUCCESS != ret) {
687718
continue;
688719
}
689720

690721
for (j = 0 ; strings[j] ; ++j) {
691722
if (0 == j && opal_info_pretty) {
692-
asprintf (&message, "MCA%s %s", requested ? "" : " (disabled)", group->group_framework);
723+
asprintf (&message, "MCA%s %s%s", requested ? "" : " (disabled)",
724+
group->group_framework,
725+
component_msg ? component_msg : "");
693726
opal_info_out(message, message, strings[j]);
694727
free(message);
695728
} else {
@@ -718,6 +751,7 @@ static void opal_info_show_mca_group_params(const mca_base_var_group_t *group, m
718751
}
719752
opal_info_show_mca_group_params(group, max_level, want_internal);
720753
}
754+
free(component_msg);
721755
}
722756

723757
void opal_info_show_mca_params(const char *type, const char *component,
@@ -805,7 +839,7 @@ static int centerpoint = 24;
805839
static int screen_width = 78;
806840

807841
/*
808-
* Prints the passed integer in a pretty or parsable format.
842+
* Prints the passed message in a pretty or parsable format.
809843
*/
810844
void opal_info_out(const char *pretty_message, const char *plain_message, const char *value)
811845
{
@@ -949,6 +983,9 @@ void opal_info_out(const char *pretty_message, const char *plain_message, const
949983
}
950984
}
951985

986+
/*
987+
* Prints the passed integer in a pretty or parsable format.
988+
*/
952989
void opal_info_out_int(const char *pretty_message,
953990
const char *plain_message,
954991
int value)

opal/runtime/opal_info_support.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ OPAL_DECLSPEC void opal_info_err_params(opal_pointer_array_t *component_map);
6868

6969
OPAL_DECLSPEC void opal_info_do_params(bool want_all_in, bool want_internal,
7070
opal_pointer_array_t *mca_type,
71+
opal_pointer_array_t *component_map,
7172
opal_cmd_line_t *opal_info_cmd_line);
7273

7374
OPAL_DECLSPEC void opal_info_show_path(const char *type, const char *value);

oshmem/tools/oshmem_info/oshmem_info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int main(int argc, char *argv[])
124124
if (OSHMEM_ERR_BAD_PARAM == ret) {
125125
/* output what we got */
126126
opal_info_do_params(true, opal_cmd_line_is_taken(info_cmd_line, "internal"),
127-
&mca_types, NULL);
127+
&mca_types, &component_map, NULL);
128128
}
129129
exit(1);
130130
}
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
150150
if (want_all || opal_cmd_line_is_taken(info_cmd_line, "param") ||
151151
opal_cmd_line_is_taken(info_cmd_line, "params")) {
152152
opal_info_do_params(want_all, opal_cmd_line_is_taken(info_cmd_line, "internal"),
153-
&mca_types, info_cmd_line);
153+
&mca_types, &component_map, info_cmd_line);
154154
acted = true;
155155
}
156156

0 commit comments

Comments
 (0)