@@ -138,7 +138,8 @@ static int ompi_osc_rdma_fetch_and_op_atomic (ompi_osc_rdma_sync_t *sync, const
138138 mca_btl_base_registration_handle_t * target_handle , ompi_op_t * op , ompi_osc_rdma_request_t * req )
139139{
140140 ompi_osc_rdma_module_t * module = sync -> module ;
141- int32_t atomic_flags = module -> selected_btl -> btl_atomic_flags ;
141+ mca_btl_base_module_t * selected_btl = ompi_osc_rdma_selected_btl (module , peer -> data_btl_index );
142+ int32_t atomic_flags = selected_btl -> btl_atomic_flags ;
142143 int btl_op , flags ;
143144 int64_t origin ;
144145
@@ -160,7 +161,7 @@ static int ompi_osc_rdma_fetch_and_op_atomic (ompi_osc_rdma_sync_t *sync, const
160161
161162 origin = (8 == extent ) ? ((int64_t * ) origin_addr )[0 ] : ((int32_t * ) origin_addr )[0 ];
162163
163- return ompi_osc_rdma_btl_fop (module , peer -> data_endpoint , target_address , target_handle , btl_op , origin , flags ,
164+ return ompi_osc_rdma_btl_fop (module , peer -> data_btl_index , peer -> data_endpoint , target_address , target_handle , btl_op , origin , flags ,
164165 result_addr , true, NULL , NULL , NULL );
165166}
166167
@@ -182,7 +183,7 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
182183
183184 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "initiating fetch-and-op using compare-and-swap" );
184185
185- ret = ompi_osc_get_data_blocking (module , peer -> data_endpoint , address , target_handle , & old_value , 8 );
186+ ret = ompi_osc_get_data_blocking (module , peer -> data_btl_index , peer -> data_endpoint , address , target_handle , & old_value , 8 );
186187 if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
187188 return ret ;
188189 }
@@ -197,7 +198,7 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
197198 ompi_op_reduce (op , (void * ) ((intptr_t ) origin_addr + dt -> super .true_lb ), (void * )((intptr_t ) & new_value + offset ), 1 , dt );
198199 }
199200
200- ret = ompi_osc_rdma_btl_cswap (module , peer -> data_endpoint , address , target_handle ,
201+ ret = ompi_osc_rdma_btl_cswap (module , peer -> data_btl_index , peer -> data_endpoint , address , target_handle ,
201202 old_value , new_value , 0 , (int64_t * )& new_value );
202203 if (OPAL_SUCCESS != ret || new_value == old_value ) {
203204 break ;
@@ -218,11 +219,12 @@ static int ompi_osc_rdma_acc_single_atomic (ompi_osc_rdma_sync_t *sync, const vo
218219 ompi_op_t * op , ompi_osc_rdma_request_t * req )
219220{
220221 ompi_osc_rdma_module_t * module = sync -> module ;
221- int32_t atomic_flags = module -> selected_btl -> btl_atomic_flags ;
222+ mca_btl_base_module_t * selected_btl = ompi_osc_rdma_selected_btl (module , peer -> data_btl_index );
223+ int32_t atomic_flags = selected_btl -> btl_atomic_flags ;
222224 int btl_op , flags ;
223225 int64_t origin ;
224226
225- if (!(module -> selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
227+ if (!(selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
226228 /* btl put atomics not supported or disabled. fall back on fetch-and-op */
227229 return ompi_osc_rdma_fetch_and_op_atomic (sync , origin_addr , NULL , dt , extent , peer , target_address , target_handle ,
228230 op , req );
@@ -248,7 +250,7 @@ static int ompi_osc_rdma_acc_single_atomic (ompi_osc_rdma_sync_t *sync, const vo
248250 * ((int64_t * ) origin_addr ));
249251
250252 /* if we locked the peer its best to wait for completion before returning */
251- return ompi_osc_rdma_btl_op (module , peer -> data_endpoint , target_address , target_handle , btl_op , origin ,
253+ return ompi_osc_rdma_btl_op (module , peer -> data_btl_index , peer -> data_endpoint , target_address , target_handle , btl_op , origin ,
252254 flags , true, NULL , NULL , NULL );
253255}
254256
@@ -359,7 +361,8 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v
359361 /* set up the request */
360362 request -> to_free = ptr ;
361363
362- ret = ompi_osc_get_data_blocking (module , peer -> data_endpoint , target_address , target_handle , ptr , len );
364+ ret = ompi_osc_get_data_blocking (module , peer -> data_btl_index , peer -> data_endpoint ,
365+ target_address , target_handle , ptr , len );
363366 if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
364367 return ret ;
365368 }
@@ -644,7 +647,8 @@ static inline int ompi_osc_rdma_cas_atomic (ompi_osc_rdma_sync_t *sync, const vo
644647 bool lock_acquired )
645648{
646649 ompi_osc_rdma_module_t * module = sync -> module ;
647- int32_t atomic_flags = module -> selected_btl -> btl_atomic_flags ;
650+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , peer -> data_btl_index );
651+ int32_t atomic_flags = btl -> btl_atomic_flags ;
648652 const size_t size = datatype -> super .size ;
649653 int64_t compare , source ;
650654 int flags , ret ;
@@ -660,8 +664,8 @@ static inline int ompi_osc_rdma_cas_atomic (ompi_osc_rdma_sync_t *sync, const vo
660664 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "initiating compare-and-swap using %d-bit btl atomics. compare: 0x%"
661665 PRIx64 ", origin: 0x%" PRIx64 , (int ) size * 8 , * ((int64_t * ) compare_addr ), * ((int64_t * ) source_addr ));
662666
663- ret = ompi_osc_rdma_btl_cswap (module , peer -> data_endpoint , target_address , target_handle , compare , source , flags ,
664- result_addr );
667+ ret = ompi_osc_rdma_btl_cswap (module , peer -> data_btl_index , peer -> data_endpoint , target_address , target_handle ,
668+ compare , source , flags , result_addr );
665669 if (OPAL_LIKELY (OMPI_SUCCESS == ret )) {
666670 ompi_osc_rdma_peer_accumulate_cleanup (module , peer , lock_acquired );
667671 }
@@ -696,6 +700,7 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
696700 mca_btl_base_registration_handle_t * target_handle , bool lock_acquired )
697701{
698702 ompi_osc_rdma_module_t * module = sync -> module ;
703+ mca_btl_base_module_t * btl = ompi_osc_rdma_selected_btl (module , peer -> data_btl_index );
699704 unsigned long len = datatype -> super .size ;
700705 mca_btl_base_registration_handle_t * local_handle = NULL ;
701706 ompi_osc_rdma_frag_t * frag = NULL ;
@@ -708,7 +713,8 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
708713 ", sync %p" , len , target_address , (void * ) sync );
709714
710715 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "RDMA compare-and-swap initiating blocking btl get..." );
711- ret = ompi_osc_get_data_blocking (module , peer -> data_endpoint , target_address , target_handle , result_addr , len );
716+ ret = ompi_osc_get_data_blocking (module , peer -> data_btl_index , peer -> data_endpoint , target_address ,
717+ target_handle , result_addr , len );
712718 if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
713719 return ret ;
714720 }
@@ -719,7 +725,7 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
719725 return OMPI_SUCCESS ;
720726 }
721727
722- if (module -> selected_btl -> btl_register_mem && len > module -> selected_btl -> btl_put_local_registration_threshold ) {
728+ if (btl -> btl_register_mem && len > btl -> btl_put_local_registration_threshold ) {
723729 do {
724730 ret = ompi_osc_rdma_frag_alloc (module , len , & frag , & ptr );
725731 if (OPAL_UNLIKELY (OMPI_SUCCESS == ret )) {
@@ -736,9 +742,9 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
736742 OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "RDMA compare-and-swap initiating blocking btl put..." );
737743
738744 do {
739- ret = module -> selected_btl -> btl_put (module -> selected_btl , peer -> data_endpoint , ptr , target_address ,
740- local_handle , target_handle , len , 0 , MCA_BTL_NO_ORDER ,
741- ompi_osc_rdma_cas_put_complete , (void * ) & complete , NULL );
745+ ret = btl -> btl_put (btl , peer -> data_endpoint , ptr , target_address ,
746+ local_handle , target_handle , len , 0 , MCA_BTL_NO_ORDER ,
747+ ompi_osc_rdma_cas_put_complete , (void * ) & complete , NULL );
742748 if (OPAL_SUCCESS == ret || (OPAL_ERR_OUT_OF_RESOURCE != ret && OPAL_ERR_TEMP_OUT_OF_RESOURCE != ret )) {
743749 break ;
744750 }
0 commit comments