Skip to content

Commit 2c95be5

Browse files
committed
ch4/wait: Optimize progress for local requests
Skip netmod progress when the request(s) being waited on are determined to be local only.
1 parent d521a2b commit 2c95be5

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,27 @@
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;
1515

1616
int vci = MPIDI_Request_get_vci(req);
1717

1818
state->vci_count = 1;
1919
state->vci[0] = vci;
20+
21+
#ifndef MPIDI_CH4_DIRECT_NETMOD
22+
if (!req->dev.anysrc_partner && MPIDI_REQUEST(req, is_local)) {
23+
state->flag &= ~MPIDI_PROGRESS_NM;
24+
}
25+
#endif
2026
}
2127

2228
MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** reqs,
2329
MPID_Progress_state * state)
2430
{
25-
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
31+
state->flag = MPIDI_PROGRESS_ALL;
32+
#ifndef MPIDI_CH4_DIRECT_NETMOD
33+
state->flag &= ~MPIDI_PROGRESS_NM;
34+
#endif
2635

2736
int idx = 0;
2837
for (int i = 0; i < n; i++) {
@@ -45,6 +54,11 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** re
4554
if (!found) {
4655
state->vci[idx++] = vci;
4756
}
57+
#ifndef MPIDI_CH4_DIRECT_NETMOD
58+
if (!MPIDI_REQUEST(reqs[i], is_local) || reqs[i]->dev.anysrc_partner) {
59+
state->flag |= MPIDI_PROGRESS_NM;
60+
}
61+
#endif
4862
}
4963
state->vci_count = idx;
5064
}

0 commit comments

Comments
 (0)