Skip to content

Commit

Permalink
ch4: implement MPID_{Send,Recv}_data
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhou committed Sep 4, 2024
1 parent 8d135a7 commit 6b98800
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
27 changes: 27 additions & 0 deletions src/mpid/ch4/src/ch4_recv.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,33 @@ MPL_STATIC_INLINE_PREFIX int MPID_Irecv(void *buf,
goto fn_exit;
}

MPL_STATIC_INLINE_PREFIX int MPID_Recv_data(MPIR_Data * data, int rank, int tag,
MPIR_Comm * comm, int attr, MPIR_Request ** request)
{
int mpi_errno = MPI_SUCCESS;
MPIR_FUNC_ENTER;

if (MPIR_is_self_comm(comm)) {
mpi_errno = MPIDI_Self_recv_data(data, rank, tag, comm, attr, request);
} else {
#if 1
MPIR_Assert(0);
#else
MPIDI_av_entry_t *av = (rank == MPI_ANY_SOURCE ? NULL : MPIDIU_comm_rank_to_av(comm, rank));
mpi_errno = MPIDI_irecv_data(data, rank, tag, comm, attr, av, request);
#endif
}

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
28 changes: 27 additions & 1 deletion src/mpid/ch4/src/ch4_send.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,33 @@ MPL_STATIC_INLINE_PREFIX int MPID_Send_data(MPIR_Data * data, int rank, int tag,
MPIDI_av_entry_t *av = NULL;
MPIR_FUNC_ENTER;

MPIR_Assert(0);
if (MPIR_is_self_comm(comm)) {
mpi_errno = MPIDI_Self_send_data(data, rank, tag, comm, attr, request);
} else {
#if 1
MPIR_Assert(0);
#else
*(request) = NULL;
#ifdef MPIDI_CH4_DIRECT_NETMOD
mpi_errno = MPIDI_NM_send_data(data, rank, tag, comm, attr, av, req);
#else
int r;
if ((r = MPIDI_av_is_local(av)))
mpi_errno = MPIDI_SHM_send_data(data, rank, tag, comm, attr, av, req);
else
mpi_errno = MPIDI_NM_send_data(data, rank, tag, comm, attr, av, req);
if (mpi_errno == MPI_SUCCESS)
MPIDI_REQUEST(*req, is_local) = r;
#endif
MPIR_ERR_CHECK(mpi_errno);
#endif
}

MPIR_ERR_CHECK(mpi_errno);

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

fn_exit:
MPIR_FUNC_EXIT;
Expand Down

0 comments on commit 6b98800

Please sign in to comment.