This source file includes following definitions.
- orte_snapc_base_select
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 #include "orte_config.h"
21
22 #include <string.h>
23
24 #include "orte/constants.h"
25
26 #include "orte/mca/mca.h"
27 #include "opal/util/output.h"
28 #include "opal/mca/base/base.h"
29
30 #include "orte/mca/sstore/sstore.h"
31 #include "orte/mca/sstore/base/base.h"
32
33 #include "orte/mca/snapc/snapc.h"
34 #include "orte/mca/snapc/base/base.h"
35
36
37 static orte_snapc_base_module_t none_module = {
38
39 orte_snapc_base_module_init,
40
41 orte_snapc_base_module_finalize,
42 orte_snapc_base_none_setup_job,
43 orte_snapc_base_none_release_job,
44 orte_snapc_base_none_ft_event,
45 orte_snapc_base_none_start_ckpt,
46 orte_snapc_base_none_end_ckpt
47 };
48
49 int orte_snapc_base_select(bool seed, bool app)
50 {
51 int exit_status = OPAL_SUCCESS;
52 orte_snapc_base_component_t *best_component = NULL;
53 orte_snapc_base_module_t *best_module = NULL;
54 const char **include_list = NULL;
55 int var_id;
56
57
58
59
60
61 var_id = mca_base_var_find(NULL, "snapc", NULL, NULL);
62 mca_base_var_get_value(var_id, &include_list, NULL, NULL);
63
64 if(NULL != include_list && NULL != include_list[0] &&
65 0 == strncmp(include_list[0], "none", strlen("none")) ){
66 opal_output_verbose(10, orte_snapc_base_framework.framework_output,
67 "snapc:select: Using %s component",
68 include_list[0]);
69 best_module = &none_module;
70
71 mca_base_components_close(0,
72 &orte_snapc_base_framework.framework_components,
73 NULL);
74
75 goto skip_select;
76 }
77
78
79
80
81 if( OPAL_SUCCESS != mca_base_select("snapc", orte_snapc_base_framework.framework_output,
82 &orte_snapc_base_framework.framework_components,
83 (mca_base_module_t **) &best_module,
84 (mca_base_component_t **) &best_component, NULL) ) {
85
86 exit_status = ORTE_ERROR;
87 goto cleanup;
88 }
89
90 skip_select:
91
92 orte_snapc = *best_module;
93
94
95 if (NULL != best_module) {
96 if (OPAL_SUCCESS != orte_snapc.snapc_init(seed, app)) {
97 exit_status = OPAL_ERROR;
98 goto cleanup;
99 }
100 }
101
102 cleanup:
103
104 return exit_status;
105 }