This source file includes following definitions.
- plibltpdl_component_register
- plibltpdl_component_open
- plibltpdl_component_close
- plibltpdl_component_query
1
2
3
4
5
6
7
8
9
10
11
12
13
14 #include "pmix_config.h"
15
16 #include "pmix_common.h"
17 #include "pmix/mca/pdl/pdl.h"
18 #include "pmix/mca/base/pmix_mca_base_var.h"
19 #include "pmix/util/argv.h"
20
21 #include "pdl_libltdl.h"
22
23
24
25
26
27 const char *pmix_pdl_plibltpdl_component_version_string =
28 "PMIX pdl plibltdl MCA component version " PMIX_VERSION;
29
30
31
32
33
34 static int plibltpdl_component_register(void);
35 static int plibltpdl_component_open(void);
36 static int plibltpdl_component_close(void);
37 static int plibltpdl_component_query(mca_base_module_t **module, int *priority);
38
39
40
41
42
43
44 pmix_pdl_plibltpdl_component_t mca_pdl_plibltpdl_component = {
45
46
47 .base = {
48
49
50
51 .base_version = {
52 PMIX_DL_BASE_VERSION_1_0_0,
53
54
55 .mca_component_name = "plibltdl",
56 MCA_BASE_MAKE_VERSION(component, PMIX_MAJOR_VERSION, PMIX_MINOR_VERSION,
57 PMIX_RELEASE_VERSION),
58
59
60 .mca_register_component_params = plibltpdl_component_register,
61 .mca_open_component = plibltpdl_component_open,
62 .mca_close_component = plibltpdl_component_close,
63 .mca_query_component = plibltpdl_component_query,
64 },
65
66 .base_data = {
67
68 MCA_BASE_METADATA_PARAM_CHECKPOINT
69 },
70
71
72 .priority = 50
73 }
74
75
76 };
77
78
79 static int plibltpdl_component_register(void)
80 {
81
82
83 bool supported = PMIX_INT_TO_BOOL(PMIX_DL_LIBLTDL_HAVE_LT_DLADVISE);
84 mca_base_component_var_register(&mca_pdl_plibltpdl_component.base.base_version,
85 "have_lt_dladvise",
86 "Whether the version of plibltdl that this component is built against supports lt_dladvise functionality or not",
87 MCA_BASE_VAR_TYPE_BOOL,
88 NULL,
89 0,
90 MCA_BASE_VAR_FLAG_DEFAULT_ONLY,
91 PMIX_INFO_LVL_7,
92 MCA_BASE_VAR_SCOPE_CONSTANT,
93 &supported);
94
95 return PMIX_SUCCESS;
96 }
97
98 static int plibltpdl_component_open(void)
99 {
100 if (lt_dlinit()) {
101 return PMIX_ERROR;
102 }
103
104 #if PMIX_DL_LIBLTDL_HAVE_LT_DLADVISE
105 pmix_pdl_plibltpdl_component_t *c = &mca_pdl_plibltpdl_component;
106
107 if (lt_dladvise_init(&c->advise_private_noext)) {
108 return PMIX_ERR_OUT_OF_RESOURCE;
109 }
110
111 if (lt_dladvise_init(&c->advise_private_ext) ||
112 lt_dladvise_ext(&c->advise_private_ext)) {
113 return PMIX_ERR_OUT_OF_RESOURCE;
114 }
115
116 if (lt_dladvise_init(&c->advise_public_noext) ||
117 lt_dladvise_global(&c->advise_public_noext)) {
118 return PMIX_ERR_OUT_OF_RESOURCE;
119 }
120
121 if (lt_dladvise_init(&c->advise_public_ext) ||
122 lt_dladvise_global(&c->advise_public_ext) ||
123 lt_dladvise_ext(&c->advise_public_ext)) {
124 return PMIX_ERR_OUT_OF_RESOURCE;
125 }
126 #endif
127
128 return PMIX_SUCCESS;
129 }
130
131
132 static int plibltpdl_component_close(void)
133 {
134 #if PMIX_DL_LIBLTDL_HAVE_LT_DLADVISE
135 pmix_pdl_plibltpdl_component_t *c = &mca_pdl_plibltpdl_component;
136
137 lt_dladvise_destroy(&c->advise_private_noext);
138 lt_dladvise_destroy(&c->advise_private_ext);
139 lt_dladvise_destroy(&c->advise_public_noext);
140 lt_dladvise_destroy(&c->advise_public_ext);
141 #endif
142
143 lt_dlexit();
144
145 return PMIX_SUCCESS;
146 }
147
148
149 static int plibltpdl_component_query(mca_base_module_t **module, int *priority)
150 {
151
152
153
154 *priority = mca_pdl_plibltpdl_component.base.priority;
155 *module = &pmix_pdl_plibltpdl_module.super;
156
157 return PMIX_SUCCESS;
158 }