Commit 9f2db553 authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Handle anysource in blocking recv functions



If a blocking recv function (MPI_Recv and MPI_Sendrecv) includes an
MPI_ANY_SOURCE and there is a failure, handle it by cleaning up the
request and returning MPIX_ERR_PROC_FAILED.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 648cd48c
......@@ -162,6 +162,19 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
goto fn_fail;
/* --END ERROR HANDLING-- */
}
if (unlikely(MPIR_CVAR_ENABLE_FT &&
!MPID_Request_is_complete(request_ptr) &&
request_ptr->dev.match.parts.rank == MPI_ANY_SOURCE &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptr->comm))) {
/* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(request_ptr);
MPIR_STATUS_SET_CANCEL_BIT(request_ptr->status, FALSE);
MPIU_ERR_SET(request_ptr->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
mpi_errno = request_ptr->status.MPI_ERROR;
goto fn_fail;
/* --END ERROR HANDLING-- */
}
}
MPID_Progress_end(&progress_state);
}
......
......@@ -189,6 +189,23 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
goto fn_fail;
/* --END ERROR HANDLING-- */
}
if (unlikely(MPIR_CVAR_ENABLE_FT &&
!MPID_Request_is_complete(rreq) &&
rreq->dev.match.parts.rank == MPI_ANY_SOURCE &&
!MPIDI_CH3I_Comm_AS_enabled(rreq->comm))) {
/* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(rreq);
MPIR_STATUS_SET_CANCEL_BIT(rreq->status, FALSE);
MPIU_ERR_SET(rreq->status.MPI_ERROR, MPIX_ERR_PROC_FAILED, "**proc_failed");
mpi_errno = rreq->status.MPI_ERROR;
if (!MPID_Request_is_complete(sreq)) {
MPID_Cancel_send(sreq);
MPIR_STATUS_SET_CANCEL_BIT(sreq->status, FALSE);
}
goto fn_fail;
/* --END ERROR HANDLING-- */
}
}
MPID_Progress_end(&progress_state);
}
......
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