[mpich] MPICH primary repository branch, master, updated. v3.2b4-98-g4551de1
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 4551de14b1d752a9c7be49df4a9e70776addd02f (commit) from 6f020c71b5f6349b3b616280ba9c24ed7988de40 (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/4551de14b1d752a9c7be49df4a9e70776a... commit 4551de14b1d752a9c7be49df4a9e70776addd02f Author: Xin Zhao <[email protected]> Date: Sun Aug 9 22:19:50 2015 -0500 Keep track of how many progress hooks are currently registered. Here we add a counter to keep track of how many progress hooks currently registered. Therefore, when we trigger progress hooks, inside progress engine, we do not need to check all MAX_PROGRESS_HOOKS number of slots. Signed-off-by: Pavan Balaji <[email protected]> diff --git a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c index 1dfbcdc..380fd45 100644 --- a/src/mpid/ch3/channels/nemesis/src/ch3_progress.c +++ b/src/mpid/ch3/channels/nemesis/src/ch3_progress.c @@ -87,6 +87,7 @@ static qn_ent_t *qn_head = NULL; #define MAX_PROGRESS_HOOKS 16 typedef int (*progress_func_ptr_t) (int* made_progress); static progress_func_ptr_t progress_hooks[MAX_PROGRESS_HOOKS] = { NULL }; +static int total_progress_hook_cnt = 0; /* Keep track of how many progress hooks are currently registered */ #ifdef HAVE_SIGNAL static void sigusr1_handler(int sig) @@ -302,6 +303,10 @@ int MPIDI_CH3I_Progress_register_hook(int (*progress_fn)(int*)) for (i = 0; i < MAX_PROGRESS_HOOKS; i++) { if (progress_hooks[i] == NULL) { progress_hooks[i] = progress_fn; + + total_progress_hook_cnt++; + MPIU_Assert(total_progress_hook_cnt <= MAX_PROGRESS_HOOKS); + break; } } @@ -337,6 +342,10 @@ int MPIDI_CH3I_Progress_deregister_hook(int (*progress_fn)(int*)) for (i = 0; i < MAX_PROGRESS_HOOKS; i++) { if (progress_hooks[i] == progress_fn) { progress_hooks[i] = NULL; + + total_progress_hook_cnt--; + MPIU_Assert(total_progress_hook_cnt >= 0); + break; } } @@ -434,6 +443,7 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking) int in_fbox = 0; MPIDI_VC_t *vc; int i; + int called_progress_hook_cnt = 0; do /* receive progress */ { @@ -533,12 +543,17 @@ int MPIDI_CH3I_Progress (MPID_Progress_state *progress_state, int is_blocking) if (mpi_errno) MPIU_ERR_POP(mpi_errno); } + called_progress_hook_cnt = 0; for (i = 0; i < MAX_PROGRESS_HOOKS; i++) { if (progress_hooks[i] != NULL) { mpi_errno = progress_hooks[i](&made_progress); if (mpi_errno) MPIU_ERR_POP(mpi_errno); if (made_progress) MPIDI_CH3_Progress_signal_completion(); + + called_progress_hook_cnt++; + if (called_progress_hook_cnt == total_progress_hook_cnt) + break; } } ----------------------------------------------------------------------- Summary of changes: src/mpid/ch3/channels/nemesis/src/ch3_progress.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org