This source file includes following definitions.
- mca_btl_uct_endpoint_test_am
- mca_btl_uct_endpoint_check
- mca_btl_uct_endpoint_check_rdma
- mca_btl_uct_endpoint_check_am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef MCA_BTL_UCT_ENDPOINT_H
23 #define MCA_BTL_UCT_ENDPOINT_H
24
25 #include "opal/class/opal_list.h"
26 #include "opal/mca/event/event.h"
27 #include "btl_uct.h"
28
29 BEGIN_C_DECLS
30
31 mca_btl_base_endpoint_t *mca_btl_uct_endpoint_create (opal_proc_t *proc);
32 int mca_btl_uct_endpoint_connect (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint, int ep_index, void *ep_addr, int tl_index);
33
34 static inline int mca_btl_uct_endpoint_test_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
35 mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle)
36 {
37 int tl_index = module->am_tl->tl_index;
38 int ep_index = context->context_id;
39
40 if (OPAL_LIKELY(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & endpoint->uct_eps[ep_index][tl_index].flags)) {
41 *ep_handle = endpoint->uct_eps[ep_index][tl_index].uct_ep;
42 return OPAL_SUCCESS;
43 }
44
45 return OPAL_ERR_NOT_AVAILABLE;
46 }
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 static inline int mca_btl_uct_endpoint_check (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
62 mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle,
63 const int tl_index)
64 {
65 int ep_index = context->context_id;
66 int rc;
67
68 if (OPAL_LIKELY(MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & endpoint->uct_eps[ep_index][tl_index].flags)) {
69 *ep_handle = endpoint->uct_eps[ep_index][tl_index].uct_ep;
70 return OPAL_SUCCESS;
71 }
72
73 rc = mca_btl_uct_endpoint_connect (module, endpoint, ep_index, NULL, tl_index);
74 *ep_handle = endpoint->uct_eps[ep_index][tl_index].uct_ep;
75 BTL_VERBOSE(("mca_btl_uct_endpoint_connect returned %d. context id = %d, flags = 0x%x", rc, ep_index,
76 MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY & endpoint->uct_eps[ep_index][tl_index].flags));
77 return rc;
78 }
79
80 static inline int mca_btl_uct_endpoint_check_rdma (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
81 mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle)
82 {
83 assert (NULL != module->rdma_tl);
84 return mca_btl_uct_endpoint_check (module, endpoint, context, ep_handle, module->rdma_tl->tl_index);
85 }
86
87 static inline int mca_btl_uct_endpoint_check_am (mca_btl_uct_module_t *module, mca_btl_uct_endpoint_t *endpoint,
88 mca_btl_uct_device_context_t *context, uct_ep_h *ep_handle)
89 {
90 assert (NULL != module->am_tl);
91 return mca_btl_uct_endpoint_check (module, endpoint, context, ep_handle, module->am_tl->tl_index);
92 }
93
94 END_C_DECLS
95 #endif