Commit 8cbbcae4 authored by Wesley Bland's avatar Wesley Bland Committed by Huiwei Lu
Browse files

Change MPIDI_CH3I_Comm_AS_enabled to be MPID level



This macro was used inside CH3 to determine if the communicator could be
used for anysource communication. With the rewrite of the anysource
fault tolerance logic, it is now necessary to use it at the MPI level.
Because it is a macro and not a function, the macro is defined in
mpiimple.h as (1) and then overwritten in the ch3 device. Future devices
can also overwrite it if desired.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 9f2db553
......@@ -1283,6 +1283,9 @@ int MPIR_Comm_delete_internal(MPID_Comm * comm_ptr, int isDisconnect);
do { MPIU_Object_add_ref((_comm)); } while (0)
#define MPIR_Comm_release_ref( _comm, _inuse ) \
do { MPIU_Object_release_ref( _comm, _inuse ); } while (0)
#ifndef MPID_Comm_AS_enabled
#define MPID_Comm_AS_enabled(comm) (1)
#endif
/* Release a reference to a communicator. If there are no pending
......
......@@ -166,7 +166,7 @@ int MPI_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
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))) {
!MPID_Comm_AS_enabled(request_ptr->comm))) {
/* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(request_ptr);
MPIR_STATUS_SET_CANCEL_BIT(request_ptr->status, FALSE);
......
......@@ -193,7 +193,7 @@ int MPI_Sendrecv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
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))) {
!MPID_Comm_AS_enabled(rreq->comm))) {
/* --BEGIN ERROR HANDLING-- */
MPID_Cancel_recv(rreq);
MPIR_STATUS_SET_CANCEL_BIT(rreq->status, FALSE);
......
......@@ -69,7 +69,7 @@ int MPIR_Test_impl(MPI_Request *request, int *flag, MPI_Status *status)
} else if (unlikely(
MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank &&
!MPIDI_CH3I_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");
if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
goto fn_fail;
......
......@@ -180,7 +180,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
}
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm)))
!MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{
mpi_errno = MPI_ERR_IN_STATUS;
MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
......
......@@ -188,7 +188,7 @@ int MPI_Testany(int count, MPI_Request array_of_requests[], int *indx,
}
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm)))
!MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{
last_disabled_anysource = i;
}
......
......@@ -200,7 +200,7 @@ int MPI_Testsome(int incount, MPI_Request array_of_requests[], int *outcount,
}
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm)))
!MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{
mpi_errno = MPI_ERR_IN_STATUS;
MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
......
......@@ -52,7 +52,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
* don't get stuck in the progress engine. */
if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptr->comm))) {
!MPID_Comm_AS_enabled(request_ptr->comm))) {
mpi_errno = MPIR_Test_impl(request, &active_flag, status);
goto fn_exit;
}
......@@ -86,7 +86,7 @@ int MPIR_Wait_impl(MPI_Request *request, MPI_Status *status)
MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptr->dev.match.parts.rank &&
!MPID_Request_is_complete(request_ptr) &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptr->comm))) {
!MPID_Comm_AS_enabled(request_ptr->comm))) {
MPID_Progress_end(&progress_state);
MPIU_ERR_SET(mpi_errno, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
if (status != MPI_STATUS_IGNORE) status->MPI_ERROR = mpi_errno;
......
......@@ -94,7 +94,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPID_Request_is_complete(request_ptrs[i]) &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm))) {
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
disabled_anysource = TRUE;
}
}
......@@ -136,7 +136,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPID_Request_is_complete(request_ptrs[i]) &&
!MPIDI_CH3I_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");
}
MPID_Progress_end(&progress_state);
......@@ -190,7 +190,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPID_Request_is_complete(request_ptrs[i]) &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm))) {
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
/* Check for pending failures */
MPID_Progress_end(&progress_state);
MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
......
......@@ -187,7 +187,7 @@ int MPI_Waitany(int count, MPI_Request array_of_requests[], int *indx,
}
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm))) {
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
last_disabled_anysource = i;
}
}
......
......@@ -167,7 +167,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPID_Request_is_complete(request_ptrs[i]) &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm))) {
!MPID_Comm_AS_enabled(request_ptrs[i]->comm))) {
disabled_anysource = TRUE;
}
}
......@@ -241,7 +241,7 @@ int MPI_Waitsome(int incount, MPI_Request array_of_requests[],
}
} else if (unlikely(MPIR_CVAR_ENABLE_FT &&
MPI_ANY_SOURCE == request_ptrs[i]->dev.match.parts.rank &&
!MPIDI_CH3I_Comm_AS_enabled(request_ptrs[i]->comm)))
!MPID_Comm_AS_enabled(request_ptrs[i]->comm)))
{
mpi_errno = MPI_ERR_IN_STATUS;
MPIU_ERR_SET(rc, MPIX_ERR_PROC_FAILED_PENDING, "**failure_pending");
......
......@@ -166,7 +166,8 @@ typedef union {
#define MPID_Dev_comm_create_hook(comm_) MPIDI_CH3I_Comm_create_hook(comm_)
#define MPID_Dev_comm_destroy_hook(comm_) MPIDI_CH3I_Comm_destroy_hook(comm_)
#define MPIDI_CH3I_Comm_AS_enabled(comm) ((comm)->dev.anysource_enabled)
#undef MPID_Comm_AS_enabled
#define MPID_Comm_AS_enabled(comm) ((comm)->dev.anysource_enabled)
typedef struct MPIDI_CH3I_comm
{
......
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