This source file includes following definitions.
- ompi_info_register_types
- ompi_info_register_framework_params
- ompi_info_close_components
- ompi_info_show_ompi_version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include "ompi_config.h"
26
27 #include "ompi/include/ompi/constants.h"
28 #include "ompi/include/ompi/frameworks.h"
29 #include "ompi/communicator/communicator.h"
30
31 #include "ompi/runtime/params.h"
32
33 #include "opal/runtime/opal_info_support.h"
34 #include "ompi/runtime/ompi_info_support.h"
35
36 #if OMPI_RTE_ORTE
37 #include "orte/runtime/orte_info_support.h"
38 #endif
39
40 #include "opal/util/show_help.h"
41 #include "opal/util/printf.h"
42
43 const char *ompi_info_type_ompi = "ompi";
44 const char *ompi_info_type_base = "base";
45
46 static int ompi_info_registered = 0;
47
48 void ompi_info_register_types(opal_pointer_array_t *mca_types)
49 {
50 int i;
51
52
53 opal_pointer_array_add(mca_types, (void *)ompi_info_type_ompi);
54 opal_pointer_array_add(mca_types, "mpi");
55
56
57 for (i=0; NULL != ompi_frameworks[i]; i++) {
58 opal_pointer_array_add(mca_types, ompi_frameworks[i]->framework_name);
59 }
60 }
61
62 int ompi_info_register_framework_params(opal_pointer_array_t *component_map)
63 {
64 int rc;
65
66 if (ompi_info_registered++) {
67 return OMPI_SUCCESS;
68 }
69
70
71 if (OMPI_SUCCESS != (rc = ompi_mpi_register_params())) {
72 fprintf(stderr, "ompi_info_register: ompi_mpi_register_params failed\n");
73 return rc;
74 }
75
76 rc = opal_info_register_framework_params(component_map);
77 if (OPAL_SUCCESS != rc) {
78 return rc;
79 }
80
81 #if OMPI_RTE_ORTE
82 rc = orte_info_register_framework_params(component_map);
83 if (ORTE_SUCCESS != rc) {
84 return rc;
85 }
86 #endif
87
88 return opal_info_register_project_frameworks(ompi_info_type_ompi, ompi_frameworks, component_map);
89 }
90
91 void ompi_info_close_components(void)
92 {
93 int i;
94
95 assert(ompi_info_registered);
96 if (--ompi_info_registered) {
97 return;
98 }
99
100
101
102
103
104
105
106
107
108
109 for (i=0; NULL != ompi_frameworks[i]; i++) {
110 (void) mca_base_framework_close(ompi_frameworks[i]);
111 }
112
113 #if OMPI_RTE_ORTE
114
115 (void) orte_info_close_components();
116 #endif
117
118 (void) opal_info_close_components();
119 }
120
121 void ompi_info_show_ompi_version(const char *scope)
122 {
123 char *tmp, *tmp2;
124
125 (void)opal_asprintf(&tmp, "%s:version:full", ompi_info_type_ompi);
126 tmp2 = opal_info_make_version_str(scope,
127 OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
128 OMPI_RELEASE_VERSION,
129 OMPI_GREEK_VERSION,
130 OMPI_REPO_REV);
131 opal_info_out("Open MPI", tmp, tmp2);
132 free(tmp);
133 free(tmp2);
134 (void)opal_asprintf(&tmp, "%s:version:repo", ompi_info_type_ompi);
135 opal_info_out("Open MPI repo revision", tmp, OMPI_REPO_REV);
136 free(tmp);
137 (void)opal_asprintf(&tmp, "%s:version:release_date", ompi_info_type_ompi);
138 opal_info_out("Open MPI release date", tmp, OMPI_RELEASE_DATE);
139 free(tmp);
140
141 #if OMPI_RTE_ORTE
142
143 orte_info_show_orte_version(scope);
144 #endif
145
146
147 opal_info_show_opal_version(scope);
148
149 tmp2 = opal_info_make_version_str(scope,
150 MPI_VERSION, MPI_SUBVERSION,
151 0, "", "");
152 opal_info_out("MPI API", "mpi-api:version:full", tmp2);
153 free(tmp2);
154
155 opal_info_out("Ident string", "ident", OPAL_IDENT_STRING);
156 }