This source file includes following definitions.
- mca_btl_uct_tl_supports_rdma
- mca_btl_uct_tl_support_am
- mca_btl_uct_tl_supports_conn
- mca_btl_uct_tl_requires_connection_tl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #ifndef MCA_BTL_UCT_H
25 #define MCA_BTL_UCT_H
26
27 #include "opal_config.h"
28 #include <sys/types.h>
29 #include <string.h>
30
31
32 #include "opal/mca/event/event.h"
33 #include "opal/mca/btl/base/base.h"
34 #include "opal/mca/mpool/mpool.h"
35 #include "opal/mca/btl/base/btl_base_error.h"
36 #include "opal/mca/rcache/base/base.h"
37 #include "opal/class/opal_fifo.h"
38 #include "opal/class/opal_hash_table.h"
39 #include "opal/mca/pmix/pmix.h"
40 #include "opal/threads/tsd.h"
41 #include <uct/api/uct.h>
42
43 #include "btl_uct_types.h"
44
45 BEGIN_C_DECLS
46
47
48 #if defined(UCT_IFACE_FLAG_ATOMIC_ADD32)
49 #define OPAL_HAVE_UCT_EP_ATOMIC64_POST 0
50 #else
51 #define OPAL_HAVE_UCT_EP_ATOMIC64_POST 1
52 #endif
53
54
55
56
57 struct mca_btl_uct_module_t {
58
59 mca_btl_base_module_t super;
60
61
62 bool initialized;
63
64
65 opal_mutex_t endpoint_lock;
66
67
68 opal_hash_table_t id_to_endpoint;
69
70
71 opal_recursive_mutex_t lock;
72
73
74 ucs_async_context_t *ucs_async;
75
76
77 mca_btl_uct_tl_t *am_tl;
78
79
80 mca_btl_uct_tl_t *rdma_tl;
81
82
83 mca_btl_uct_tl_t *conn_tl;
84
85
86 mca_btl_uct_tl_t *comm_tls[2];
87
88
89 mca_rcache_base_module_t *rcache;
90
91
92 char *md_name;
93
94
95 bool shared_endpoints;
96
97
98 mca_btl_uct_md_t *md;
99
100
101 opal_free_list_t short_frags;
102
103
104 opal_free_list_t eager_frags;
105
106
107 opal_free_list_t max_frags;
108
109
110 opal_list_t pending_frags;
111
112
113 opal_fifo_t pending_connection_reqs;
114 };
115 typedef struct mca_btl_uct_module_t mca_btl_uct_module_t;
116
117 extern mca_btl_uct_module_t mca_btl_uct_module_template;
118
119
120
121
122 struct mca_btl_uct_component_t {
123
124 mca_btl_base_component_3_0_0_t super;
125
126
127 int module_count;
128
129
130 mca_btl_uct_module_t *modules[MCA_BTL_UCT_MAX_MODULES];
131
132
133 char *memory_domains;
134
135
136 char *allowed_transports;
137
138
139 int num_contexts_per_module;
140
141 #if OPAL_C_HAVE__THREAD_LOCAL
142
143 bool bind_threads_to_contexts;
144 #endif
145
146
147 bool disable_ucx_memory_hooks;
148 };
149 typedef struct mca_btl_uct_component_t mca_btl_uct_component_t;
150
151 OPAL_MODULE_DECLSPEC extern mca_btl_uct_component_t mca_btl_uct_component;
152
153 struct mca_btl_base_registration_handle_t {
154
155 uint8_t packed_handle[1];
156 };
157
158 struct mca_btl_uct_reg_t {
159 mca_rcache_base_registration_t base;
160
161
162 uct_mem_h uct_memh;
163
164
165 mca_btl_base_registration_handle_t handle;
166 };
167 typedef struct mca_btl_uct_reg_t mca_btl_uct_reg_t;
168
169 OBJ_CLASS_DECLARATION(mca_btl_uct_reg_t);
170
171 #define MCA_BTL_UCT_REG_REMOTE_TO_LOCAL(reg) ((mca_btl_uct_reg_t *)((intptr_t) (reg) - offsetof (mca_btl_uct_reg_t, handle)))
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204 int mca_btl_uct_put (struct mca_btl_base_module_t *btl,
205 struct mca_btl_base_endpoint_t *endpoint, void *local_address,
206 uint64_t remote_address, struct mca_btl_base_registration_handle_t *local_handle,
207 struct mca_btl_base_registration_handle_t *remote_handle, size_t size, int flags,
208 int order, mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata);
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241 int mca_btl_uct_get (struct mca_btl_base_module_t *btl,
242 struct mca_btl_base_endpoint_t *endpoint, void *local_address,
243 uint64_t remote_address, struct mca_btl_base_registration_handle_t *local_handle,
244 struct mca_btl_base_registration_handle_t *remote_handle, size_t size, int flags,
245 int order, mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata);
246
247
248
249
250
251
252 int mca_btl_uct_ft_event(int state);
253
254 int mca_btl_uct_aop (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint,
255 uint64_t remote_address, mca_btl_base_registration_handle_t *remote_handle,
256 mca_btl_base_atomic_op_t op, uint64_t operand, int flags, int order,
257 mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata);
258
259 int mca_btl_uct_afop (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint,
260 void *local_address, uint64_t remote_address, mca_btl_base_registration_handle_t *local_handle,
261 mca_btl_base_registration_handle_t *remote_handle, mca_btl_base_atomic_op_t op,
262 uint64_t operand, int flags, int order, mca_btl_base_rdma_completion_fn_t cbfunc,
263 void *cbcontext, void *cbdata);
264
265 int mca_btl_uct_acswap (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint,
266 void *local_address, uint64_t remote_address, mca_btl_base_registration_handle_t *local_handle,
267 mca_btl_base_registration_handle_t *remote_handle, uint64_t compare, uint64_t value, int flags,
268 int order, mca_btl_base_rdma_completion_fn_t cbfunc, void *cbcontext, void *cbdata);
269
270
271 int mca_btl_uct_flush (struct mca_btl_base_module_t *btl, struct mca_btl_base_endpoint_t *endpoint);
272 int mca_btl_uct_flush_thread (mca_btl_base_module_t *btl);
273
274 int mca_btl_uct_finalize (mca_btl_base_module_t *btl);
275
276 int mca_btl_uct_reg_mem (void *reg_data, void *base, size_t size, mca_rcache_base_registration_t *reg);
277 int mca_btl_uct_dereg_mem (void *reg_data, mca_rcache_base_registration_t *reg);
278
279 ucs_status_t mca_btl_uct_am_handler (void *arg, void *data, size_t length, unsigned flags);
280
281 struct mca_btl_base_endpoint_t *mca_btl_uct_get_ep (struct mca_btl_base_module_t *module, opal_proc_t *proc);
282
283 int mca_btl_uct_query_tls (mca_btl_uct_module_t *module, mca_btl_uct_md_t *md, uct_tl_resource_desc_t *tl_descs, unsigned tl_count);
284 int mca_btl_uct_process_connection_request (mca_btl_uct_module_t *module, mca_btl_uct_conn_req_t *req);
285
286
287
288
289
290
291 static inline bool mca_btl_uct_tl_supports_rdma (mca_btl_uct_tl_t *tl)
292 {
293 return (MCA_BTL_UCT_TL_ATTR(tl, 0).cap.flags & (UCT_IFACE_FLAG_PUT_ZCOPY | UCT_IFACE_FLAG_GET_ZCOPY)) ==
294 (UCT_IFACE_FLAG_PUT_ZCOPY | UCT_IFACE_FLAG_GET_ZCOPY);
295 }
296
297
298
299
300 static inline bool mca_btl_uct_tl_support_am (mca_btl_uct_tl_t *tl)
301 {
302 return (MCA_BTL_UCT_TL_ATTR(tl, 0).cap.flags & (UCT_IFACE_FLAG_AM_SHORT | UCT_IFACE_FLAG_AM_BCOPY | UCT_IFACE_FLAG_AM_ZCOPY));
303 }
304
305
306
307
308
309
310 static inline bool mca_btl_uct_tl_supports_conn (mca_btl_uct_tl_t *tl)
311 {
312 return (MCA_BTL_UCT_TL_ATTR(tl, 0).cap.flags & (UCT_IFACE_FLAG_AM_SHORT | UCT_IFACE_FLAG_CONNECT_TO_IFACE)) ==
313 (UCT_IFACE_FLAG_AM_SHORT | UCT_IFACE_FLAG_CONNECT_TO_IFACE);
314 }
315
316
317
318
319
320
321 static inline bool mca_btl_uct_tl_requires_connection_tl (mca_btl_uct_tl_t *tl)
322 {
323 return !(MCA_BTL_UCT_TL_ATTR(tl, 0).cap.flags & UCT_IFACE_FLAG_CONNECT_TO_IFACE);
324 }
325
326 END_C_DECLS
327 #endif