[mpich] MPICH primary repository branch, master, updated. v3.2b4-93-g40b1483
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 40b1483fb31d9207644783a2574b08149dfa594b (commit) via 40050ca60d1ae09645903366b051673d1795fbf2 (commit) via bcb3ad54366c7efb15ab9d0c6cc2d26cfaaf7753 (commit) from bead85d38e01c7baf66c36aa6372a1272eab0176 (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/40b1483fb31d9207644783a2574b08149d... commit 40b1483fb31d9207644783a2574b08149dfa594b Author: Xin Zhao <[email protected]> Date: Sun Aug 9 15:14:33 2015 -0500 Reduce default value of MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD. The original default value of MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD is too high and can cause the internal resources to be used up when all processes within one node have lots of internal requests. Here we reduce this default value. We set the value by meansuing one-to-all communication between MXM nodes, when one origin process issues operations to 8 targets. The performance achieves steady state when the origin processes issues ~16K operations to each target, which means the network is saturated at 16K operations. Here, instead of setting value as 16K*8, we set the default value as 64K, trying to keep the resources used by requests as small as possible. Note that in future after we add the support for hardware RDMA operations to RMA infrastructure, the pressure on request resources should be reduced a lot. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c index 0e78149..4361ccd 100644 --- a/src/mpid/ch3/src/ch3u_rma_progress.c +++ b/src/mpid/ch3/src/ch3u_rma_progress.c @@ -14,7 +14,7 @@ cvars: - name : MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD category : CH3 type : int - default : 2097152 + default : 65536 class : none verbosity : MPI_T_VERBOSITY_USER_BASIC scope : MPI_T_SCOPE_ALL_EQ http://git.mpich.org/mpich.git/commitdiff/40050ca60d1ae09645903366b051673d17... commit 40050ca60d1ae09645903366b051673d1795fbf2 Author: Xin Zhao <[email protected]> Date: Sun Aug 9 15:12:58 2015 -0500 Make active_req_cnt as a global variable. Here we use variable 'active_req_cnt' to keep track of internal requests used by RMA infrastructure, and prevent them from using up resources. This counter should be defined as a global variable for all windows, not a per-window variable, here we fix this. Note that here we cannot make the assert check on this variable in ending synchronization calls anymore. However, since we check variable 'num_pkts_wait_for_local_completion' per target in the ending synchronization calls, it should be OK. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h index 45490c4..81ca4b4 100644 --- a/src/mpid/ch3/include/mpidpre.h +++ b/src/mpid/ch3/include/mpidpre.h @@ -332,9 +332,6 @@ typedef struct MPIDI_Win_basic_info { int num_targets_with_pending_net_ops; /* keep track of number of \ targets that has non-empty \ net pending op list. */ \ - int active_req_cnt; /* keep track of number of active requests in \ - current epoch, i.e., number of issued but \ - incomplete RMA operations. */ \ int *start_ranks_in_win_grp; \ int start_grp_size; \ int lock_all_assert; \ @@ -354,6 +351,8 @@ typedef struct MPIDI_Win_basic_info { extern struct MPID_Win *MPIDI_RMA_Win_active_list_head, *MPIDI_RMA_Win_inactive_list_head; +extern int MPIDI_CH3I_RMA_Active_req_cnt; + #ifdef MPIDI_CH3_WIN_DECL #define MPID_DEV_WIN_DECL \ MPIDI_DEV_WIN_DECL \ diff --git a/src/mpid/ch3/include/mpidrma.h b/src/mpid/ch3/include/mpidrma.h index 6ffd034..630ea70 100644 --- a/src/mpid/ch3/include/mpidrma.h +++ b/src/mpid/ch3/include/mpidrma.h @@ -691,7 +691,7 @@ static inline int check_and_set_req_completion(MPID_Win * win_ptr, MPIDI_RMA_Tar (*op_completed) = TRUE; } else { - win_ptr->active_req_cnt += incomplete_req_cnt; + MPIDI_CH3I_RMA_Active_req_cnt += incomplete_req_cnt; target->num_pkts_wait_for_local_completion += incomplete_req_cnt; } diff --git a/src/mpid/ch3/src/ch3u_handle_op_req.c b/src/mpid/ch3/src/ch3u_handle_op_req.c index 269089f..5b8af99 100644 --- a/src/mpid/ch3/src/ch3u_handle_op_req.c +++ b/src/mpid/ch3/src/ch3u_handle_op_req.c @@ -28,7 +28,7 @@ int MPIDI_CH3_Req_handler_rma_op_complete(MPID_Request * sreq) /* get window, decrement active request cnt on window */ MPID_Win_get_ptr(sreq->dev.source_win_handle, win_ptr); MPIU_Assert(win_ptr != NULL); - win_ptr->active_req_cnt--; + MPIDI_CH3I_RMA_Active_req_cnt--; if (sreq->dev.request_handle != MPI_REQUEST_NULL) { /* get user request */ diff --git a/src/mpid/ch3/src/ch3u_rma_ops.c b/src/mpid/ch3/src/ch3u_rma_ops.c index 65a2eb0..91df74b 100644 --- a/src/mpid/ch3/src/ch3u_rma_ops.c +++ b/src/mpid/ch3/src/ch3u_rma_ops.c @@ -192,8 +192,8 @@ int MPIDI_CH3I_Put(const void *origin_addr, int origin_count, MPI_Datatype MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -361,8 +361,8 @@ int MPIDI_CH3I_Get(void *origin_addr, int origin_count, MPI_Datatype MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -572,8 +572,8 @@ int MPIDI_CH3I_Accumulate(const void *origin_addr, int origin_count, MPI_Datatyp MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -824,8 +824,8 @@ int MPIDI_CH3I_Get_accumulate(const void *origin_addr, int origin_count, MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -1071,8 +1071,8 @@ int MPID_Compare_and_swap(const void *origin_addr, const void *compare_addr, MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -1213,8 +1213,8 @@ int MPID_Fetch_and_op(const void *origin_addr, void *result_addr, MPIU_ERR_POP(mpi_errno); if (MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD >= 0 && - win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { - while (win_ptr->active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { + while (MPIDI_CH3I_RMA_Active_req_cnt >= MPIR_CVAR_CH3_RMA_ACTIVE_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c index 5aa39f2..0e78149 100644 --- a/src/mpid/ch3/src/ch3u_rma_progress.c +++ b/src/mpid/ch3/src/ch3u_rma_progress.c @@ -352,7 +352,7 @@ static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * targ } if (op_completed == FALSE) { - if (win_ptr->active_req_cnt > MPIR_CVAR_CH3_RMA_POKE_PROGRESS_REQ_THRESHOLD) { + if (MPIDI_CH3I_RMA_Active_req_cnt > MPIR_CVAR_CH3_RMA_POKE_PROGRESS_REQ_THRESHOLD) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); diff --git a/src/mpid/ch3/src/ch3u_rma_sync.c b/src/mpid/ch3/src/ch3u_rma_sync.c index 19dca35..9782422 100644 --- a/src/mpid/ch3/src/ch3u_rma_sync.c +++ b/src/mpid/ch3/src/ch3u_rma_sync.c @@ -680,8 +680,6 @@ int MPID_Win_fence(int assert, MPID_Win * win_ptr) } finish_fence: - MPIU_Assert(win_ptr->active_req_cnt == 0); - /* Ensure ordering of load/store operations. */ if (win_ptr->shm_allocated == TRUE) { OPA_read_write_barrier(); @@ -935,8 +933,6 @@ int MPID_Win_start(MPID_Group * group_ptr, int assert, MPID_Win * win_ptr) win_ptr->states.access_state = MPIDI_RMA_PSCW_GRANTED; } - MPIU_Assert(win_ptr->active_req_cnt == 0); - /* Ensure ordering of load/store operations. */ if (win_ptr->shm_allocated == TRUE) { OPA_read_write_barrier(); @@ -1023,8 +1019,6 @@ int MPID_Win_complete(MPID_Win * win_ptr) MPIU_Free(win_ptr->start_ranks_in_win_grp); win_ptr->start_ranks_in_win_grp = NULL; - MPIU_Assert(win_ptr->active_req_cnt == 0); - fn_exit: MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_COMPLETE); return mpi_errno; @@ -1561,8 +1555,6 @@ int MPID_Win_lock_all(int assert, MPID_Win * win_ptr) } } - MPIU_Assert(win_ptr->active_req_cnt == 0); - /* Ensure ordering of load/store operations. */ if (win_ptr->shm_allocated == TRUE) { OPA_read_write_barrier(); @@ -1700,8 +1692,6 @@ int MPID_Win_unlock_all(MPID_Win * win_ptr) /* reset lock_all assert on window. */ win_ptr->lock_all_assert = 0; - MPIU_Assert(win_ptr->active_req_cnt == 0); - fn_exit: MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_UNLOCK_ALL); return mpi_errno; @@ -1738,8 +1728,6 @@ int MPID_Win_flush_all(MPID_Win * win_ptr) if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); - MPIU_Assert(win_ptr->active_req_cnt == 0); - fn_exit: MPIDI_RMA_FUNC_EXIT(MPIDI_STATE_MPID_WIN_FLUSH_ALL); return mpi_errno; @@ -1776,8 +1764,6 @@ int MPID_Win_flush_local_all(MPID_Win * win_ptr) if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); - MPIU_Assert(win_ptr->active_req_cnt == 0); - fn_exit: MPIDI_RMA_FUNC_EXIT(MPID_STATE_MPID_WIN_FLUSH_LOCAL_ALL); return mpi_errno; diff --git a/src/mpid/ch3/src/mpid_rma.c b/src/mpid/ch3/src/mpid_rma.c index 025fbba..e3c0e54 100644 --- a/src/mpid/ch3/src/mpid_rma.c +++ b/src/mpid/ch3/src/mpid_rma.c @@ -43,6 +43,11 @@ MPIU_THREADSAFE_INIT_DECL(initRMAoptions); MPID_Win *MPIDI_RMA_Win_active_list_head = NULL, *MPIDI_RMA_Win_inactive_list_head = NULL; +/* This variable keeps track of number of active RMA requests, i.e., total number of issued + * but incomplete RMA operations. We use this variable to control the resources used up by + * internal requests in RMA infrastructure. */ +int MPIDI_CH3I_RMA_Active_req_cnt = 0; + static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model, MPID_Info * info, MPID_Comm * comm_ptr, MPID_Win ** win_ptr); @@ -289,7 +294,6 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model, (*win_ptr)->states.access_state = MPIDI_RMA_NONE; (*win_ptr)->states.exposure_state = MPIDI_RMA_NONE; (*win_ptr)->num_targets_with_pending_net_ops = 0; - (*win_ptr)->active_req_cnt = 0; (*win_ptr)->start_ranks_in_win_grp = NULL; (*win_ptr)->start_grp_size = 0; (*win_ptr)->lock_all_assert = 0; http://git.mpich.org/mpich.git/commitdiff/bcb3ad54366c7efb15ab9d0c6cc2d26cfa... commit bcb3ad54366c7efb15ab9d0c6cc2d26cfaaf7753 Author: Pavan Balaji <[email protected]> Date: Sat Aug 8 01:51:41 2015 -0500 RMA code Cleanup. Simplify the code of checking window state to a macro. Signed-off-by: Xin Zhao <[email protected]> diff --git a/src/mpid/ch3/src/ch3u_rma_progress.c b/src/mpid/ch3/src/ch3u_rma_progress.c index f07bb1a..5aa39f2 100644 --- a/src/mpid/ch3/src/ch3u_rma_progress.c +++ b/src/mpid/ch3/src/ch3u_rma_progress.c @@ -47,46 +47,18 @@ cvars: static inline int check_and_switch_target_state(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target, int *is_able_to_issue, int *made_progress); -static inline int check_and_switch_window_state(MPID_Win * win_ptr, int *is_able_to_issue); static inline int issue_ops_target(MPID_Win * win_ptr, MPIDI_RMA_Target_t * target, int *made_progress); static inline int issue_ops_win(MPID_Win * win_ptr, int *made_progress); -/* check if we can switch window-wide state: FENCE_ISSUED, PSCW_ISSUED, LOCK_ALL_ISSUED */ -#undef FUNCNAME -#define FUNCNAME check_and_switch_window_state -#undef FCNAME -#define FCNAME MPIU_QUOTE(FUNCNAME) -static inline int check_and_switch_window_state(MPID_Win * win_ptr, int *is_able_to_issue) -{ - int mpi_errno = MPI_SUCCESS; - MPIDI_STATE_DECL(MPID_STATE_CHECK_AND_SWITCH_WINDOW_STATE); - - MPIDI_RMA_FUNC_ENTER(MPID_STATE_CHECK_AND_SWITCH_WINDOW_STATE); - - (*is_able_to_issue) = 0; - - switch (win_ptr->states.access_state) { - case MPIDI_RMA_PER_TARGET: - case MPIDI_RMA_LOCK_ALL_CALLED: - case MPIDI_RMA_FENCE_GRANTED: - case MPIDI_RMA_PSCW_GRANTED: - case MPIDI_RMA_LOCK_ALL_GRANTED: - (*is_able_to_issue) = 1; - break; - - default: - break; - } /* end of switch */ - fn_exit: - MPIDI_RMA_FUNC_EXIT(MPID_STATE_CHECK_AND_SWITCH_WINDOW_STATE); - return mpi_errno; - /* --BEGIN ERROR HANDLING-- */ - fn_fail: - goto fn_exit; - /* --END ERROR HANDLING-- */ -} +/* This macro checks if window state is ready for issuing RMA operations. */ +#define WIN_READY(win_) \ + ((win_)->states.access_state == MPIDI_RMA_PER_TARGET || \ + (win_)->states.access_state == MPIDI_RMA_LOCK_ALL_CALLED || \ + (win_)->states.access_state == MPIDI_RMA_FENCE_GRANTED || \ + (win_)->states.access_state == MPIDI_RMA_PSCW_GRANTED || \ + (win_)->states.access_state == MPIDI_RMA_LOCK_ALL_GRANTED) #undef FUNCNAME @@ -608,11 +580,8 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int * is registered / executed before NBC progress, it will cause the progress engine * to re-entrant RMA progress endlessly. */ - /* check window state */ - mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue); - if (mpi_errno != MPI_SUCCESS) - MPIU_ERR_POP(mpi_errno); - if (!is_able_to_issue) { + /* check window state, if it is not ready, poke the progress engine */ + if (!WIN_READY(win_ptr)) { mpi_errno = poke_progress_engine(); if (mpi_errno) MPIU_ERR_POP(mpi_errno); @@ -658,7 +627,6 @@ int MPIDI_CH3I_RMA_Make_progress_target(MPID_Win * win_ptr, int target_rank, int int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress) { int mpi_errno = MPI_SUCCESS; - int is_able_to_issue = 0; int temp_progress = 0; (*made_progress) = 0; @@ -671,11 +639,8 @@ int MPIDI_CH3I_RMA_Make_progress_win(MPID_Win * win_ptr, int *made_progress) * is registered / executed before NBC progress, it will cause the progress engine * to re-entrant RMA progress endlessly. */ - /* check and try to switch window state */ - mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue); - if (mpi_errno != MPI_SUCCESS) - MPIU_ERR_POP(mpi_errno); - if (!is_able_to_issue) { + /* check and try to switch window state, if it is not ready, poke the progress engine */ + if (!WIN_READY(win_ptr)) { mpi_errno = poke_progress_engine(); if (mpi_errno != MPI_SUCCESS) MPIU_ERR_POP(mpi_errno); @@ -711,18 +676,13 @@ int MPIDI_CH3I_RMA_Make_progress_global(int *made_progress) for (win_ptr = MPIDI_RMA_Win_active_list_head; win_ptr; win_ptr = win_ptr->next) { int temp_progress = 0; - int is_able_to_issue = 0; if (win_ptr->states.access_state == MPIDI_RMA_NONE) continue; /* check and try to switch window state */ - mpi_errno = check_and_switch_window_state(win_ptr, &is_able_to_issue); - if (mpi_errno != MPI_SUCCESS) - MPIU_ERR_POP(mpi_errno); - if (!is_able_to_issue) { + if (!WIN_READY(win_ptr)) continue; - } mpi_errno = issue_ops_win(win_ptr, &temp_progress); if (mpi_errno != MPI_SUCCESS) ----------------------------------------------------------------------- Summary of changes: src/mpid/ch3/include/mpidpre.h | 5 +- src/mpid/ch3/include/mpidrma.h | 2 +- src/mpid/ch3/src/ch3u_handle_op_req.c | 2 +- src/mpid/ch3/src/ch3u_rma_ops.c | 24 ++++++------ src/mpid/ch3/src/ch3u_rma_progress.c | 68 +++++++-------------------------- src/mpid/ch3/src/ch3u_rma_sync.c | 14 ------- src/mpid/ch3/src/mpid_rma.c | 6 ++- 7 files changed, 35 insertions(+), 86 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org