Commit 3325b6f7 authored by Wesley Bland's avatar Wesley Bland Committed by Junchao Zhang
Browse files

Return MPIX_ERR_PROC_FAILED_PENDING when appropriate



The MPI_Waitall and MPI_Testall functions should return
MPIX_ERR_PROC_FAILED_PENDING when a process failure prevents the operations
from completing.
Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
parent ed98c983
......@@ -87,6 +87,7 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
int n_completed;
int active_flag;
int rc;
int proc_failure = 0;
int mpi_errno = MPI_SUCCESS;
MPIU_CHKLMEM_DECL(1);
MPID_MPI_STATE_DECL(MPID_STATE_MPI_TESTALL);
......@@ -168,10 +169,13 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
if (request_ptrs[i] != NULL && MPID_Request_is_complete(request_ptrs[i]))
{
n_completed++;
if (MPIR_Request_get_error(request_ptrs[i]) != MPI_SUCCESS)
{
mpi_errno = MPI_ERR_IN_STATUS;
}
rc = MPIR_Request_get_error(request_ptrs[i]);
if (rc != MPI_SUCCESS)
{
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc))
proc_failure = 1;
mpi_errno = MPI_ERR_IN_STATUS;
}
}
}
......@@ -203,7 +207,10 @@ int MPI_Testall(int count, MPI_Request array_of_requests[], int *flag,
{
if (mpi_errno == MPI_ERR_IN_STATUS && array_of_statuses != MPI_STATUSES_IGNORE)
{
array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
if (!proc_failure)
array_of_statuses[i].MPI_ERROR = MPI_ERR_PENDING;
else
array_of_statuses[i].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
}
}
}
......
......@@ -47,6 +47,7 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
int active_flag;
int rc;
int n_greqs;
int proc_failure = 0;
const int ignoring_statuses = (array_of_statuses == MPI_STATUSES_IGNORE);
int optimize = ignoring_statuses; /* see NOTE-O1 */
MPIU_CHKLMEM_DECL(1);
......@@ -180,6 +181,12 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
{
/* req completed with an error */
mpi_errno = MPI_ERR_IN_STATUS;
if (!proc_failure) {
if (MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(rc))
proc_failure = 1;
}
if (!ignoring_statuses)
{
/* set the error code for this request */
......@@ -197,7 +204,10 @@ int MPIR_Waitall_impl(int count, MPI_Request array_of_requests[],
}
else
{
array_of_statuses[j].MPI_ERROR = MPI_ERR_PENDING;
if (!proc_failure)
array_of_statuses[j].MPI_ERROR = MPI_ERR_PENDING;
else
array_of_statuses[j].MPI_ERROR = MPIX_ERR_PROC_FAILED_PENDING;
}
}
}
......
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