1
1

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.
Этот коммит содержится в:
Mike Dubman 2014-04-22 18:02:26 +00:00
родитель 18f9a282d5
Коммит a4990de055
7 изменённых файлов: 94 добавлений и 1 удалений

Просмотреть файл

@ -174,6 +174,12 @@ struct mca_coll_fca_component_t {
/** MCA parameter: Enable parallel hash calc */
int fca_parallel_hash_calc;
/* r/o MCA parameter: compiletime libfca version */
char* compiletime_version;
/* r/o MCA parameter: runtime libfca version */
char* runtime_version;
/** Some statistics counters */
double fca_total_work_time;
double fca_work_time_parallel;

Просмотреть файл

@ -1407,6 +1407,24 @@ static int fca_register(void)
OPAL_INFO_LVL_9,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_coll_fca_component.fca_number_of_primes);
mca_coll_fca_component.compiletime_version = FCA_VERNO_STRING;
(void) mca_base_component_var_register(c,
MCA_COMPILETIME_VER,
"Version of the libfca library ompi compiled with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_coll_fca_component.compiletime_version);
mca_coll_fca_component.runtime_version = fca_get_version_string();
(void) mca_base_component_var_register(c,
MCA_RUNTIME_VER,
"Version of the libfca library ompi run with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_coll_fca_component.runtime_version);
mca_coll_fca_component.fca_total_work_time = 0;
mca_coll_fca_component.fca_work_time_parallel = 0;

Просмотреть файл

@ -67,6 +67,12 @@ struct mca_coll_hcoll_component_t {
/** MCA parameter: ON/OFF user defined datatype through HCOLL */
int hcoll_datatype_fallback;
/** r/o MCA parameter: libhcoll runtime version */
char* runtime_version;
/** r/o MCA parameter: libhcoll compiletime version */
char* compiletime_version;
/* FCA global stuff */
mca_coll_hcoll_ops_t hcoll_ops;
ompi_free_list_t requests;

Просмотреть файл

@ -58,7 +58,8 @@ mca_coll_hcoll_component_t mca_coll_hcoll_component = {
},
90, /* priority */
0, /* verbose level */
1 /* hcoll_enable */
1, /* hcoll_enable */
NULL /*hcoll version */
};
@ -206,6 +207,24 @@ static int hcoll_register(void)
&mca_coll_hcoll_component.hcoll_datatype_fallback,
0));
mca_coll_hcoll_component.compiletime_version = HCOLL_VERNO_STRING;
mca_base_component_var_register(&mca_coll_hcoll_component.super.collm_version,
MCA_COMPILETIME_VER,
"Version of the libhcoll library ompi compiled with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_coll_hcoll_component.compiletime_version);
mca_coll_hcoll_component.runtime_version = hcoll_get_version();
mca_base_component_var_register(&mca_coll_hcoll_component.super.collm_version,
MCA_RUNTIME_VER,
"Version of the libhcoll library ompi run with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&mca_coll_hcoll_component.runtime_version);
return ret;
}

Просмотреть файл

@ -63,6 +63,12 @@ static int ompi_mtl_mxm_component_register(void)
{
mca_base_component_t*c;
#if MXM_API < MXM_VERSION(3,0)
unsigned long cur_ver;
long major, minor;
char* runtime_version;
#endif
c = &mca_mtl_mxm_component.super.mtl_version;
ompi_mtl_mxm.verbose = 0;
@ -86,6 +92,39 @@ static int ompi_mtl_mxm_component_register(void)
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_mtl_mxm.mxm_np);
ompi_mtl_mxm.compiletime_version = MXM_VERNO_STRING;
(void) mca_base_component_var_register(c,
MCA_COMPILETIME_VER,
"Version of the libmxm library ompi compiled with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_mtl_mxm.compiletime_version);
#if MXM_API >= MXM_VERSION(3,0)
ompi_mtl_mxm.runtime_version = mxm_get_version_string();
#else
cur_ver = mxm_get_version();
major = (cur_ver >> MXM_MAJOR_BIT) & 0xff;
minor = (cur_ver >> MXM_MINOR_BIT) & 0xff;
asprintf(&runtime_version, "%ld.%ld", major, minor);
ompi_mtl_mxm.runtime_version = runtime_version;
#endif
(void) mca_base_component_var_register(c,
MCA_RUNTIME_VER,
"Version of the libmxm library ompi run with",
MCA_BASE_VAR_TYPE_STRING,
NULL, 0, 0,
OPAL_INFO_LVL_3,
MCA_BASE_VAR_SCOPE_READONLY,
&ompi_mtl_mxm.runtime_version);
#if MXM_API < MXM_VERSION(3,0)
free(runtime_version);
#endif
return OMPI_SUCCESS;
}

Просмотреть файл

@ -35,6 +35,8 @@ typedef struct mca_mtl_mxm_module_t {
#if MXM_API >= MXM_VERSION(2,0)
int using_mem_hooks;
#endif
char* runtime_version;
char* compiletime_version;
} mca_mtl_mxm_module_t;

Просмотреть файл

@ -716,6 +716,9 @@ typedef enum {
*/
OPAL_DECLSPEC int mca_base_var_dump(int vari, char ***out, mca_base_var_dump_type_t output_type);
#define MCA_COMPILETIME_VER "print_compiletime_version"
#define MCA_RUNTIME_VER "print_runtime_version"
END_C_DECLS
#endif /* OPAL_MCA_BASE_VAR_H */