@@ -61,11 +61,11 @@ static uint64_t mca_btl_uct_cap_to_btl_atomic_flag[][2] = {
6161
6262static void mca_btl_uct_module_set_atomic_flags (mca_btl_uct_module_t * module , mca_btl_uct_tl_t * tl )
6363{
64- uint64_t cap_flags = tl -> uct_iface_attr .cap .flags ;
64+ uint64_t cap_flags = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .flags ;
6565
6666 /* NTH: only use the fetching atomics for now */
67- uint64_t atomic_flags32 = tl -> uct_iface_attr .cap .atomic32 .fop_flags ;
68- uint64_t atomic_flags64 = tl -> uct_iface_attr .cap .atomic64 .fop_flags ;
67+ uint64_t atomic_flags32 = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .atomic32 .fop_flags ;
68+ uint64_t atomic_flags64 = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .atomic64 .fop_flags ;
6969
7070 /* NTH: don't really have a way to seperate 32-bit and 64-bit right now */
7171 uint64_t all_flags = atomic_flags32 & atomic_flags64 ;
@@ -110,7 +110,7 @@ static uint64_t mca_btl_uct_cap_to_btl_atomic_flag[][2] = {
110110 */
111111static void mca_btl_uct_module_set_atomic_flags (mca_btl_uct_module_t * module , mca_btl_uct_tl_t * tl )
112112{
113- uint64_t cap_flags = tl -> uct_iface_attr .cap .flags ;
113+ uint64_t cap_flags = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .flags ;
114114
115115 module -> super .btl_atomic_flags = 0 ;
116116
@@ -299,9 +299,16 @@ mca_btl_uct_device_context_t *mca_btl_uct_context_create (mca_btl_uct_module_t *
299299 return NULL ;
300300 }
301301
302- BTL_VERBOSE (("enabling progress for tl %p context id %d" , (void * ) tl , context_id ));
302+ /* only need to query one of the interfaces to get the attributes */
303+ ucs_status = uct_iface_query (context -> uct_iface , & context -> uct_iface_attr );
304+ if (UCS_OK != ucs_status ) {
305+ BTL_VERBOSE (("Error querying UCT interface" ));
306+ mca_btl_uct_context_destroy (context );
307+ return NULL ;
308+ }
303309
304310 if (enable_progress ) {
311+ BTL_VERBOSE (("enabling progress for tl %p context id %d" , (void * ) tl , context_id ));
305312 mca_btl_uct_context_enable_progress (context );
306313 }
307314
@@ -372,15 +379,8 @@ static mca_btl_uct_tl_t *mca_btl_uct_create_tl (mca_btl_uct_module_t *module, mc
372379 return NULL ;
373380 }
374381
375- /* only need to query one of the interfaces to get the attributes */
376- ucs_status = uct_iface_query (tl -> uct_dev_contexts [0 ]-> uct_iface , & tl -> uct_iface_attr );
377- if (UCS_OK != ucs_status ) {
378- BTL_VERBOSE (("Error querying UCT interface" ));
379- OBJ_RELEASE (tl );
380- return NULL ;
381- }
382-
383- BTL_VERBOSE (("Interface CAPS for tl %s::%s: 0x%lx" , module -> md_name , tl_desc -> tl_name , (unsigned long ) tl -> uct_iface_attr .cap .flags ));
382+ BTL_VERBOSE (("Interface CAPS for tl %s::%s: 0x%lx" , module -> md_name , tl_desc -> tl_name ,
383+ (unsigned long ) MCA_BTL_UCT_TL_ATTR (tl , 0 ).cap .flags ));
384384
385385 return tl ;
386386}
@@ -391,20 +391,20 @@ static void mca_btl_uct_set_tl_rdma (mca_btl_uct_module_t *module, mca_btl_uct_t
391391
392392 mca_btl_uct_module_set_atomic_flags (module , tl );
393393
394- module -> super .btl_get_limit = tl -> uct_iface_attr .cap .get .max_zcopy ;
395- if (tl -> uct_iface_attr .cap .get .max_bcopy ) {
394+ module -> super .btl_get_limit = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .get .max_zcopy ;
395+ if (MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .get .max_bcopy ) {
396396 module -> super .btl_get_alignment = 0 ;
397- module -> super .btl_get_local_registration_threshold = tl -> uct_iface_attr .cap .get .max_bcopy ;
397+ module -> super .btl_get_local_registration_threshold = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .get .max_bcopy ;
398398 } else {
399399 /* this is overkill in terms of alignment but we have no way to enforce a minimum get size */
400- module -> super .btl_get_alignment = opal_next_poweroftwo_inclusive (tl -> uct_iface_attr .cap .get .min_zcopy );
400+ module -> super .btl_get_alignment = opal_next_poweroftwo_inclusive (MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .get .min_zcopy );
401401 }
402402
403- module -> super .btl_put_limit = tl -> uct_iface_attr .cap .put .max_zcopy ;
403+ module -> super .btl_put_limit = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .put .max_zcopy ;
404404 module -> super .btl_put_alignment = 0 ;
405405
406406 /* no registration needed when using short/bcopy put */
407- module -> super .btl_put_local_registration_threshold = tl -> uct_iface_attr .cap .put .max_bcopy ;
407+ module -> super .btl_put_local_registration_threshold = MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .put .max_bcopy ;
408408
409409 module -> rdma_tl = tl ;
410410 OBJ_RETAIN (tl );
@@ -480,14 +480,14 @@ static int mca_btl_uct_evaluate_tl (mca_btl_uct_module_t *module, mca_btl_uct_tl
480480 }
481481
482482 if (tl == module -> rdma_tl || tl == module -> am_tl ) {
483- BTL_VERBOSE (("tl has flags 0x%" PRIx64 , tl -> uct_iface_attr .cap .flags ));
484- module -> super .btl_flags |= mca_btl_uct_module_flags (tl -> uct_iface_attr .cap .flags );
483+ BTL_VERBOSE (("tl has flags 0x%" PRIx64 , MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .flags ));
484+ module -> super .btl_flags |= mca_btl_uct_module_flags (MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .cap .flags );
485485
486486 /* the bandwidth and latency numbers relate to both rdma and active messages. need to
487487 * come up with a better estimate. */
488488
489489 /* UCT bandwidth is in bytes/sec, BTL is in MB/sec */
490- module -> super .btl_bandwidth = (uint32_t ) (tl -> uct_iface_attr .bandwidth / 1048576.0 );
490+ module -> super .btl_bandwidth = (uint32_t ) (MCA_BTL_UCT_TL_ATTR ( tl , 0 ) .bandwidth / 1048576.0 );
491491 /* TODO -- figure out how to translate UCT latency to us */
492492 module -> super .btl_latency = 1 ;
493493 }
0 commit comments