1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 #ifndef MCA_BTL_OFI_ENDPOINT_H
24 #define MCA_BTL_OFI_ENDPOINT_H
25
26 #include "opal/class/opal_list.h"
27 #include "opal/mca/event/event.h"
28
29 #include "btl_ofi.h"
30
31 BEGIN_C_DECLS
32
33 #if OPAL_HAVE_THREAD_LOCAL
34 extern opal_thread_local mca_btl_ofi_context_t *my_context;
35 #endif
36
37 struct mca_btl_base_endpoint_t {
38 opal_list_item_t super;
39
40 struct fid_ep *ofi_endpoint;
41 fi_addr_t peer_addr;
42
43
44 opal_proc_t *ep_proc;
45
46
47 opal_mutex_t ep_lock;
48 };
49
50 typedef struct mca_btl_base_endpoint_t mca_btl_base_endpoint_t;
51 typedef mca_btl_base_endpoint_t mca_btl_ofi_endpoint_t;
52 OBJ_CLASS_DECLARATION(mca_btl_ofi_endpoint_t);
53
54 int init_context_freelists(mca_btl_ofi_context_t *context);
55
56 mca_btl_base_endpoint_t *mca_btl_ofi_endpoint_create (opal_proc_t *proc, struct fid_ep *ep);
57
58
59 mca_btl_ofi_context_t *mca_btl_ofi_context_alloc_scalable(struct fi_info *info,
60 struct fid_domain *domain,
61 struct fid_ep *sep,
62 struct fid_av *av,
63 size_t num_contexts);
64
65 mca_btl_ofi_context_t *mca_btl_ofi_context_alloc_normal(struct fi_info *info,
66 struct fid_domain *domain,
67 struct fid_ep *ep,
68 struct fid_av *av);
69 void mca_btl_ofi_context_finalize(mca_btl_ofi_context_t *context, bool scalable_ep);
70
71 mca_btl_ofi_context_t *get_ofi_context(mca_btl_ofi_module_t *btl);
72 mca_btl_ofi_context_t *get_ofi_context_rr(mca_btl_ofi_module_t *btl);
73
74 END_C_DECLS
75 #endif