@@ -266,7 +266,7 @@ static int ompi_osc_rdma_component_register (void)
266266 MCA_BASE_VAR_SCOPE_GROUP , & ompi_osc_rdma_btl_names );
267267 free (description_str );
268268
269- ompi_osc_rdma_btl_alternate_names = "sm,self, tcp" ;
269+ ompi_osc_rdma_btl_alternate_names = "sm,tcp" ;
270270 opal_asprintf (& description_str , "Comma-delimited list of alternate BTL component names to allow without verifying "
271271 "connectivity (default: %s)" , ompi_osc_rdma_btl_alternate_names );
272272 (void ) mca_base_component_var_register (& mca_osc_rdma_component .super .osc_version , "alternate_btls" , description_str ,
@@ -521,7 +521,7 @@ static int allocate_state_single (ompi_osc_rdma_module_t *module, void **base, s
521521 my_peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_BASE ;
522522 my_peer -> state = (uint64_t ) (uintptr_t ) module -> state ;
523523
524- if (module -> use_cpu_atomics ) {
524+ if (module -> use_cpu_atomics || my_peer -> rank == my_rank ) {
525525 /* all peers are local or it is safe to mix cpu and nic atomics */
526526 my_peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_STATE ;
527527 } else {
@@ -596,7 +596,7 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
596596
597597 if (!module -> single_node ) {
598598 for (int i = 0 ; i < module -> btls_in_use ; ++ i ) {
599- module -> use_cpu_atomics = module -> use_cpu_atomics && !!(module -> selected_btls [i ]-> btl_flags & MCA_BTL_ATOMIC_SUPPORTS_GLOB );
599+ module -> use_cpu_atomics = module -> use_cpu_atomics && !!(module -> selected_btls [i ]-> btl_atomic_flags & MCA_BTL_ATOMIC_SUPPORTS_GLOB );
600600 }
601601 }
602602
@@ -776,7 +776,7 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
776776 ex_peer = (ompi_osc_rdma_peer_extended_t * ) peer ;
777777
778778 /* set up peer state */
779- if (module -> use_cpu_atomics ) {
779+ if (module -> use_cpu_atomics || peer -> rank == my_rank ) {
780780 /* all peers are local or it is safe to mix cpu and nic atomics */
781781 peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_STATE ;
782782 peer -> state = (osc_rdma_counter_t ) peer_state ;
@@ -805,7 +805,7 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
805805 ompi_osc_module_add_peer (module , peer );
806806
807807 if (MPI_WIN_FLAVOR_DYNAMIC == module -> flavor ) {
808- if (module -> use_cpu_atomics && peer_rank == my_rank ) {
808+ if (peer_rank == my_rank ) {
809809 peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_BASE ;
810810 }
811811 /* nothing more to do */
@@ -821,15 +821,14 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
821821 ex_peer -> size = temp [i ].size ;
822822 }
823823
824- if (module -> use_cpu_atomics && (MPI_WIN_FLAVOR_ALLOCATE == module -> flavor || peer_rank == my_rank )) {
824+ if (module -> use_cpu_atomics && (MPI_WIN_FLAVOR_ALLOCATE == module -> flavor )) {
825825 /* base is local and cpu atomics are available */
826826 if (MPI_WIN_FLAVOR_ALLOCATE == module -> flavor ) {
827827 ex_peer -> super .base = (uintptr_t ) module -> segment_base + offset ;
828828 } else {
829829 ex_peer -> super .base = (uintptr_t ) * base ;
830830 }
831831
832- peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_BASE ;
833832 offset += temp [i ].size ;
834833 } else {
835834 ex_peer -> super .base = peer_region -> base ;
@@ -838,6 +837,10 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
838837 ex_peer -> super .base_handle = (mca_btl_base_registration_handle_t * ) peer_region -> btl_handle_data ;
839838 }
840839 }
840+
841+ if (my_rank == peer_rank ) {
842+ peer -> flags |= OMPI_OSC_RDMA_PEER_LOCAL_BASE ;
843+ }
841844 }
842845 } while (0 );
843846
0 commit comments