Commit 4e783c9d authored by Wesley Bland's avatar Wesley Bland Committed by Pavan Balaji
Browse files

Rename MPIC_Sendrecv_replace_ft to MPIC_Sendrecv_replace



The FT functions are now the default (only) way to call the collective
helper functions. This is one of a few patches to migrate all uses to no
longer use the MPIC_*_ft naming scheme.Rename MPIC_Send_ft to MPIC_Send
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@mcs.anl.gov>
parent e98feb06
......@@ -3893,7 +3893,7 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status, int *errflag);
int MPIC_Sendrecv_replace_ft(void *buf, int count, MPI_Datatype datatype,
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status, int *errflag);
......
......@@ -135,7 +135,7 @@ int MPIR_Alltoall_intra(
for (j = i; j < comm_size; ++j) {
if (rank == i) {
/* also covers the (rank == i && rank == j) case */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + j*recvcount*recvtype_extent),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + j*recvcount*recvtype_extent),
recvcount, recvtype,
j, MPIR_ALLTOALL_TAG,
j, MPIR_ALLTOALL_TAG,
......@@ -149,7 +149,7 @@ int MPIR_Alltoall_intra(
}
else if (rank == j) {
/* same as above with i/j args reversed */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + i*recvcount*recvtype_extent),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + i*recvcount*recvtype_extent),
recvcount, recvtype,
i, MPIR_ALLTOALL_TAG,
i, MPIR_ALLTOALL_TAG,
......
......@@ -99,7 +99,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
for (j = i; j < comm_size; ++j) {
if (rank == i) {
/* also covers the (rank == i && rank == j) case */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + rdispls[j]*recv_extent),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[j]*recv_extent),
recvcounts[j], recvtype,
j, MPIR_ALLTOALLV_TAG,
j, MPIR_ALLTOALLV_TAG,
......@@ -114,7 +114,7 @@ int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *
}
else if (rank == j) {
/* same as above with i/j args reversed */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + rdispls[i]*recv_extent),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[i]*recv_extent),
recvcounts[i], recvtype,
i, MPIR_ALLTOALLV_TAG,
i, MPIR_ALLTOALLV_TAG,
......
......@@ -90,7 +90,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
for (j = i; j < comm_size; ++j) {
if (rank == i) {
/* also covers the (rank == i && rank == j) case */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + rdispls[j]),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[j]),
recvcounts[j], recvtypes[j],
j, MPIR_ALLTOALLW_TAG,
j, MPIR_ALLTOALLW_TAG,
......@@ -104,7 +104,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
}
else if (rank == j) {
/* same as above with i/j args reversed */
mpi_errno = MPIC_Sendrecv_replace_ft(((char *)recvbuf + rdispls[i]),
mpi_errno = MPIC_Sendrecv_replace(((char *)recvbuf + rdispls[i]),
recvcounts[i], recvtypes[i],
i, MPIR_ALLTOALLW_TAG,
i, MPIR_ALLTOALLW_TAG,
......
......@@ -40,111 +40,6 @@ int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status)
}
/* NOTE: for regular collectives (as opposed to irregular collectives) calling
* this function repeatedly will almost always be slower than performing the
* equivalent inline because of the overhead of the repeated malloc/free */
#undef FUNCNAME
#define FUNCNAME MPIC_Sendrecv_replace
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status)
{
int mpi_errno = MPI_SUCCESS;
MPIR_Context_id_t context_id_offset;
MPID_Request *sreq;
MPID_Request *rreq;
void *tmpbuf = NULL;
int tmpbuf_size = 0;
int tmpbuf_count = 0;
MPID_Comm *comm_ptr;
MPIU_CHKLMEM_DECL(1);
MPIDI_STATE_DECL(MPID_STATE_MPIC_SENDRECV_REPLACE);
#ifdef MPID_LOG_ARROWS
/* The logging macros log sendcount and recvcount */
int sendcount = count, recvcount = count;
#endif
MPIDI_PT2PT_FUNC_ENTER_BOTH(MPID_STATE_MPIC_SENDRECV_REPLACE);
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
MPID_Comm_get_ptr( comm, comm_ptr );
context_id_offset = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
MPID_CONTEXT_INTRA_COLL : MPID_CONTEXT_INTER_COLL;
if (count > 0 && dest != MPI_PROC_NULL)
{
MPIR_Pack_size_impl(count, datatype, &tmpbuf_size);
MPIU_CHKLMEM_MALLOC(tmpbuf, void *, tmpbuf_size, mpi_errno, "temporary send buffer");
mpi_errno = MPIR_Pack_impl(buf, count, datatype, tmpbuf, tmpbuf_size, &tmpbuf_count);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
}
mpi_errno = MPID_Irecv(buf, count, datatype, source, recvtag,
comm_ptr, context_id_offset, &rreq);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
mpi_errno = MPID_Isend(tmpbuf, tmpbuf_count, MPI_PACKED, dest,
sendtag, comm_ptr, context_id_offset,
&sreq);
if (mpi_errno != MPI_SUCCESS)
{
/* --BEGIN ERROR HANDLING-- */
/* FIXME: should we cancel the pending (possibly completed) receive request or wait for it to complete? */
MPID_Request_release(rreq);
MPIU_ERR_POP(mpi_errno);
/* --END ERROR HANDLING-- */
}
if (!MPID_Request_is_complete(sreq) || !MPID_Request_is_complete(rreq))
{
MPID_Progress_state progress_state;
MPID_Progress_start(&progress_state);
while (!MPID_Request_is_complete(sreq) || !MPID_Request_is_complete(rreq))
{
mpi_errno = MPID_Progress_wait(&progress_state);
if (mpi_errno != MPI_SUCCESS)
{
/* --BEGIN ERROR HANDLING-- */
MPID_Progress_end(&progress_state);
MPIU_ERR_POP(mpi_errno);
/* --END ERROR HANDLING-- */
}
}
MPID_Progress_end(&progress_state);
}
if (status != MPI_STATUS_IGNORE) {
*status = rreq->status;
}
if (mpi_errno == MPI_SUCCESS) {
mpi_errno = rreq->status.MPI_ERROR;
if (mpi_errno == MPI_SUCCESS) {
mpi_errno = sreq->status.MPI_ERROR;
}
}
MPID_Request_release(sreq);
MPID_Request_release(rreq);
if (mpi_errno) MPIU_ERR_POP(mpi_errno);
fn_exit:
MPIU_CHKLMEM_FREEALL();
MPIDI_PT2PT_FUNC_EXIT_BOTH(MPID_STATE_MPIC_SENDRECV_REPLACE);
return mpi_errno;
fn_fail:
goto fn_exit;
}
#undef FUNCNAME
#define FUNCNAME MPIR_Localcopy
#undef FCNAME
......@@ -571,11 +466,14 @@ int MPIC_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
goto fn_exit;
}
/* NOTE: for regular collectives (as opposed to irregular collectives) calling
* this function repeatedly will almost always be slower than performing the
* equivalent inline because of the overhead of the repeated malloc/free */
#undef FUNCNAME
#define FUNCNAME MPIC_Sendrecv_replace_ft
#define FUNCNAME MPIC_Sendrecv_replace
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Sendrecv_replace_ft(void *buf, int count, MPI_Datatype datatype,
int MPIC_Sendrecv_replace(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status, int *errflag)
......
......@@ -571,7 +571,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
}
mpi_errno = MPIC_Sendrecv_replace_ft(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
sendtag++, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
......@@ -1229,7 +1229,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
TRACE_ERR("MPIC_Sendrecv returned with mpi_errno=%d\n", mpi_errno);
}
#endif
mpi_errno = MPIC_Sendrecv_replace_ft(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
mpi_errno = MPIC_Sendrecv_replace(&comm_cntr, 1, MPI_LONG_LONG_INT, 0,
sendtag++, 0, recvtag++, tmp_comm->handle,
MPI_STATUS_IGNORE, &errflag);
if (mpi_errno != MPI_SUCCESS) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment