@@ -586,7 +586,6 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
586586
587587 if (size && MPI_WIN_FLAVOR_ALLOCATE == module -> flavor ) {
588588 * base = (void * )((intptr_t ) module -> segment_base + my_base_offset );
589- memset (* base , 0 , size );
590589 }
591590
592591 module -> rank_array = (ompi_osc_rdma_rank_data_t * ) module -> segment_base ;
@@ -600,12 +599,7 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
600599 /* initialize my state */
601600 memset (module -> state , 0 , module -> state_size );
602601
603- /* barrier to make sure all ranks have attached and initialized */
604- shared_comm -> c_coll -> coll_barrier (shared_comm , shared_comm -> c_coll -> coll_barrier_module );
605-
606602 if (0 == local_rank ) {
607- /* unlink the shared memory backing file */
608- opal_shmem_unlink (& module -> seg_ds );
609603 /* just go ahead and register the whole segment */
610604 ret = ompi_osc_rdma_register (module , MCA_BTL_ENDPOINT_ANY , module -> segment_base , total_size , MCA_BTL_REG_FLAG_ACCESS_ANY ,
611605 & module -> state_handle );
@@ -626,6 +620,14 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
626620 }
627621 }
628622
623+ /* barrier to make sure all ranks have attached */
624+ shared_comm -> c_coll -> coll_barrier (shared_comm , shared_comm -> c_coll -> coll_barrier_module );
625+
626+ /* unlink the shared memory backing file */
627+ if (0 == local_rank ) {
628+ opal_shmem_unlink (& module -> seg_ds );
629+ }
630+
629631 if (MPI_WIN_FLAVOR_ALLOCATE == module -> flavor ) {
630632 ompi_osc_rdma_region_t * region = (ompi_osc_rdma_region_t * ) module -> state -> regions ;
631633 module -> state -> disp_unit = module -> disp_unit ;
0 commit comments