diff --git a/src/mpid/ch4/shm/posix/globals.c b/src/mpid/ch4/shm/posix/globals.c index c370d66f554..0937a22d309 100644 --- a/src/mpid/ch4/shm/posix/globals.c +++ b/src/mpid/ch4/shm/posix/globals.c @@ -11,3 +11,4 @@ MPIDI_POSIX_global_t MPIDI_POSIX_global = { 0 }; MPIDI_POSIX_eager_funcs_t *MPIDI_POSIX_eager_func = NULL; MPL_atomic_uint64_t *MPIDI_POSIX_shm_limit_counter = NULL; +MPL_atomic_uint64_t MPIDI_POSIX_global_shm_ptr; diff --git a/src/mpid/ch4/shm/posix/posix_init.c b/src/mpid/ch4/shm/posix/posix_init.c index 91e98d85cf3..551b0c30465 100644 --- a/src/mpid/ch4/shm/posix/posix_init.c +++ b/src/mpid/ch4/shm/posix/posix_init.c @@ -40,6 +40,7 @@ #include "mpidu_genq.h" extern MPL_atomic_uint64_t *MPIDI_POSIX_shm_limit_counter; +extern MPL_atomic_uint64_t MPIDI_POSIX_global_shm_ptr; static int choose_posix_eager(void); static void *host_alloc(uintptr_t size); @@ -235,14 +236,7 @@ int MPIDI_POSIX_coll_init(int rank, int size) } MPIR_ERR_CHECK(mpi_errno); - /* Actually allocate the segment and assign regions to the pointers */ - mpi_errno = MPIDU_Init_shm_alloc(sizeof(int), &MPIDI_POSIX_global.shm_ptr); - MPIR_ERR_CHECK(mpi_errno); - - MPIDI_POSIX_shm_limit_counter = (MPL_atomic_uint64_t *) MPIDI_POSIX_global.shm_ptr; - - mpi_errno = MPIDU_Init_shm_barrier(); - MPIR_ERR_CHECK(mpi_errno); + MPIDI_POSIX_shm_limit_counter = &MPIDI_POSIX_global_shm_ptr; /* Set the counter to 0 */ MPL_atomic_relaxed_store_uint64(MPIDI_POSIX_shm_limit_counter, 0); @@ -261,10 +255,6 @@ int MPIDI_POSIX_coll_finalize(void) MPIR_FUNC_VERBOSE_STATE_DECL(MPID_STATE_MPIDI_POSIX_COLL_FINALIZE); MPIR_FUNC_VERBOSE_ENTER(MPID_STATE_MPIDI_POSIX_COLL_FINALIZE); - /* Destroy the shared counter which was used to track the amount of shared memory created - * per node for intra-node collectives */ - mpi_errno = MPIDU_Init_shm_free(MPIDI_POSIX_global.shm_ptr); - if (MPIDI_global.shm.posix.csel_root) { mpi_errno = MPIR_Csel_free(MPIDI_global.shm.posix.csel_root); MPIR_ERR_CHECK(mpi_errno); diff --git a/src/mpid/ch4/shm/posix/posix_types.h b/src/mpid/ch4/shm/posix/posix_types.h index 2cccb493726..7afd5fabc1d 100644 --- a/src/mpid/ch4/shm/posix/posix_types.h +++ b/src/mpid/ch4/shm/posix/posix_types.h @@ -34,8 +34,6 @@ typedef struct { /* Active recv requests array */ MPIR_Request **active_rreq; - void *shm_ptr; - /* Keep track of all of the local processes in MPI_COMM_WORLD and what their original rank was * in that communicator. */ int num_local;