This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via 833f2e3e92c48a25b961ec2c8ebf9b9ca4931ea5 (commit) via 242a9356db9389b1c2a310e58b9ca411214c37c7 (commit) via 231b2ce59ecaea86bb7cf1ca926e1bcaed92a717 (commit) via d0927f698a4ada598937d84141348d8f31dc71f1 (commit) via 2d1616687c5ca9e22146feb0196c148f3819f23b (commit) via 8f1b4bd29e5b4cc4a70ea3dd2f79ed5680f1135a (commit) from 441d189a37b158c44abeb84c4fd7c505402cfe96 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/833f2e3e92c48a25b961ec2c8ebf9b9ca4... commit 833f2e3e92c48a25b961ec2c8ebf9b9ca4931ea5 Author: Xin Zhao <[email protected]> Date: Thu Sep 26 15:00:01 2013 -0500 fix bug:pass info to win_allocate and free info. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/test/mpi/rma/mcs-mutex.c b/test/mpi/rma/mcs-mutex.c index 0ef0b9e..52a3bbf 100644 --- a/test/mpi/rma/mcs-mutex.c +++ b/test/mpi/rma/mcs-mutex.c @@ -45,14 +45,12 @@ int MCS_Mutex_create(int tail_rank, MPI_Comm comm, MCS_Mutex * hdl_out) #ifdef USE_WIN_ALLOC_SHM MPI_Info_create(&hdl->win_info); MPI_Info_set(hdl->win_info, "alloc_shm", "true"); - MPI_Win_allocate(2*sizeof(int), sizeof(int), hdl->win_info, hdl->comm, - &hdl->base, &hdl->window); #else MPI_Info_create(&hdl->win_info); MPI_Info_set(hdl->win_info, "alloc_shm", "false"); - MPI_Win_allocate(2*sizeof(int), sizeof(int), MPI_INFO_NULL, hdl->comm, - &hdl->base, &hdl->window); #endif + MPI_Win_allocate(2*sizeof(int), sizeof(int), hdl->win_info, hdl->comm, + &hdl->base, &hdl->window); #endif MPI_Win_lock_all(0, hdl->window); @@ -82,7 +80,7 @@ int MCS_Mutex_free(MCS_Mutex * hdl_ptr) MPI_Win_free(&hdl->window); MPI_Comm_free(&hdl->comm); -#ifdef USE_WIN_ALLOC_SHM +#ifndef USE_WIN_SHARED MPI_Info_free(&hdl->win_info); #endif http://git.mpich.org/mpich.git/commitdiff/242a9356db9389b1c2a310e58b9ca41121... commit 242a9356db9389b1c2a310e58b9ca411214c37c7 Author: Pavan Balaji <[email protected]> Date: Thu Sep 26 01:59:11 2013 -0500 Do a memory barrier at the end of a flushall. The memory barrier ensures that all load/store operations issued directly to shared memory are complete. Signed-off-by: Xin Zhao <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c index 47487d2..c457350 100644 --- a/src/mpid/ch3/src/ch3u_rma_sync.c +++ b/src/mpid/ch3/src/ch3u_rma_sync.c @@ -2177,6 +2177,12 @@ int MPIDI_Win_flush_all(MPID_Win *win_ptr) } } + /* Ensure that all shared memory operations are flushed out. The memory + * barriers in the flush are not sufficient since we skip calling flush + * when all operations are already completed. */ + if (win_ptr->shm_allocated == TRUE) + OPA_read_write_barrier(); + fn_exit: MPIDI_RMA_FUNC_EXIT(MPIDI_STATE_MPIDI_WIN_FLUSH_ALL); return mpi_errno; http://git.mpich.org/mpich.git/commitdiff/231b2ce59ecaea86bb7cf1ca926e1bcaed... commit 231b2ce59ecaea86bb7cf1ca926e1bcaed92a717 Author: Xin Zhao <[email protected]> Date: Thu Sep 26 14:36:48 2013 -0500 delete exit after do memory barrier. Because when SHM is allocated, it is possible that orig rank and target rank are on different nodes, in such situation operations are not done yet and win_flush cannot exit. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c index 20e4bf5..47487d2 100644 --- a/src/mpid/ch3/src/ch3u_rma_sync.c +++ b/src/mpid/ch3/src/ch3u_rma_sync.c @@ -2225,12 +2225,8 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr) terms of MPIDI_Win_flush. When this changes, those operations will also need to insert this read/write memory fence for shared memory windows. */ - /* For shared memory windows, all operations are done immediately, so there - is nothing to flush. Ensure ordering of load/store operations and - return. */ if (win_ptr->shm_allocated == TRUE) { OPA_read_write_barrier(); - goto fn_exit; } rma_op = MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[rank].rma_ops_list); http://git.mpich.org/mpich.git/commitdiff/d0927f698a4ada598937d84141348d8f31... commit d0927f698a4ada598937d84141348d8f31dc71f1 Author: Xin Zhao <[email protected]> Date: Thu Sep 26 14:35:08 2013 -0500 Change FLAVOR to shared memory checks in win_flush. Check shm_allocated flag in win_flush to determine if do full memory barrier or not. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c index c0c1e78..20e4bf5 100644 --- a/src/mpid/ch3/src/ch3u_rma_sync.c +++ b/src/mpid/ch3/src/ch3u_rma_sync.c @@ -2228,7 +2228,7 @@ int MPIDI_Win_flush(int rank, MPID_Win *win_ptr) /* For shared memory windows, all operations are done immediately, so there is nothing to flush. Ensure ordering of load/store operations and return. */ - if (win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED) { + if (win_ptr->shm_allocated == TRUE) { OPA_read_write_barrier(); goto fn_exit; } http://git.mpich.org/mpich.git/commitdiff/2d1616687c5ca9e22146feb0196c148f38... commit 2d1616687c5ca9e22146feb0196c148f3819f23b Author: Xin Zhao <[email protected]> Date: Thu Sep 26 14:32:06 2013 -0500 Update FLAVOR checks with shared memory checks. Check both shm_allocated flag and VC's node_id for req-based operations. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_reqops.c b/src/mpid/ch3/src/ch3u_rma_reqops.c index 71335b3..e0af215 100644 --- a/src/mpid/ch3/src/ch3u_rma_reqops.c +++ b/src/mpid/ch3/src/ch3u_rma_reqops.c @@ -148,6 +148,7 @@ int MPIDI_Rput(const void *origin_addr, int origin_count, MPI_Aint dt_true_lb ATTRIBUTE((unused)); MPIDI_msg_sz_t data_sz; MPIDI_CH3I_Rma_req_state_t *req_state; + MPIDI_VC_t *orig_vc, *target_vc; MPIU_CHKPMEM_DECL(1); MPIDI_STATE_DECL(MPID_STATE_MPIDI_RPUT); @@ -178,11 +179,14 @@ int MPIDI_Rput(const void *origin_addr, int origin_count, if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); } } + MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc); + MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc); + /* If the operation is already complete, return a completed request. * Otherwise, generate a grequest. */ /* FIXME: We still may need to flush or sync for shared memory windows */ if (target_rank == MPI_PROC_NULL || target_rank == win_ptr->comm_ptr->rank || - win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || data_sz == 0) + (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) || data_sz == 0) { mpi_errno = MPIR_Grequest_start_impl(MPIDI_CH3I_Rma_req_query, MPIDI_CH3I_Rma_req_free, @@ -229,6 +233,7 @@ int MPIDI_Rget(void *origin_addr, int origin_count, MPI_Aint dt_true_lb ATTRIBUTE((unused)); MPIDI_msg_sz_t data_sz; MPIDI_CH3I_Rma_req_state_t *req_state; + MPIDI_VC_t *orig_vc, *target_vc; MPIU_CHKPMEM_DECL(1); MPIDI_STATE_DECL(MPID_STATE_MPIDI_RGET); @@ -259,11 +264,14 @@ int MPIDI_Rget(void *origin_addr, int origin_count, if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); } } + MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc); + MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc); + /* If the operation is already complete, return a completed request. * Otherwise, generate a grequest. */ /* FIXME: We still may need to flush or sync for shared memory windows */ if (target_rank == MPI_PROC_NULL || target_rank == win_ptr->comm_ptr->rank || - win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || data_sz == 0) + (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) || data_sz == 0) { mpi_errno = MPIR_Grequest_start_impl(MPIDI_CH3I_Rma_req_query, MPIDI_CH3I_Rma_req_free, @@ -310,6 +318,7 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count, MPI_Aint dt_true_lb ATTRIBUTE((unused)); MPIDI_msg_sz_t data_sz; MPIDI_CH3I_Rma_req_state_t *req_state; + MPIDI_VC_t *orig_vc, *target_vc; MPIU_CHKPMEM_DECL(1); MPIDI_STATE_DECL(MPID_STATE_MPIDI_RACCUMULATE); @@ -339,11 +348,14 @@ int MPIDI_Raccumulate(const void *origin_addr, int origin_count, if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); } } + MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc); + MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc); + /* If the operation is already complete, return a completed request. * Otherwise, generate a grequest. */ /* FIXME: We still may need to flush or sync for shared memory windows */ if (target_rank == MPI_PROC_NULL || target_rank == win_ptr->comm_ptr->rank || - win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || data_sz == 0) + (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) || data_sz == 0) { mpi_errno = MPIR_Grequest_start_impl(MPIDI_CH3I_Rma_req_query, MPIDI_CH3I_Rma_req_free, @@ -391,6 +403,7 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count, MPI_Aint dt_true_lb ATTRIBUTE((unused)); MPIDI_msg_sz_t data_sz, trg_data_sz; MPIDI_CH3I_Rma_req_state_t *req_state; + MPIDI_VC_t *orig_vc, *target_vc; MPIU_CHKPMEM_DECL(1); MPIDI_STATE_DECL(MPID_STATE_MPIDI_RGET_ACCUMULATE); @@ -425,11 +438,14 @@ int MPIDI_Rget_accumulate(const void *origin_addr, int origin_count, if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); } } + MPIDI_Comm_get_vc(win_ptr->comm_ptr, win_ptr->comm_ptr->rank, &orig_vc); + MPIDI_Comm_get_vc(win_ptr->comm_ptr, target_rank, &target_vc); + /* If the operation is already complete, return a completed request. * Otherwise, generate a grequest. */ /* FIXME: We still may need to flush or sync for shared memory windows */ if (target_rank == MPI_PROC_NULL || target_rank == win_ptr->comm_ptr->rank || - win_ptr->create_flavor == MPI_WIN_FLAVOR_SHARED || + (win_ptr->shm_allocated == TRUE && orig_vc->node_id == target_vc->node_id) || (data_sz == 0 && trg_data_sz == 0)) { mpi_errno = MPIR_Grequest_start_impl(MPIDI_CH3I_Rma_req_query, http://git.mpich.org/mpich.git/commitdiff/8f1b4bd29e5b4cc4a70ea3dd2f79ed5680... commit 8f1b4bd29e5b4cc4a70ea3dd2f79ed5680f1135a Author: Pavan Balaji <[email protected]> Date: Thu Sep 26 01:46:51 2013 -0500 Win_flush_all optimization. During a win_flush_all, if a target does not have any operations to flush out, don't call the win_flush function at all. This reduces the number of function calls on large systems where the RMA operations are sparsely issued. Signed-off-by: Xin Zhao <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c index fbf609f..c0c1e78 100644 --- a/src/mpid/ch3/src/ch3u_rma_sync.c +++ b/src/mpid/ch3/src/ch3u_rma_sync.c @@ -2169,6 +2169,8 @@ int MPIDI_Win_flush_all(MPID_Win *win_ptr) * make asynchronous progress. Currently this is handled by Win_flush(). */ for (i = 0; i < MPIR_Comm_size(win_ptr->comm_ptr); i++) { + if (MPIDI_CH3I_RMA_Ops_head(&win_ptr->targets[i].rma_ops_list) == NULL) + continue; if (win_ptr->targets[i].remote_lock_state != MPIDI_CH3_WIN_LOCK_NONE) { mpi_errno = win_ptr->RMAFns.Win_flush(i, win_ptr); if (mpi_errno != MPI_SUCCESS) { MPIU_ERR_POP(mpi_errno); } ----------------------------------------------------------------------- Summary of changes: src/mpid/ch3/src/ch3u_rma_reqops.c | 24 ++++++++++++++++++++---- src/mpid/ch3/src/ch3u_rma_sync.c | 14 +++++++++----- test/mpi/rma/mcs-mutex.c | 8 +++----- 3 files changed, 32 insertions(+), 14 deletions(-) hooks/post-receive -- MPICH primary repository