Skip to content

Commit a4990de

Browse files
committed
mca: track external lib version (runtime/compiletime) for mca component
based on thread: http://www.open-mpi.org/community/lists/devel/2014/04/14505.php Create mca parameter to track runtime/compiletime ext lib version for component. cmr=v1.8.2:reviewer=ompi-rm1.8 This commit was SVN r31487.
1 parent 18f9a28 commit a4990de

File tree

7 files changed

+94
-1
lines changed

7 files changed

+94
-1
lines changed

ompi/mca/coll/fca/coll_fca.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ struct mca_coll_fca_component_t {
174174
/** MCA parameter: Enable parallel hash calc */
175175
int fca_parallel_hash_calc;
176176

177+
/* r/o MCA parameter: compiletime libfca version */
178+
char* compiletime_version;
179+
180+
/* r/o MCA parameter: runtime libfca version */
181+
char* runtime_version;
182+
177183
/** Some statistics counters */
178184
double fca_total_work_time;
179185
double fca_work_time_parallel;

ompi/mca/coll/fca/coll_fca_component.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,24 @@ static int fca_register(void)
14071407
OPAL_INFO_LVL_9,
14081408
MCA_BASE_VAR_SCOPE_READONLY,
14091409
&mca_coll_fca_component.fca_number_of_primes);
1410+
mca_coll_fca_component.compiletime_version = FCA_VERNO_STRING;
1411+
(void) mca_base_component_var_register(c,
1412+
MCA_COMPILETIME_VER,
1413+
"Version of the libfca library ompi compiled with",
1414+
MCA_BASE_VAR_TYPE_STRING,
1415+
NULL, 0, 0,
1416+
OPAL_INFO_LVL_3,
1417+
MCA_BASE_VAR_SCOPE_READONLY,
1418+
&mca_coll_fca_component.compiletime_version);
1419+
mca_coll_fca_component.runtime_version = fca_get_version_string();
1420+
(void) mca_base_component_var_register(c,
1421+
MCA_RUNTIME_VER,
1422+
"Version of the libfca library ompi run with",
1423+
MCA_BASE_VAR_TYPE_STRING,
1424+
NULL, 0, 0,
1425+
OPAL_INFO_LVL_3,
1426+
MCA_BASE_VAR_SCOPE_READONLY,
1427+
&mca_coll_fca_component.runtime_version);
14101428

14111429
mca_coll_fca_component.fca_total_work_time = 0;
14121430
mca_coll_fca_component.fca_work_time_parallel = 0;

ompi/mca/coll/hcoll/coll_hcoll.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ struct mca_coll_hcoll_component_t {
6767
/** MCA parameter: ON/OFF user defined datatype through HCOLL */
6868
int hcoll_datatype_fallback;
6969

70+
/** r/o MCA parameter: libhcoll runtime version */
71+
char* runtime_version;
72+
73+
/** r/o MCA parameter: libhcoll compiletime version */
74+
char* compiletime_version;
75+
7076
/* FCA global stuff */
7177
mca_coll_hcoll_ops_t hcoll_ops;
7278
ompi_free_list_t requests;

ompi/mca/coll/hcoll/coll_hcoll_component.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ mca_coll_hcoll_component_t mca_coll_hcoll_component = {
5858
},
5959
90, /* priority */
6060
0, /* verbose level */
61-
1 /* hcoll_enable */
61+
1, /* hcoll_enable */
62+
NULL /*hcoll version */
6263
};
6364

6465

@@ -206,6 +207,24 @@ static int hcoll_register(void)
206207
&mca_coll_hcoll_component.hcoll_datatype_fallback,
207208
0));
208209

