This source file includes following definitions.
- opal_deregister_params
- opal_register_params
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
30
31
32
33 #include "opal_config.h"
34
35 #include <time.h>
36 #include <signal.h>
37
38 #include "opal/constants.h"
39 #include "opal/runtime/opal.h"
40 #include "opal/datatype/opal_datatype.h"
41 #include "opal/mca/base/mca_base_var.h"
42 #include "opal/threads/mutex.h"
43 #include "opal/threads/threads.h"
44 #include "opal/mca/shmem/base/base.h"
45 #include "opal/mca/base/mca_base_var.h"
46 #include "opal/runtime/opal_params.h"
47 #include "opal/dss/dss.h"
48 #include "opal/util/opal_environ.h"
49 #include "opal/util/show_help.h"
50 #include "opal/util/timings.h"
51 #include "opal/util/printf.h"
52
53 char *opal_signal_string = NULL;
54 char *opal_stacktrace_output_filename = NULL;
55 char *opal_net_private_ipv4 = NULL;
56 char *opal_set_max_sys_limits = NULL;
57
58 #if OPAL_ENABLE_TIMING
59 char *opal_timing_sync_file = NULL;
60 char *opal_timing_output = NULL;
61 bool opal_timing_overhead = true;
62 #endif
63
64 bool opal_built_with_cuda_support = OPAL_INT_TO_BOOL(OPAL_CUDA_SUPPORT);
65 bool opal_cuda_support = false;
66 bool opal_warn_on_missing_libcuda = true;
67 #if OPAL_ENABLE_FT_CR == 1
68 bool opal_base_distill_checkpoint_ready = false;
69 #endif
70
71
72
73
74 int opal_leave_pinned = -1;
75 bool opal_leave_pinned_pipeline = false;
76 bool opal_abort_print_stack = false;
77 int opal_abort_delay = 0;
78
79 int opal_max_thread_in_progress = 1;
80
81 static bool opal_register_done = false;
82
83 static void opal_deregister_params (void)
84 {
85
86
87 opal_register_done = false;
88 }
89
90 int opal_register_params(void)
91 {
92 int ret;
93 char *string = NULL;
94
95 if (opal_register_done) {
96 return OPAL_SUCCESS;
97 }
98
99 opal_register_done = true;
100
101
102
103
104 {
105 int j;
106 int signals[] = {
107 #ifdef SIGABRT
108 SIGABRT,
109 #endif
110 #ifdef SIGBUS
111 SIGBUS,
112 #endif
113 #ifdef SIGFPE
114 SIGFPE,
115 #endif
116 #ifdef SIGSEGV
117 SIGSEGV,
118 #endif
119 -1
120 };
121 for (j = 0 ; signals[j] != -1 ; ++j) {
122 if (j == 0) {
123 opal_asprintf(&string, "%d", signals[j]);
124 } else {
125 char *tmp;
126 opal_asprintf(&tmp, "%s,%d", string, signals[j]);
127 free(string);
128 string = tmp;
129 }
130 }
131
132 opal_signal_string = string;
133 ret = mca_base_var_register ("opal", "opal", NULL, "signal",
134 "Comma-delimited list of integer signal numbers to Open MPI to attempt to intercept. Upon receipt of the intercepted signal, Open MPI will display a stack trace and abort. Open MPI will *not* replace signals if handlers are already installed by the time MPI_INIT is invoked. Optionally append \":complain\" to any signal number in the comma-delimited list to make Open MPI complain if it detects another signal handler (and therefore does not insert its own).",
135 MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
136 OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_LOCAL,
137 &opal_signal_string);
138 free (string);
139 if (0 > ret) {
140 return ret;
141 }
142 }
143
144
145
146
147
148 string = strdup("stderr");
149 opal_stacktrace_output_filename = string;
150 ret = mca_base_var_register ("opal", "opal", NULL, "stacktrace_output",
151 "Specifies where the stack trace output stream goes. "
152 "Accepts one of the following: none (disabled), stderr (default), stdout, file[:filename]. "
153 "If 'filename' is not specified, a default filename of 'stacktrace' is used. "
154 "The 'filename' is appended with either '.PID' or '.RANK.PID', if RANK is available. "
155 "The 'filename' can be an absolute path or a relative path to the current working directory.",
156 MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
157 OPAL_INFO_LVL_3,
158 MCA_BASE_VAR_SCOPE_LOCAL,
159 &opal_stacktrace_output_filename);
160 free (string);
161 if (0 > ret) {
162 return ret;
163 }
164
165
166 #if defined(HAVE_SCHED_YIELD)
167 opal_progress_yield_when_idle = false;
168 ret = mca_base_var_register ("opal", "opal", "progress", "yield_when_idle",
169 "Yield the processor when waiting on progress",
170 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
171 OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
172 &opal_progress_yield_when_idle);
173 #endif
174
175 #if OPAL_ENABLE_DEBUG
176 opal_progress_debug = false;
177 ret = mca_base_var_register ("opal", "opal", "progress", "debug",
178 "Set to non-zero to debug progress engine features",
179 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
180 OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
181 &opal_progress_debug);
182 if (0 > ret) {
183 return ret;
184 }
185
186 opal_debug_threads = false;
187 ret = mca_base_var_register ("opal", "opal", "debug", "threads",
188 "Debug thread usage within OPAL. Reports out "
189 "when threads are acquired and released.",
190 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
191 OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
192 &opal_debug_threads);
193 if (0 > ret) {
194 return ret;
195 }
196 #endif
197
198 #if OPAL_ENABLE_FT_CR == 1
199 opal_base_distill_checkpoint_ready = false;
200 ret = mca_base_var_register("opal", "opal", "base", "distill_checkpoint_ready",
201 "Distill only those components that are Checkpoint Ready",
202 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
203 OPAL_INFO_LVL_8, MCA_BASE_VAR_SCOPE_LOCAL,
204 &opal_base_distill_checkpoint_ready);
205
206 if (0 > ret) {
207 return ret;
208 }
209 #endif
210
211
212
213
214
215
216
217
218
219 opal_net_private_ipv4 = "10.0.0.0/8;172.16.0.0/12;192.168.0.0/16;169.254.0.0/16";
220 ret = mca_base_var_register ("opal", "opal", "net", "private_ipv4",
221 "Semicolon-delimited list of CIDR notation entries specifying what networks are considered \"private\" (default value based on RFC1918 and RFC3330)",
222 MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
223 OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_ALL_EQ,
224 &opal_net_private_ipv4);
225 if (0 > ret) {
226 return ret;
227 }
228
229 opal_set_max_sys_limits = NULL;
230 ret = mca_base_var_register ("opal", "opal", NULL, "set_max_sys_limits",
231 "Set the specified system-imposed limits to the specified value, including \"unlimited\"."
232 "Supported params: core, filesize, maxmem, openfiles, stacksize, maxchildren",
233 MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
234 OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_ALL_EQ,
235 &opal_set_max_sys_limits);
236 if (0 > ret) {
237 return ret;
238 }
239
240 ret = mca_base_var_register("opal", "opal", NULL, "built_with_cuda_support",
241 "Whether CUDA GPU buffer support is built into library or not",
242 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
243 OPAL_INFO_LVL_4, MCA_BASE_VAR_SCOPE_CONSTANT,
244 &opal_built_with_cuda_support);
245 if (0 > ret) {
246 return ret;
247 }
248
249
250 opal_cuda_support = opal_built_with_cuda_support;
251 ret = mca_base_var_register ("opal", "opal", NULL, "cuda_support",
252 "Whether CUDA GPU buffer support is enabled or not",
253 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
254 OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_ALL_EQ,
255 &opal_cuda_support);
256 if (0 > ret) {
257 return ret;
258 }
259
260 opal_warn_on_missing_libcuda = true;
261 ret = mca_base_var_register ("opal", "opal", NULL, "warn_on_missing_libcuda",
262 "Whether to print a message when CUDA support is enabled but libcuda is not found",
263 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, MCA_BASE_VAR_FLAG_SETTABLE,
264 OPAL_INFO_LVL_3, MCA_BASE_VAR_SCOPE_ALL_EQ,
265 &opal_warn_on_missing_libcuda);
266 if (0 > ret) {
267 return ret;
268 }
269
270
271 opal_leave_pinned = -1;
272 ret = mca_base_var_register("ompi", "mpi", NULL, "leave_pinned",
273 "Whether to use the \"leave pinned\" protocol or not. Enabling this setting can help bandwidth performance when repeatedly sending and receiving large messages with the same buffers over RDMA-based networks (false = do not use \"leave pinned\" protocol, true = use \"leave pinned\" protocol, auto = allow network to choose at runtime).",
274 MCA_BASE_VAR_TYPE_INT, &mca_base_var_enum_auto_bool, 0, 0,
275 OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
276 &opal_leave_pinned);
277 mca_base_var_register_synonym(ret, "opal", "opal", NULL, "leave_pinned",
278 MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
279
280 opal_leave_pinned_pipeline = false;
281 ret = mca_base_var_register("ompi", "mpi", NULL, "leave_pinned_pipeline",
282 "Whether to use the \"leave pinned pipeline\" protocol or not.",
283 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
284 OPAL_INFO_LVL_9,
285 MCA_BASE_VAR_SCOPE_READONLY,
286 &opal_leave_pinned_pipeline);
287 mca_base_var_register_synonym(ret, "opal", "opal", NULL, "leave_pinned_pipeline",
288 MCA_BASE_VAR_SYN_FLAG_DEPRECATED);
289
290 if (opal_leave_pinned > 0 && opal_leave_pinned_pipeline) {
291 opal_leave_pinned_pipeline = 0;
292 opal_show_help("help-opal-runtime.txt",
293 "mpi-params:leave-pinned-and-pipeline-selected",
294 true);
295 }
296
297 opal_warn_on_fork = true;
298 (void) mca_base_var_register("ompi", "mpi", NULL, "warn_on_fork",
299 "If nonzero, issue a warning if program forks under conditions that could cause system errors",
300 MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
301 OPAL_INFO_LVL_9,
302 MCA_BASE_VAR_SCOPE_READONLY,
303 &opal_warn_on_fork);
304
305 opal_abort_delay = 0;
306 ret = mca_base_var_register("opal", "opal", NULL, "abort_delay",
307 "If nonzero, print out an identifying message when abort operation is invoked (hostname, PID of the process that called abort) and delay for that many seconds before exiting (a negative delay value means to never abort). This allows attaching of a debugger before quitting the job.",
308 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
309 OPAL_INFO_LVL_5,
310 MCA_BASE_VAR_SCOPE_READONLY,
311 &opal_abort_delay);
312 if (0 > ret) {
313 return ret;
314 }
315
316 opal_abort_print_stack = false;
317 ret = mca_base_var_register("opal", "opal", NULL, "abort_print_stack",
318 "If nonzero, print out a stack trace when abort is invoked",
319 MCA_BASE_VAR_TYPE_BOOL, NULL, 0,
320
321
322
323 #if OPAL_WANT_PRETTY_PRINT_STACKTRACE
324 0,
325 OPAL_INFO_LVL_5,
326 MCA_BASE_VAR_SCOPE_READONLY,
327 #else
328 MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
329 OPAL_INFO_LVL_5,
330 MCA_BASE_VAR_SCOPE_CONSTANT,
331 #endif
332 &opal_abort_print_stack);
333 if (0 > ret) {
334 return ret;
335 }
336
337
338 (void)mca_base_var_register ("opal", "mca", "base", "env_list",
339 "Set SHELL env variables",
340 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
341 MCA_BASE_VAR_SCOPE_READONLY, &mca_base_env_list);
342
343 mca_base_env_list_sep = MCA_BASE_ENV_LIST_SEP_DEFAULT;
344 (void)mca_base_var_register ("opal", "mca", "base", "env_list_delimiter",
345 "Set SHELL env variables delimiter. Default: semicolon ';'",
346 MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0, OPAL_INFO_LVL_3,
347 MCA_BASE_VAR_SCOPE_READONLY, &mca_base_env_list_sep);
348
349
350
351
352
353
354 if (NULL != mca_base_env_list) {
355 char *name = NULL;
356 (void) mca_base_var_env_name ("mca_base_env_list", &name);
357 if (NULL != name) {
358 opal_setenv(name, mca_base_env_list, false, &environ);
359 free(name);
360 }
361 }
362
363
364
365
366
367 (void)mca_base_var_register ("opal", "mca", "base", "env_list_internal",
368 "Store SHELL env variables from amca conf file",
369 MCA_BASE_VAR_TYPE_STRING, NULL, 0, MCA_BASE_VAR_FLAG_INTERNAL, OPAL_INFO_LVL_3,
370 MCA_BASE_VAR_SCOPE_READONLY, &mca_base_env_list_internal);
371
372
373 (void)mca_base_var_register ("opal", "opal", NULL, "max_thread_in_progress",
374 "Number of thread allowed in opal_progress. Default: 1",
375 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0, OPAL_INFO_LVL_8,
376 MCA_BASE_VAR_SCOPE_READONLY, &opal_max_thread_in_progress);
377
378
379 ret = opal_datatype_register_params();
380 if (OPAL_SUCCESS != ret) {
381 return ret;
382 }
383
384
385 ret = opal_dss_register_vars ();
386 if (OPAL_SUCCESS != ret) {
387 return ret;
388 }
389
390 opal_finalize_register_cleanup (opal_deregister_params);
391
392 return OPAL_SUCCESS;
393 }