44 * reserved.
55 * Copyright (c) 2018 Triad National Security, LLC. All rights
66 * reserved.
7+ * Copyright (c) 2019 Google, LLC. All rights reserved.
78 * $COPYRIGHT$
89 *
910 * Additional copyrights may follow
@@ -101,6 +102,28 @@ static void mca_btl_uct_process_modex (mca_btl_uct_module_t *uct_btl, unsigned c
101102 }
102103}
103104
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+
104127static int mca_btl_uct_endpoint_connect_iface (mca_btl_uct_module_t * uct_btl , mca_btl_uct_tl_t * tl ,
105128 mca_btl_uct_device_context_t * tl_context ,
106129 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
116139 BTL_VERBOSE (("connecting endpoint to interface" ));
117140
118141 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 );
120143 tl_endpoint -> flags = MCA_BTL_UCT_ENDPOINT_FLAG_CONN_READY ;
121144 mca_btl_uct_context_unlock (tl_context );
122145
@@ -240,8 +263,8 @@ static int mca_btl_uct_endpoint_connect_endpoint (mca_btl_uct_module_t *uct_btl,
240263
241264 /* create a temporary endpoint for setting up the rdma endpoint */
242265 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 );
245268 });
246269 if (UCS_OK != ucs_status ) {
247270 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,
263286 opal_process_name_print (endpoint -> ep_proc -> proc_name )));
264287
265288 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 );
267290 });
268291 if (UCS_OK != ucs_status ) {
269292 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
309332 void * ep_addr , int tl_index )
310333{
311334 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 ;
313337 mca_btl_uct_device_context_t * tl_context = mca_btl_uct_module_get_tl_context_specific (uct_btl , tl , context_id );
314338 uint8_t * rdma_tl_data = NULL , * conn_tl_data = NULL , * am_tl_data = NULL , * tl_data ;
315339 mca_btl_uct_connection_ep_t * conn_ep = NULL ;
0 commit comments