210+
mca_coll_hcoll_component.compiletime_version = HCOLL_VERNO_STRING;
211+
mca_base_component_var_register(&mca_coll_hcoll_component.super.collm_version,
212+
MCA_COMPILETIME_VER,
213+
"Version of the libhcoll library ompi compiled with",
214+
MCA_BASE_VAR_TYPE_STRING,
215+
NULL, 0, 0,
216+
OPAL_INFO_LVL_3,
217+
MCA_BASE_VAR_SCOPE_READONLY,
218+
&mca_coll_hcoll_component.compiletime_version);
219+
mca_coll_hcoll_component.runtime_version = hcoll_get_version();
220+
mca_base_component_var_register(&mca_coll_hcoll_component.super.collm_version,
221+
MCA_RUNTIME_VER,
222+
"Version of the libhcoll library ompi run with",
223+
MCA_BASE_VAR_TYPE_STRING,
224+
NULL, 0, 0,
225+
OPAL_INFO_LVL_3,
226+
MCA_BASE_VAR_SCOPE_READONLY,
227+
&mca_coll_hcoll_component.runtime_version);
209228

210229
return ret;
211230
}

ompi/mca/mtl/mxm/mtl_mxm_component.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ static int ompi_mtl_mxm_component_register(void)
6363
{
6464
mca_base_component_t*c;
6565

66+
#if MXM_API < MXM_VERSION(3,0)
67+
unsigned long cur_ver;
68+
long major, minor;
69+
char* runtime_version;
70+
#endif
71+
6672
c = &mca_mtl_mxm_component.super.mtl_version;
6773

6874
ompi_mtl_mxm.verbose = 0;
@@ -86,6 +92,39 @@ static int ompi_mtl_mxm_component_register(void)
8692
MCA_BASE_VAR_SCOPE_READONLY,
8793
&ompi_mtl_mxm.mxm_np);
8894

95+
ompi_mtl_mxm.compiletime_version = MXM_VERNO_STRING;
96+
(void) mca_base_component_var_register(c,
97+
MCA_COMPILETIME_VER,
98+
"Version of the libmxm library ompi compiled with",
99+
MCA_BASE_VAR_TYPE_STRING,
100+
NULL, 0, 0,
101+
OPAL_INFO_LVL_3,
102+
MCA_BASE_VAR_SCOPE_READONLY,
103+
&ompi_mtl_mxm.compiletime_version);
104+
105+
#if MXM_API >= MXM_VERSION(3,0)
106+
ompi_mtl_mxm.runtime_version = mxm_get_version_string();
107+
#else
108+
cur_ver = mxm_get_version();
109+
major = (cur_ver >> MXM_MAJOR_BIT) & 0xff;
110+
minor = (cur_ver >> MXM_MINOR_BIT) & 0xff;
111+
asprintf(&runtime_version, "%ld.%ld", major, minor);
112+
ompi_mtl_mxm.runtime_version = runtime_version;
113+
#endif
114+
115+
(void) mca_base_component_var_register(c,
116+
MCA_RUNTIME_VER,
117+
"Version of the libmxm library ompi run with",
118+
MCA_BASE_VAR_TYPE_STRING,
119+
NULL, 0, 0,
120+
OPAL_INFO_LVL_3,
121+
MCA_BASE_VAR_SCOPE_READONLY,
122+
&ompi_mtl_mxm.runtime_version);
123+
124+
#if MXM_API < MXM_VERSION(3,0)
125+
free(runtime_version);
126+
#endif
127+
89128
return OMPI_SUCCESS;
90129
}
91130

ompi/mca/mtl/mxm/mtl_mxm_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ typedef struct mca_mtl_mxm_module_t {
3535
#if MXM_API >= MXM_VERSION(2,0)
3636
int using_mem_hooks;
3737
#endif
38+
char* runtime_version;
39+
char* compiletime_version;
3840
} mca_mtl_mxm_module_t;
3941

4042

opal/mca/base/mca_base_var.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ typedef enum {
716716
*/
717717
OPAL_DECLSPEC int mca_base_var_dump(int vari, char ***out, mca_base_var_dump_type_t output_type);
718718

719+
#define MCA_COMPILETIME_VER "print_compiletime_version"
720+
#define MCA_RUNTIME_VER "print_runtime_version"
721+
719722
END_C_DECLS
720723

721724
#endif /* OPAL_MCA_BASE_VAR_H */

0 commit comments

Comments
 (0)