Commit f02eed5b authored by Pavan Balaji's avatar Pavan Balaji Committed by Xin Zhao
Browse files

Only create shared memory when more than one process exists.

If there is only one process on the node in the particular
communicator, we don't need to allocate any shared memory for it.  In
this case, we simply call the non-shared-memory functions for
Win_allocate and free.
Signed-off-by: default avatarXin Zhao <>
parent 3e62375a
......@@ -67,6 +67,11 @@ int MPIDI_CH3_SHM_Win_free(MPID_Win **win_ptr)
if ((*win_ptr)->comm_ptr->node_comm == NULL) {
mpi_errno = MPIDI_Win_free(win_ptr);
goto fn_exit;
mpi_errno = MPIDI_CH3I_Wait_for_pt_ops_finish(*win_ptr);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
......@@ -62,6 +62,11 @@ static int MPIDI_CH3I_Win_allocate_shm(MPI_Aint size, int disp_unit, MPID_Info *
if ((*win_ptr)->comm_ptr->node_comm == NULL) {
mpi_errno = MPIDI_CH3U_Win_allocate_no_shm(size, disp_unit, info, comm_ptr, base_ptr, win_ptr);
goto fn_exit;
/* If create flavor is MPI_WIN_FLAVOR_ALLOCATE, alloc_shared_noncontig is set to 1 by default. */
if ((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_ALLOCATE)
(*win_ptr)->info_args.alloc_shared_noncontig = 1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment