This source file includes following definitions.
- pmix_mca_base_framework_components_open
- open_components
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 #include <src/include/pmix_config.h>
26
27 #include <stdio.h>
28 #include <string.h>
29 #include <stdlib.h>
30
31 #include "src/class/pmix_list.h"
32 #include "src/util/argv.h"
33 #include "src/util/error.h"
34 #include "src/util/output.h"
35 #include "src/mca/mca.h"
36 #include "src/mca/base/base.h"
37 #include "pmix_common.h"
38
39
40
41
42 static int open_components(pmix_mca_base_framework_t *framework);
43
44 struct pmix_mca_base_dummy_framework_list_item_t {
45 pmix_list_item_t super;
46 pmix_mca_base_framework_t framework;
47 };
48
49
50
51
52
53 int pmix_mca_base_framework_components_open (pmix_mca_base_framework_t *framework,
54 pmix_mca_base_open_flag_t flags)
55 {
56
57 if (flags & PMIX_MCA_BASE_OPEN_FIND_COMPONENTS) {
58 bool open_dso_components = !(flags & PMIX_MCA_BASE_OPEN_STATIC_ONLY);
59
60 int ret = pmix_mca_base_component_find(NULL, framework, false, open_dso_components);
61 if (PMIX_SUCCESS != ret) {
62 return ret;
63 }
64 }
65
66
67 return open_components (framework);
68 }
69
70
71
72
73
74
75
76
77 static int open_components(pmix_mca_base_framework_t *framework)
78 {
79 pmix_list_t *components = &framework->framework_components;
80 uint32_t open_only_flags = PMIX_MCA_BASE_METADATA_PARAM_NONE;
81 int output_id = framework->framework_output;
82 pmix_mca_base_component_list_item_t *cli, *next;
83 int ret;
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100 ret = pmix_mca_base_components_filter (framework, open_only_flags);
101 if (PMIX_SUCCESS != ret) {
102 return ret;
103 }
104
105
106 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
107 "mca: base: components_open: opening %s components",
108 framework->framework_name);
109
110
111 PMIX_LIST_FOREACH_SAFE(cli, next, components, pmix_mca_base_component_list_item_t) {
112 const pmix_mca_base_component_t *component = cli->cli_component;
113
114 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
115 "mca: base: components_open: found loaded component %s",
116 component->pmix_mca_component_name);
117
118 if (NULL != component->pmix_mca_open_component) {
119
120 ret = component->pmix_mca_open_component();
121
122 if (PMIX_SUCCESS == ret) {
123 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
124 "mca: base: components_open: "
125 "component %s open function successful",
126 component->pmix_mca_component_name);
127 } else {
128 if (PMIX_ERR_NOT_AVAILABLE != ret) {
129
130
131
132
133
134
135
136
137
138
139
140 if (pmix_mca_base_component_show_load_errors) {
141 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_ERROR, output_id,
142 "mca: base: components_open: component %s "
143 "/ %s open function failed",
144 component->pmix_mca_type_name,
145 component->pmix_mca_component_name);
146 }
147 pmix_output_verbose (PMIX_MCA_BASE_VERBOSE_COMPONENT, output_id,
148 "mca: base: components_open: "
149 "component %s open function failed",
150 component->pmix_mca_component_name);
151 }
152
153 pmix_mca_base_component_close (component, output_id);
154
155 pmix_list_remove_item (components, &cli->super);
156 PMIX_RELEASE(cli);
157 }
158 }
159 }
160
161
162
163 return PMIX_SUCCESS;
164 }