Skip to content

Commit 9f472d8

Browse files
committed
pmix: add "pmix*_library_version" info MCA var
Simple MCA vars for ext1, ext2, and pmix3 components to reflect what the underlying PMIx library version is. For example: ``` $ ompi_info --param pmix pmix3x --parsable --level 9 | grep library_version mca:pmix:pmix3x:param:pmix_pmix3x_library_version:value:PMIx library version 3.0.0 (embedded in Open MPI) mca:pmix:pmix3x:param:pmix_pmix3x_library_version:source:default mca:pmix:pmix3x:param:pmix_pmix3x_library_version:status:writeable mca:pmix:pmix3x:param:pmix_pmix3x_library_version:level:4 mca:pmix:pmix3x:param:pmix_pmix3x_library_version:help:Version of the underlying PMIx library mca:pmix:pmix3x:param:pmix_pmix3x_library_version:deprecated:no mca:pmix:pmix3x:param:pmix_pmix3x_library_version:type:string mca:pmix:pmix3x:param:pmix_pmix3x_library_version:disabled:false ``` Signed-off-by: Jeff Squyres <[email protected]>
1 parent 4092138 commit 9f472d8

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

opal/mca/pmix/ext1x/pmix1x_component.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
33
* Copyright (c) 2014-2017 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
5-
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
66
* $COPYRIGHT$
77
*
88
* Additional copyrights may follow
@@ -38,6 +38,11 @@ static int external_open(void);
3838
static int external_close(void);
3939
static int external_component_query(mca_base_module_t **module, int *priority);
4040

41+
/*
42+
* Local variable
43+
*/
44+
static char *pmix_library_version = NULL;
45+
4146

4247
/*
4348
* Instantiate the public struct with all of our public information
@@ -66,6 +71,7 @@ mca_pmix_ext1x_component_t mca_pmix_ext1x_component = {
6671
.mca_open_component = external_open,
6772
.mca_close_component = external_close,
6873
.mca_query_component = external_component_query,
74+
.mca_register_component_params = external_register
6975
},
7076
/* Next the MCA v1.0.0 component meta data */
7177
.base_data = {
@@ -76,6 +82,22 @@ mca_pmix_ext1x_component_t mca_pmix_ext1x_component = {
7682
.native_launch = false
7783
};
7884

85+
static int external_register(void)
86+
{
87+
mca_base_component_t *component = &mca_pmix_pmix3x_component.super.base_version;
88+
89+
asprintf(&pmix_library_version, "PMIx library version %s", PMIx_Get_version());
90+
(void) mca_base_component_var_register(component, "library_version",
91+
"Version of the underlying PMIx library",
92+
MCA_BASE_VAR_TYPE_STRING,
93+
NULL, 0, 0,
94+
OPAL_INFO_LVL_4,
95+
MCA_BASE_VAR_SCOPE_CONSTANT,
96+
&pmix_library_version);
97+
98+
return OPAL_SUCCESS;
99+
}
100+
79101
static int external_open(void)
80102
{
81103
const char *version;

opal/mca/pmix/ext2x/ext2x_component.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
33
* Copyright (c) 2014-2015 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
5-
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
66
* $COPYRIGHT$
77
*
88
* Additional copyrights may follow
@@ -39,6 +39,11 @@ static int external_open(void);
3939
static int external_close(void);
4040
static int external_component_query(mca_base_module_t **module, int *priority);
4141

42+
/*
43+
* Local variable
44+
*/
45+
static char *pmix_library_version = NULL;
46+
4247

4348
/*
4449
* Instantiate the public struct with all of our public information
@@ -91,6 +96,15 @@ static int external_register(void)
9196
MCA_BASE_VAR_SCOPE_READONLY,
9297
&mca_pmix_ext2x_component.silence_warning);
9398

99+
asprintf(&pmix_library_version, "PMIx library version %s", PMIx_Get_version());
100+
(void) mca_base_component_var_register(component, "library_version",
101+
"Version of the underlying PMIx library",
102+
MCA_BASE_VAR_TYPE_STRING,
103+
NULL, 0, 0,
104+
OPAL_INFO_LVL_4,
105+
MCA_BASE_VAR_SCOPE_CONSTANT,
106+
&pmix_library_version);
107+
94108
return OPAL_SUCCESS;
95109
}
96110

opal/mca/pmix/pmix3x/pmix3x_component.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright (c) 2014-2018 Intel, Inc. All rights reserved.
33
* Copyright (c) 2014-2015 Research Organization for Information Science
44
* and Technology (RIST). All rights reserved.
5-
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
5+
* Copyright (c) 2016-2018 Cisco Systems, Inc. All rights reserved
66
* $COPYRIGHT$
77
*
88
* Additional copyrights may follow
@@ -39,6 +39,11 @@ static int external_open(void);
3939
static int external_close(void);
4040
static int external_component_query(mca_base_module_t **module, int *priority);
4141

42+
/*
43+
* Local variable
44+
*/
45+
static char *pmix_library_version = NULL;
46+
4247

4348
/*
4449
* Instantiate the public struct with all of our public information
@@ -90,6 +95,16 @@ static int external_register(void)
9095
MCA_BASE_VAR_SCOPE_READONLY,
9196
&mca_pmix_pmix3x_component.silence_warning);
9297

98+
asprintf(&pmix_library_version,
99+
"PMIx library version %s (embedded in Open MPI)", PMIx_Get_version());
100+
(void) mca_base_component_var_register(component, "library_version",
101+
"Version of the underlying PMIx library",
102+
MCA_BASE_VAR_TYPE_STRING,
103+
NULL, 0, 0,
104+
OPAL_INFO_LVL_4,
105+
MCA_BASE_VAR_SCOPE_CONSTANT,
106+
&pmix_library_version);
107+
93108
return OPAL_SUCCESS;
94109
}
95110

0 commit comments

Comments
 (0)