4
4
* reserved.
5
5
* Copyright (c) 2018 Triad National Security, LLC. All rights
6
6
* reserved.
7
+ * Copyright (c) 2019 Google, LLC. All rights reserved.
7
8
* $COPYRIGHT$
8
9
*
9
10
* Additional copyrights may follow
@@ -101,6 +102,28 @@ static void mca_btl_uct_process_modex (mca_btl_uct_module_t *uct_btl, unsigned c
101
102
}
102
103
}
103
104
105
+ static inline ucs_status_t mca_btl_uct_ep_create_connected_compat (uct_iface_h iface , uct_device_addr_t * device_addr ,
106
+ uct_iface_addr_t * iface_addr , uct_ep_h * uct_ep )
107
+ {
108
+ #if UCT_API >= UCT_VERSION (1 , 6 )
109
+ uct_ep_params_t ep_params = {.field_mask = UCT_EP_PARAM_FIELD_IFACE | UCT_EP_PARAM_FIELD_DEV_ADDR | UCT_EP_PARAM_FIELD_IFACE_ADDR ,
110
+ .iface = iface , .dev_addr = device_addr , .iface_addr = iface_addr };
111
+ return uct_ep_create (& ep_params , uct_ep );
112
+ #else
113
+ return uct_ep_create_connected (iface , device_addr , iface_addr , uct_ep );
114
+ #endif
115
+ }
116
+
117
+ static inline ucs_status_t mca_btl_uct_ep_create_compat (uct_iface_h iface , uct_ep_h * uct_ep )
118
+ {
119
+ #if UCT_API >= UCT_VERSION (1 , 6 )
120
+ uct_ep_params_t ep_params = {.field_mask = UCT_EP_PARAM_FIELD_IFACE , .iface = iface };
121
+ return uct_ep_create (& ep_params , uct_ep );
122
+ #else
123
+ return uct_ep_create (iface , uct_ep );
124
+ #endif
125
+ }
126
+
104
127
static int mca_btl_uct_endpoint_connect_iface (mca_btl_uct_module_t * uct_btl , mca_btl_uct_tl_t * tl ,
105
128
mca_btl_uct_device_context_t * tl_context ,
106
129
mca_btl_uct_tl_endpoint_t * tl_endpoint , uint8_t * tl_data )
@@ -116,7 +139,7 @@ static int mca_btl_uct_endpoint_connect_iface (mca_btl_uct_module_t *uct_btl, mc
116
139
BTL_VERBOSE (("connecting endpoint to interface" ));
117
140
118
141
mca_btl_uct_context_lock (tl_context );
119
- ucs_status = uct_ep_create_connected (tl_context -> uct_iface , device_addr , iface_addr , & tl_endpoint -> uct_ep );
142
+ ucs_status = mca_btl_uct_ep_create_connected_compat (tl_context -> uct_iface , device_addr , iface_addr , & tl_endpoint -> uct_ep );
120
143
tl_endpoint -> flags = MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY ;
121
144
mca_btl_uct_context_unlock (tl_context );
122
145
@@ -240,8 +263,8 @@ static int mca_btl_uct_endpoint_connect_endpoint (mca_btl_uct_module_t *uct_btl,
240
263
241
264
/* create a temporary endpoint for setting up the rdma endpoint */
242
265
MCA_BTL_UCT_CONTEXT_SERIALIZE (conn_tl_context , {
243
- ucs_status = uct_ep_create_connected (conn_tl_context -> uct_iface , device_addr , iface_addr ,
244
- & conn_ep -> uct_ep );
266
+ ucs_status = mca_btl_uct_ep_create_connected_compat (conn_tl_context -> uct_iface , device_addr , iface_addr ,
267
+ & conn_ep -> uct_ep );
245
268
});
246
269
if (UCS_OK != ucs_status ) {
247
270
BTL_VERBOSE (("could not create an endpoint for forming connection to remote peer. code = %d" ,
@@ -263,7 +286,7 @@ static int mca_btl_uct_endpoint_connect_endpoint (mca_btl_uct_module_t *uct_btl,
263
286
opal_process_name_print (endpoint -> ep_proc -> proc_name )));
264
287
265
288
MCA_BTL_UCT_CONTEXT_SERIALIZE (tl_context , {
266
- ucs_status = uct_ep_create (tl_context -> uct_iface , & tl_endpoint -> uct_ep );
289
+ ucs_status = mca_btl_uct_ep_create_compat (tl_context -> uct_iface , & tl_endpoint -> uct_ep );
267
290
});
268
291
if (UCS_OK != ucs_status ) {
269
292
OBJ_RELEASE (endpoint -> conn_ep );
@@ -309,7 +332,8 @@ int mca_btl_uct_endpoint_connect (mca_btl_uct_module_t *uct_btl, mca_btl_uct_end
309
332
void * ep_addr , int tl_index )
310
333
{
311
334
mca_btl_uct_tl_endpoint_t * tl_endpoint = endpoint -> uct_eps [context_id ] + tl_index ;
312
- mca_btl_uct_tl_t * tl = (tl_index == uct_btl -> rdma_tl -> tl_index ) ? uct_btl -> rdma_tl : uct_btl -> am_tl ;
335
+ mca_btl_uct_tl_t * tl = (uct_btl -> rdma_tl && tl_index == uct_btl -> rdma_tl -> tl_index ) ?
336
+ uct_btl -> rdma_tl : uct_btl -> am_tl ;
313
337
mca_btl_uct_device_context_t * tl_context = mca_btl_uct_module_get_tl_context_specific (uct_btl , tl , context_id );
314
338
uint8_t * rdma_tl_data = NULL , * conn_tl_data = NULL , * am_tl_data = NULL , * tl_data ;
315
339
mca_btl_uct_connection_ep_t * conn_ep = NULL ;
0 commit comments