Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mpid/ch4/include/mpidpost.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MPL_STATIC_INLINE_PREFIX void MPID_Request_create_hook(MPIR_Request * req)
req->dev.type = MPIDI_REQ_TYPE_NONE;
#ifndef MPIDI_CH4_DIRECT_NETMOD
req->dev.anysrc_partner = NULL;
req->dev.is_local = 0;
#endif

MPIR_FUNC_EXIT;
Expand Down
1 change: 1 addition & 0 deletions src/mpid/ch4/shm/ipc/src/ipc_p2p.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_IPCI_send_lmt(const void *buf, MPI_Aint count
MPIDIG_REQUEST(sreq, u.ipc.peer_rank) = rank;
MPIDIG_REQUEST(sreq, u.ipc.peer_req) = NULL;
MPIDIG_REQUEST(sreq, u.ipc.src_dt_ptr) = NULL;
MPIDI_REQUEST_SET_LOCAL(sreq, 1, NULL);
MPIDI_SHM_REQUEST(sreq, ipc.ipc_type) = ipc_attr->ipc_type;

/* Allocate am_hdr and fill ipc_hdr */
Expand Down
9 changes: 4 additions & 5 deletions src/mpid/ch4/src/ch4_progress.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ extern MPL_TLS int no_progress_counter;

MPL_STATIC_INLINE_PREFIX int MPIDI_do_global_progress(void)
{
if ((MPIDI_global.n_vcis == 1 || !MPIR_CVAR_CH4_GLOBAL_PROGRESS) &&
!MPIR_CVAR_CH4_PROGRESS_THROTTLE) {
if (!MPIR_CVAR_CH4_GLOBAL_PROGRESS && !MPIR_CVAR_CH4_PROGRESS_THROTTLE) {
return 0;
} else {
global_vci_poll_count++;
Expand All @@ -88,7 +87,7 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_do_global_progress(void)
#ifdef MPIDI_CH4_DIRECT_NETMOD
#define MPIDI_PROGRESS(vci, is_global) \
do { \
if (state->flag & MPIDI_PROGRESS_NM && (is_global || !made_progress)) { \
if (is_global || (state->flag & MPIDI_PROGRESS_NM && !made_progress)) { \
MPIDI_THREAD_CS_ENTER_VCI_OPTIONAL(vci); \
mpi_errno = MPIDI_NM_progress(vci, &made_progress); \
MPIDI_THREAD_CS_EXIT_VCI_OPTIONAL(vci); \
Expand All @@ -99,13 +98,13 @@ MPL_STATIC_INLINE_PREFIX int MPIDI_do_global_progress(void)
#else
#define MPIDI_PROGRESS(vci, is_global) \
do { \
if (state->flag & MPIDI_PROGRESS_SHM && (is_global || !made_progress)) { \
if (is_global || (state->flag & MPIDI_PROGRESS_SHM && !made_progress)) { \
MPID_THREAD_CS_ENTER(VCI, MPIDI_VCI_LOCK(vci)); \
mpi_errno = MPIDI_SHM_progress(vci, &made_progress); \
MPID_THREAD_CS_EXIT(VCI, MPIDI_VCI_LOCK(vci)); \
MPIR_ERR_CHECK(mpi_errno); \
} \
if (state->flag & MPIDI_PROGRESS_NM && (is_global || !made_progress)) { \
if (is_global || (state->flag & MPIDI_PROGRESS_NM && !made_progress)) { \
MPIDI_THREAD_CS_ENTER_VCI_OPTIONAL(vci); \
mpi_errno = MPIDI_NM_progress(vci, &made_progress); \
MPIDI_THREAD_CS_EXIT_VCI_OPTIONAL(vci); \
Expand Down
18 changes: 16 additions & 2 deletions src/mpid/ch4/src/ch4_wait.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@
MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci(MPIR_Request * req,
MPID_Progress_state * state)
{
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
state->flag = MPIDI_PROGRESS_ALL;

int vci = MPIDI_Request_get_vci(req);

state->vci_count = 1;
state->vci[0] = vci;

#ifndef MPIDI_CH4_DIRECT_NETMOD
if (!req->dev.anysrc_partner && MPIDI_REQUEST(req, is_local)) {
state->flag &= ~MPIDI_PROGRESS_NM;
}
#endif
}

MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** reqs,
MPID_Progress_state * state)
{
state->flag = MPIDI_PROGRESS_ALL; /* TODO: check request is_local/anysource */
state->flag = MPIDI_PROGRESS_ALL;
#ifndef MPIDI_CH4_DIRECT_NETMOD
state->flag &= ~MPIDI_PROGRESS_NM;
#endif

int idx = 0;
for (int i = 0; i < n; i++) {
Expand All @@ -45,6 +54,11 @@ MPL_STATIC_INLINE_PREFIX void MPIDI_set_progress_vci_n(int n, MPIR_Request ** re
if (!found) {
state->vci[idx++] = vci;
}
#ifndef MPIDI_CH4_DIRECT_NETMOD
if (!MPIDI_REQUEST(reqs[i], is_local) || reqs[i]->dev.anysrc_partner) {
state->flag |= MPIDI_PROGRESS_NM;
}
#endif
}
state->vci_count = idx;
}
Expand Down