Commit 6f646ca0 authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Remove ADI breakage introduced earlier



There was an accidental ADI breakage earlier when MPI level codes would
query into the dev part of the MPID request object. This commit removes
that breakage by adding a new macro into the mpiimpl.h file to portably
check whether a request is anysource. For now, in pamid, this macro
always evaluates to 0. This can easily be fixed by overwriting it in the
pamid code, but since pamid doesn't support FT, it won't have any
functional change either.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent d1ab9e68
...@@ -3415,6 +3415,20 @@ int MPID_Cancel_recv(MPID_Request *); ...@@ -3415,6 +3415,20 @@ int MPID_Cancel_recv(MPID_Request *);
@*/ @*/
int MPID_Comm_AS_enabled(MPID_Comm *); int MPID_Comm_AS_enabled(MPID_Comm *);
/*@
MPID_Request_is_anysource - Query whether the request is an anysource receive
Input Parameter:
request - Receive request being queried
Return Value:
0 - The request is not anysource
1 - The request is anysource
@*/
int MPID_Request_is_anysource(MPID_Request *);
/*@
MPID_Aint_add - Returns the sum of base and disp MPID_Aint_add - Returns the sum of base and disp
Input Parameters: Input Parameters:
......
...@@ -165,7 +165,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag, ...@@ -165,7 +165,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
!MPID_Request_is_complete(request_ptr) && !MPID_Request_is_complete(request_ptr) &&
request_ptr->dev.match.parts.rank == MPI_ANY_SOURCE && MPID_Request_is_anysource(request_ptr) &&
!MPID_Comm_AS_enabled(request_ptr->comm))) { !MPID_Comm_AS_enabled(request_ptr->comm))) {
/* --BEGIN ERROR HANDLING-- */ /* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(request_ptr); MPID_Cancel_recv(request_ptr);
......
...@@ -192,7 +192,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, ...@@ -192,7 +192,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
!MPID_Request_is_complete(rreq) && !MPID_Request_is_complete(rreq) &&
rreq->dev.match.parts.rank == MPI_ANY_SOURCE && MPID_Request_is_anysource(rreq) &&
!MPID_Comm_AS_enabled(rreq->comm))) { !MPID_Comm_AS_enabled(rreq->comm))) {
/* --BEGIN ERROR HANDLING-- */ /* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(rreq); MPID_Cancel_recv(rreq);
......
...@@ -68,7 +68,7 @@ int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status) ...@@ -68,7 +68,7 @@ int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status)
/* Fall through to the exit */ /* Fall through to the exit */
} else if (unlikely( } else if (unlikely(
MPIR_CVAR_ENABLE_FT && MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank && MPID_Request_is_anysource(request_ptr) &&
!MPID_Comm_AS_enabled(request_ptr->comm))) { !MPID_Comm_AS_enabled(request_ptr->comm))) {
MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending"); MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno; if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
......
...@@ -179,7 +179,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag, ...@@ -179,7 +179,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
mpi_errno = MPI_ERR_IN_STATUS; mpi_errno = MPI_ERR_IN_STATUS;
} }
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{ {
mpi_errno = MPI_ERR_IN_STATUS; mpi_errno = MPI_ERR_IN_STATUS;
......
...@@ -187,7 +187,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx, ...@@ -187,7 +187,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
n_inactive += 1; n_inactive += 1;
} }
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{ {
last_disabled_anysource = i; last_disabled_anysource = i;
......
...@@ -199,7 +199,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount, ...@@ -199,7 +199,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
n_inactive += 1; n_inactive += 1;
} }
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{ {
mpi_errno = MPI_ERR_IN_STATUS; mpi_errno = MPI_ERR_IN_STATUS;
......
...@@ -51,7 +51,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status) ...@@ -51,7 +51,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
* anysource disabled, convert the call to an MPI_Test instead so we * anysource disabled, convert the call to an MPI_Test instead so we
* don't get stuck in the progress engine. */ * don't get stuck in the progress engine. */
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank && MPID_Request_is_anysource(request_ptr) &&
!MPID_Comm_AS_enabled(request_ptr->comm))) { !MPID_Comm_AS_enabled(request_ptr->comm))) {
mpi_errno = MPIR_Test_impl(request, &active_flag, status); mpi_errno = MPIR_Test_impl(request, &active_flag, status);
goto fn_exit; goto fn_exit;
...@@ -84,7 +84,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status) ...@@ -84,7 +84,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
if (unlikely( if (unlikely(
MPIR_CVAR_ENABLE_FT && MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank && MPID_Request_is_anysource(request_ptr) &&
!MPID_Request_is_complete(request_ptr) && !MPID_Request_is_complete(request_ptr) &&
!MPID_Comm_AS_enabled(request_ptr->comm))) { !MPID_Comm_AS_enabled(request_ptr->comm))) {
MPID_Progress_end(&progress_state); MPID_Progress_end(&progress_state);
......
...@@ -92,7 +92,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[], ...@@ -92,7 +92,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
* disabled such communication, convert this operation to a testall * disabled such communication, convert this operation to a testall
* instead to prevent getting stuck in the progress engine. */ * instead to prevent getting stuck in the progress engine. */
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Request_is_complete(request_ptrs[i]) && !MPID_Request_is_complete(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) { !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
disabled_anysource = TRUE; disabled_anysource = TRUE;
...@@ -134,7 +134,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[], ...@@ -134,7 +134,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
if (unlikely(mpi_errno)) { if (unlikely(mpi_errno)) {
/* --BEGIN ERROR HANDLING-- */ /* --BEGIN ERROR HANDLING-- */
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Request_is_complete(request_ptrs[i]) && !MPID_Request_is_complete(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) { !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
MPIU_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus"); MPIU_ERR_SET(mpi_errno, MPI_ERR_IN_STATUS, "**instatus");
...@@ -188,7 +188,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[], ...@@ -188,7 +188,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
MPIU_ERR_POP(mpi_errno); MPIU_ERR_POP(mpi_errno);
/* --END ERROR HANDLING-- */ /* --END ERROR HANDLING-- */
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Request_is_complete(request_ptrs[i]) && !MPID_Request_is_complete(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) { !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
/* Check for pending failures */ /* Check for pending failures */
......
...@@ -186,7 +186,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx, ...@@ -186,7 +186,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
} }
} }
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) { !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
last_disabled_anysource = i; last_disabled_anysource = i;
} }
......
...@@ -165,7 +165,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[], ...@@ -165,7 +165,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
* disabled such communication, convert this operation to a testall * disabled such communication, convert this operation to a testall
* instead to prevent getting stuck in the progress engine. */ * instead to prevent getting stuck in the progress engine. */
if (unlikely(MPIR_CVAR_ENABLE_FT && if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Request_is_complete(request_ptrs[i]) && !MPID_Request_is_complete(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) { !MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
disabled_anysource = TRUE; disabled_anysource = TRUE;
...@@ -240,7 +240,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[], ...@@ -240,7 +240,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
n_inactive += 1; n_inactive += 1;
} }
} else if (unlikely(MPIR_CVAR_ENABLE_FT && } else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank && MPID_Request_is_anysource(request_ptrs[i]) &&
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) !MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{ {
mpi_errno = MPI_ERR_IN_STATUS; mpi_errno = MPI_ERR_IN_STATUS;
......
...@@ -156,3 +156,11 @@ int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr) { ...@@ -156,3 +156,11 @@ int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr) {
return comm_ptr->dev.anysource_enabled; return comm_ptr->dev.anysource_enabled;
} }
#undef FUNCNAME
#define FUNCNAME MPID_Request_is_anysource
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPID_Request_is_anysource(MPID_Request *request_ptr) {
return request_ptr->dev.match.parts.rank == MPI_ANY_SOURCE;
}
...@@ -108,3 +108,11 @@ int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr) ...@@ -108,3 +108,11 @@ int MPID_Comm_AS_enabled(MPID_Comm *comm_ptr)
* by the implementation. */ * by the implementation. */
return 1; return 1;
} }
int MPID_Request_is_anysource(MPID_Request *request_ptr)
{
/* This function must not abort in the default case since it is used in many
* MPI functions. As long as the device does not implement FT, it doesn't
* matter what this function returns. */
return 0;
}
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