This source file includes following definitions.
- component_register
- component_open
- component_query
- component_close
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
26
27
28
29 #include "orte_config.h"
30 #include "orte/constants.h"
31
32 #include "opal/mca/pmix/pmix.h"
33 #include "opal/mca/pmix/base/base.h"
34
35 #include "orte/util/proc_info.h"
36 #include "orte/util/show_help.h"
37 #include "orte/mca/schizo/schizo.h"
38
39 #include "orte/mca/ess/ess.h"
40 #include "orte/mca/ess/singleton/ess_singleton.h"
41
42 extern orte_ess_base_module_t orte_ess_singleton_module;
43
44 static int component_open(void);
45 static int component_close(void);
46 static int component_query(mca_base_module_t **module, int *priority);
47 static int component_register(void);
48
49
50
51
52
53 orte_ess_singleton_component_t mca_ess_singleton_component = {
54 {
55
56
57 .base_version = {
58 ORTE_ESS_BASE_VERSION_3_0_0,
59
60
61 .mca_component_name = "singleton",
62 MCA_BASE_MAKE_VERSION(component, ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
63 ORTE_RELEASE_VERSION),
64
65
66 .mca_open_component = component_open,
67 .mca_close_component = component_close,
68 .mca_query_component = component_query,
69 .mca_register_component_params = component_register,
70 },
71 .base_data = {
72
73 MCA_BASE_METADATA_PARAM_NONE
74 },
75 },
76 .server_uri = NULL,
77 .isolated = false
78 };
79
80 static int component_register(void)
81 {
82 int ret;
83
84 mca_ess_singleton_component.server_uri = NULL;
85 ret = mca_base_component_var_register(&mca_ess_singleton_component.super.base_version,
86 "server",
87 "Server to be used as HNP - [file|FILE]:<filename> or just uri",
88 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
89 OPAL_INFO_LVL_9,
90 MCA_BASE_VAR_SCOPE_READONLY,
91 &mca_ess_singleton_component.server_uri);
92 (void) mca_base_var_register_synonym(ret, "orte", "orte", NULL, "server", 0);
93
94 ret = mca_base_component_var_register(&mca_ess_singleton_component.super.base_version,
95 "isolated",
96 "Do not start a supporting daemon as this process will never attempt to spawn",
97 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
98 OPAL_INFO_LVL_9,
99 MCA_BASE_VAR_SCOPE_READONLY,
100 &mca_ess_singleton_component.isolated);
101
102 return ORTE_SUCCESS;
103 }
104
105 static int component_open(void)
106 {
107 return ORTE_SUCCESS;
108 }
109
110 static int component_query(mca_base_module_t **module, int *priority)
111 {
112 orte_schizo_launch_environ_t ret;
113
114
115
116
117 if (ORTE_PROC_IS_HNP ||
118 ORTE_PROC_IS_DAEMON ||
119 ORTE_PROC_IS_TOOL) {
120 *module = NULL;
121 *priority = 0;
122 return ORTE_ERROR;
123 }
124
125
126 ret = orte_schizo.check_launch_environment();
127 if (ORTE_SCHIZO_UNMANAGED_SINGLETON != ret &&
128 ORTE_SCHIZO_MANAGED_SINGLETON != ret) {
129
130 *module = NULL;
131 *priority = 0;
132 return ORTE_ERROR;
133 }
134
135
136
137
138
139
140
141
142
143 if (ORTE_SCHIZO_UNMANAGED_SINGLETON == ret) {
144
145 if (NULL != getenv("SLURM_NODELIST")) {
146
147 orte_show_help("help-ess-base.txt", "slurm-error2", true);
148 *module = NULL;
149 *priority = 0;
150 return ORTE_ERR_SILENT;
151 }
152
153 if (NULL != getenv("ALPS_APP_ID")) {
154 orte_show_help("help-ess-base.txt", "alps-error2", true);
155 *module = NULL;
156 *priority = 0;
157 return ORTE_ERR_SILENT;
158 }
159 }
160
161
162 *priority = 100;
163 *module = (mca_base_module_t *)&orte_ess_singleton_module;
164 return ORTE_SUCCESS;
165 }
166
167
168 static int component_close(void)
169 {
170 return ORTE_SUCCESS;
171 }