Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch4/isend-irecv: add parent reques completion in isend/irecv #6640

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/mpid/ch4/src/ch4_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,36 @@ MPL_STATIC_INLINE_PREFIX int MPID_Irecv(void *buf,
goto fn_exit;
}

MPL_STATIC_INLINE_PREFIX int MPID_Irecv_parent(void *buf,
MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
MPIR_Comm * comm, int attr,
MPIR_cc_t * parent_cc_ptr, MPIR_Request ** request)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we pass the parent request instead of the cc_ptr?

{
int mpi_errno = MPI_SUCCESS;
MPIR_FUNC_ENTER;

if (MPIDI_is_self_comm(comm)) {
mpi_errno =
MPIDI_Self_irecv(buf, count, datatype, rank, tag, comm, attr, parent_cc_ptr, request);
} else {
MPIDI_av_entry_t *av = (rank == MPI_ANY_SOURCE ? NULL : MPIDIU_comm_rank_to_av(comm, rank));
mpi_errno =
MPIDI_irecv(buf, count, datatype, rank, tag, comm, attr, av, parent_cc_ptr, request);
}

MPIR_ERR_CHECK(mpi_errno);

MPII_RECVQ_REMEMBER(*request, rank, tag, comm->recvcontext_id, buf, count);
fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}

MPL_STATIC_INLINE_PREFIX int MPID_Cancel_recv(MPIR_Request * rreq)
{
int mpi_errno;
Expand Down
46 changes: 46 additions & 0 deletions src/mpid/ch4/src/ch4_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,52 @@ MPL_STATIC_INLINE_PREFIX int MPID_Isend(const void *buf,
goto fn_exit;
}

MPL_STATIC_INLINE_PREFIX int MPID_Isend_parent(const void *buf,
MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
MPIR_Comm * comm, int attr,
MPIR_cc_t * parent_cc_ptr, MPIR_Request ** request)
{
int mpi_errno = MPI_SUCCESS;
MPIDI_av_entry_t *av = NULL;
MPIR_FUNC_ENTER;

if (MPIDI_is_self_comm(comm)) {
mpi_errno =
MPIDI_Self_isend(buf, count, datatype, rank, tag, comm, attr, parent_cc_ptr, request);
} else {
av = MPIDIU_comm_rank_to_av(comm, rank);
mpi_errno =
MPIDI_isend(buf, count, datatype, rank, tag, comm, attr, av, parent_cc_ptr, request);
}

MPIR_ERR_CHECK(mpi_errno);

if (*request) {
MPII_SENDQ_REMEMBER(*request, rank, tag, comm->recvcontext_id, buf, count);
}

fn_exit:
MPIR_FUNC_EXIT;
return mpi_errno;
fn_fail:
goto fn_exit;
}

MPL_STATIC_INLINE_PREFIX int MPID_Isend_coll(const void *buf,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this accidentally added?

MPI_Aint count,
MPI_Datatype datatype,
int rank,
int tag,
MPIR_Comm * comm, int attr,
MPIR_Request ** request, MPIR_Errflag_t * errflag)
{
MPIR_PT2PT_ATTR_SET_ERRFLAG(attr, *errflag);
return MPID_Isend(buf, count, datatype, rank, tag, comm, attr, request);
}

MPL_STATIC_INLINE_PREFIX int MPID_Send(const void *buf,
MPI_Aint count,
MPI_Datatype datatype,
Expand Down