@@ -647,7 +647,6 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
647647
648648 if (size && MPI_WIN_FLAVOR_ALLOCATE == module -> flavor ) {
649649 * base = (void * )((intptr_t ) module -> segment_base + my_base_offset );
650- memset (* base , 0 , size );
651650 }
652651
653652 module -> rank_array = (ompi_osc_rdma_rank_data_t * ) module -> segment_base ;
@@ -661,12 +660,7 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
661660 /* initialize my state */
662661 memset (module -> state , 0 , module -> state_size );
663662
664- /* barrier to make sure all ranks have attached and initialized */
665- shared_comm -> c_coll -> coll_barrier (shared_comm , shared_comm -> c_coll -> coll_barrier_module );
666-
667663 if (0 == local_rank ) {
668- /* unlink the shared memory backing file */
669- opal_shmem_unlink (& module -> seg_ds );
670664 /* just go ahead and register the whole segment */
671665 ret = ompi_osc_rdma_register (module , MCA_BTL_ENDPOINT_ANY , module -> segment_base , total_size , MCA_BTL_REG_FLAG_ACCESS_ANY ,
672666 & module -> state_handle );
@@ -687,6 +681,14 @@ static int allocate_state_shared (ompi_osc_rdma_module_t *module, void **base, s
687681 }
688682 }
689683
684+ /* barrier to make sure all ranks have attached */
685+ shared_comm -> c_coll -> coll_barrier (shared_comm , shared_comm -> c_coll -> coll_barrier_module );
686+
687+ /* unlink the shared memory backing file */
688+ if (0 == local_rank ) {
689+ opal_shmem_unlink (& module -> seg_ds );
690+ }
691+
690692 if (MPI_WIN_FLAVOR_ALLOCATE == module -> flavor ) {
691693 ompi_osc_rdma_region_t * region = (ompi_osc_rdma_region_t * ) module -> state -> regions ;
692694 module -> state -> disp_unit = module -> disp_unit ;
0 commit comments