This source file includes following definitions.
- pmix_s2_component_register
- pmix_s2_component_query
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include "opal_config.h"
21
22 #include "opal/constants.h"
23 #include "opal/mca/pmix/pmix.h"
24 #include "pmix_s2.h"
25
26
27
28
29 const char *opal_pmix_s2_component_version_string =
30 "OPAL s2 pmix MCA component version " OPAL_VERSION;
31
32
33
34
35 static int pmix_s2_component_query(mca_base_module_t **module, int *priority);
36 static int pmix_s2_component_register(void);
37
38
39
40
41
42
43
44 opal_pmix_base_component_t mca_pmix_s2_component = {
45
46
47
48
49 .base_version = {
50
51
52
53 OPAL_PMIX_BASE_VERSION_2_0_0,
54
55
56
57 .mca_component_name = "s2",
58 MCA_BASE_MAKE_VERSION(component, OPAL_MAJOR_VERSION, OPAL_MINOR_VERSION,
59 OPAL_RELEASE_VERSION),
60
61 .mca_query_component = pmix_s2_component_query,
62 .mca_register_component_params = pmix_s2_component_register,
63 },
64
65 .base_data = {
66
67 MCA_BASE_METADATA_PARAM_CHECKPOINT
68 },
69 .priority = 20,
70 };
71
72
73 static int pmix_s2_component_register(void)
74 {
75 int ret;
76 mca_base_component_t *component = &(mca_pmix_s2_component.base_version);
77
78 ret = mca_base_component_var_register(component, "priority",
79 "Priority of the pmix s2 component (default: 20)",
80 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
81 OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
82 &mca_pmix_s2_component.priority);
83 if (0 > ret) {
84 return ret;
85 }
86
87 return OPAL_SUCCESS;
88 }
89
90 static int pmix_s2_component_query(mca_base_module_t **module, int *priority)
91 {
92
93
94 if (NULL == getenv("SLURM_STEP_NUM_TASKS") ||
95 NULL == getenv("PMI_FD")) {
96 *priority = 0;
97 *module = NULL;
98 return OPAL_ERROR;
99 }
100
101
102 *priority = mca_pmix_s2_component.priority;
103 *module = (mca_base_module_t *)&opal_pmix_s2_module;
104 return OPAL_SUCCESS;
105 }