@@ -138,7 +138,8 @@ static int ompi_osc_rdma_fetch_and_op_atomic (ompi_osc_rdma_sync_t *sync, const
138
138
mca_btl_base_registration_handle_t * target_handle , ompi_op_t * op , ompi_osc_rdma_request_t * req )
139
139
{
140
140
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 ;
142
143
int btl_op , flags ;
143
144
int64_t origin ;
144
145
@@ -160,7 +161,7 @@ static int ompi_osc_rdma_fetch_and_op_atomic (ompi_osc_rdma_sync_t *sync, const
160
161
161
162
origin = (8 == extent ) ? ((int64_t * ) origin_addr )[0 ] : ((int32_t * ) origin_addr )[0 ];
162
163
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 ,
164
165
result_addr , true, NULL , NULL , NULL );
165
166
}
166
167
@@ -182,7 +183,7 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
182
183
183
184
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "initiating fetch-and-op using compare-and-swap" );
184
185
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 );
186
187
if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
187
188
return ret ;
188
189
}
@@ -197,7 +198,7 @@ static int ompi_osc_rdma_fetch_and_op_cas (ompi_osc_rdma_sync_t *sync, const voi
197
198
ompi_op_reduce (op , (void * ) ((intptr_t ) origin_addr + dt -> super .true_lb ), (void * )((intptr_t ) & new_value + offset ), 1 , dt );
198
199
}
199
200
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 ,
201
202
old_value , new_value , 0 , (int64_t * )& new_value );
202
203
if (OPAL_SUCCESS != ret || new_value == old_value ) {
203
204
break ;
@@ -218,11 +219,12 @@ static int ompi_osc_rdma_acc_single_atomic (ompi_osc_rdma_sync_t *sync, const vo
218
219
ompi_op_t * op , ompi_osc_rdma_request_t * req )
219
220
{
220
221
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 ;
222
224
int btl_op , flags ;
223
225
int64_t origin ;
224
226
225
- if (!(module -> selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
227
+ if (!(selected_btl -> btl_flags & MCA_BTL_FLAGS_ATOMIC_OPS )) {
226
228
/* btl put atomics not supported or disabled. fall back on fetch-and-op */
227
229
return ompi_osc_rdma_fetch_and_op_atomic (sync , origin_addr , NULL , dt , extent , peer , target_address , target_handle ,
228
230
op , req );
@@ -248,7 +250,7 @@ static int ompi_osc_rdma_acc_single_atomic (ompi_osc_rdma_sync_t *sync, const vo
248
250
* ((int64_t * ) origin_addr ));
249
251
250
252
/* 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 ,
252
254
flags , true, NULL , NULL , NULL );
253
255
}
254
256
@@ -359,7 +361,8 @@ static inline int ompi_osc_rdma_gacc_contig (ompi_osc_rdma_sync_t *sync, const v
359
361
/* set up the request */
360
362
request -> to_free = ptr ;
361
363
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 );
363
366
if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
364
367
return ret ;
365
368
}
@@ -644,7 +647,8 @@ static inline int ompi_osc_rdma_cas_atomic (ompi_osc_rdma_sync_t *sync, const vo
644
647
bool lock_acquired )
645
648
{
646
649
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 ;
648
652
const size_t size = datatype -> super .size ;
649
653
int64_t compare , source ;
650
654
int flags , ret ;
@@ -660,8 +664,8 @@ static inline int ompi_osc_rdma_cas_atomic (ompi_osc_rdma_sync_t *sync, const vo
660
664
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "initiating compare-and-swap using %d-bit btl atomics. compare: 0x%"
661
665
PRIx64 ", origin: 0x%" PRIx64 , (int ) size * 8 , * ((int64_t * ) compare_addr ), * ((int64_t * ) source_addr ));
662
666
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 );
665
669
if (OPAL_LIKELY (OMPI_SUCCESS == ret )) {
666
670
ompi_osc_rdma_peer_accumulate_cleanup (module , peer , lock_acquired );
667
671
}
@@ -696,6 +700,7 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
696
700
mca_btl_base_registration_handle_t * target_handle , bool lock_acquired )
697
701
{
698
702
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 );
699
704
unsigned long len = datatype -> super .size ;
700
705
mca_btl_base_registration_handle_t * local_handle = NULL ;
701
706
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,
708
713
", sync %p" , len , target_address , (void * ) sync );
709
714
710
715
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 );
712
718
if (OPAL_UNLIKELY (OMPI_SUCCESS != ret )) {
713
719
return ret ;
714
720
}
@@ -719,7 +725,7 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr,
719
725
return OMPI_SUCCESS ;
720
726
}
721
727
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 ) {
723
729
do {
724
730
ret = ompi_osc_rdma_frag_alloc (module , len , & frag , & ptr );
725
731
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,
736
742
OSC_RDMA_VERBOSE (MCA_BASE_VERBOSE_TRACE , "RDMA compare-and-swap initiating blocking btl put..." );
737
743
738
744
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 );
742
748
if (OPAL_SUCCESS == ret || (OPAL_ERR_OUT_OF_RESOURCE != ret && OPAL_ERR_TEMP_OUT_OF_RESOURCE != ret )) {
743
749
break ;
744
750
}
0 commit comments