Skip to content

Commit c825241

Browse files
committed
ch4/wait: Optimize waitall when all requests are local
Optimize progress for a batch of local communication requests by skipping netmod progress. Shows a 5-10% improvement in ch4/shm bandwidth measurements on a single node of Cascade Lake.
1 parent f47908f commit c825241

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/mpid/ch4/src/ch4_wait.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci(MPIR_Request * req,
2222
MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** reqs,
2323
MPID_Progress_state * state)
2424
{
25-
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
25+
state->flag = MPIDI_PROGRESS_ALL;
26+
bool local_only = true;
2627

2728
int idx = 0;
2829
for (int i = 0; i < n; i++) {
@@ -45,8 +46,15 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** re
4546
if (!found) {
4647
state->vci[idx++] = vci;
4748
}
49+
#ifndef MPIDI_CH4_DIRECT_NETMOD
50+
local_only = local_only && MPIDI_REQUEST(reqs[i], is_local);
51+
#endif
4852
}
4953
state->vci_count = idx;
54+
55+
if (local_only) {
56+
state->flag &= ~MPIDI_PROGRESS_NM;
57+
}
5058
}
5159

5260
/* MPID_Test, MPID_Testall, MPID_Testany, MPID_Testsome */

0 commit comments

Comments
 (0)