Skip to content

Commit 62ce4f7

Browse files
committed
ch4/wait: Optimize wait when 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 85d781f commit 62ce4f7

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/mpid/ch4/src/ch4_wait.h

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,23 @@
1111
MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci(MPIR_Request * req,
1212
MPID_Progress_state * state)
1313
{
14-
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
14+
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request anysource */
1515

1616
int vci = MPIDI_Request_get_vci(req);
1717

1818
state->vci_count = 1;
1919
state->vci[0] = vci;
20+
21+
if (MPIDI_REQUEST(req, is_local)) {
22+
state->flag &= ~MPIDI_PROGRESS_NM;
23+
}
2024
}
2125

2226
MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** reqs,
2327
MPID_Progress_state * state)
2428
{
25-
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
29+
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request anysource */
30+
bool nm_progress = false;
2631

2732
int idx = 0;
2833
for (int i = 0; i < n; i++) {
@@ -45,8 +50,17 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** re
4550
if (!found) {
4651
state->vci[idx++] = vci;
4752
}
53+
#ifndef MPIDI_CH4_DIRECT_NETMOD
54+
nm_progress |= !MPIDI_REQUEST(reqs[i], is_local);
55+
#else
56+
nm_progress = true;
57+
#endif
4858
}
4959
state->vci_count = idx;
60+
61+
if (!nm_progress) {
62+
state->flag &= ~MPIDI_PROGRESS_NM;
63+
}
5064
}
5165

5266
/* MPID_Test, MPID_Testall, MPID_Testany, MPID_Testsome */

0 commit comments

Comments
 (0)