Commit 3850e6bf authored by Wesley Bland's avatar Wesley Bland
Browse files

Change errflag to be an enum



The errflag value being used in the MPIC helper functions only
propagated whether or not an error occurred. It did not contain any
information about what kind of error occurred, which made returning the
correct error code after a process failure impossible.

This patch converts the binary value to an enum with three options:
MPIR_ERR_NONE
MPIR_ERR_PROC_FAILED
MPIR_ERR_OTHER

The original use of TRUE and false maps to MPIR_ERR_NONE and
MPIR_ERR_OTHER.

MPIR_ERR_PROC_FAILED indicates that the error occurred
because of a process failure. It uses the new bit set aside from the tag
space to track such information between processes.

This change required modifying lots of function signatures and type
declarations to use the new enum type, but these are actually not very
intrusive changes and shouldn't be a problem going forward.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 46f59276
This diff is collapsed.
......@@ -117,7 +117,7 @@ int MPIR_Allgather_intra (
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
......@@ -657,7 +657,7 @@ int MPIR_Allgather_inter (
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
/* Intercommunicator Allgather.
Each group does a gather to local root with the local
......@@ -789,7 +789,7 @@ int MPIR_Allgather_inter (
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -823,7 +823,7 @@ fn_fail:
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allgather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -904,7 +904,7 @@ int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLGATHER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -98,7 +98,7 @@ int MPIR_Allgatherv_intra (
const int *displs,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
MPI_Comm comm;
int comm_size, rank, j, i, left, right;
......@@ -771,7 +771,7 @@ int MPIR_Allgatherv_inter (
const int *displs,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
/* Intercommunicator Allgatherv.
This is done differently from the intercommunicator allgather
......@@ -894,7 +894,7 @@ int MPIR_Allgatherv_inter (
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -930,7 +930,7 @@ int MPIR_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allgatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs,
MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag)
MPI_Datatype recvtype, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -1015,7 +1015,7 @@ int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLGATHERV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -9,7 +9,7 @@
int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
MPID_Group *group_ptr, int tag, int *errflag);
MPID_Group *group_ptr, int tag, mpir_errflag_t *errflag);
/* Local utility macro: takes an two args and sets lvalue cr_ equal to the rank
* in comm_ptr corresponding to rvalue gr_ */
......@@ -27,7 +27,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
MPID_Group *group_ptr, int tag, int *errflag)
MPID_Group *group_ptr, int tag, mpir_errflag_t *errflag)
{
MPI_Aint type_size;
int mpi_errno = MPI_SUCCESS;
......@@ -367,7 +367,7 @@ int MPIR_Allreduce_group_intra(void *sendbuf, void *recvbuf, int count,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allreduce_group(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
MPID_Group *group_ptr, int tag, int *errflag)
MPID_Group *group_ptr, int tag, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......
......@@ -149,7 +149,7 @@ MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[] = {
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static inline int allreduce_intra_or_coll_fn(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -183,7 +183,7 @@ int MPIR_Allreduce_intra (
MPI_Datatype datatype,
MPI_Op op,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
#ifdef MPID_HAS_HETERO
int is_homogeneous;
......@@ -626,7 +626,7 @@ int MPIR_Allreduce_inter (
MPI_Datatype datatype,
MPI_Op op,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
/* Intercommunicator Allreduce.
We first do intracommunicator reduces to rank 0 on left and right
......@@ -719,7 +719,7 @@ int MPIR_Allreduce_inter (
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr, int *errflag)
MPI_Op op, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -750,7 +750,7 @@ fn_fail:
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Allreduce_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -821,7 +821,7 @@ int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count,
static const char FCNAME[] = "MPI_Allreduce";
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLREDUCE);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -135,7 +135,7 @@ int MPIR_Alltoall_intra(
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
int comm_size, i, j, pof2;
MPI_Aint sendtype_extent, recvtype_extent;
......@@ -629,7 +629,7 @@ int MPIR_Alltoall_inter(
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
/* Intercommunicator alltoall. We use a pairwise exchange algorithm
similar to the one used in intracommunicator alltoall for long
......@@ -717,7 +717,7 @@ int MPIR_Alltoall_inter(
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -747,7 +747,7 @@ int MPIR_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Alltoall_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
if (comm_ptr->coll_fns != NULL && comm_ptr->coll_fns->Alltoall != NULL) {
......@@ -807,7 +807,7 @@ int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLTOALL);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -63,7 +63,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls
int MPIR_Alltoallv_intra(const void *sendbuf, const int *sendcounts, const int *sdispls,
MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
const int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int comm_size, i, j;
MPI_Aint send_extent, recv_extent;
......@@ -240,7 +240,7 @@ fn_fail:
int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *sdispls,
MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
const int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
/* Intercommunicator alltoallv. We use a pairwise exchange algorithm
similar to the one used in intracommunicator alltoallv. Since the
......@@ -334,7 +334,7 @@ int MPIR_Alltoallv_inter(const void *sendbuf, const int *sendcounts, const int *
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls,
MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *rdispls,
MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag)
MPI_Datatype recvtype, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -365,7 +365,7 @@ int MPIR_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispl
int MPIR_Alltoallv_impl(const void *sendbuf, const int *sendcounts, const int *sdispls,
MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
const int *rdispls, MPI_Datatype recvtype,
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -440,7 +440,7 @@ int MPI_Alltoallv(const void *sendbuf, const int *sendcounts,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLTOALLV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -57,7 +57,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls
int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int sdispls[],
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
const int rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int comm_size, i, j;
int mpi_errno = MPI_SUCCESS;
......@@ -240,7 +240,7 @@ int MPIR_Alltoallw_intra(const void *sendbuf, const int sendcounts[], const int
int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int sdispls[],
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
const int rdispls[], const MPI_Datatype recvtypes[], MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
/* Intercommunicator alltoallw. We use a pairwise exchange algorithm
similar to the one used in intracommunicator alltoallw. Since the
......@@ -329,7 +329,7 @@ int MPIR_Alltoallw_inter(const void *sendbuf, const int sendcounts[], const int
int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispls[],
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
const int rdispls[], const MPI_Datatype recvtypes[],
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -360,7 +360,7 @@ int MPIR_Alltoallw(const void *sendbuf, const int sendcounts[], const int sdispl
int MPIR_Alltoallw_impl(const void *sendbuf, const int sendcounts[], const int sdispls[],
const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
const int rdispls[], const MPI_Datatype recvtypes[],
MPID_Comm *comm_ptr, int *errflag)
MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -435,7 +435,7 @@ int MPI_Alltoallw(const void *sendbuf, const int sendcounts[],
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_ALLTOALLW);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -67,7 +67,7 @@ int MPI_Barrier(MPI_Comm comm) __attribute__((weak,alias("PMPI_Barrier")));
#define FUNCNAME barrier_smp_intra
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
static int barrier_smp_intra(MPID_Comm *comm_ptr, int *errflag)
static int barrier_smp_intra(MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno=MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -128,7 +128,7 @@ static int barrier_smp_intra(MPID_Comm *comm_ptr, int *errflag)
#define FUNCNAME MPIR_Barrier_intra
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Barrier_intra( MPID_Comm *comm_ptr, int *errflag )
int MPIR_Barrier_intra( MPID_Comm *comm_ptr, mpir_errflag_t *errflag )
{
int size, rank, src, dst, mask, mpi_errno=MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -191,7 +191,7 @@ int MPIR_Barrier_intra( MPID_Comm *comm_ptr, int *errflag )
#define FUNCNAME MPIR_Barrier_inter
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Barrier_inter( MPID_Comm *comm_ptr, int *errflag )
int MPIR_Barrier_inter( MPID_Comm *comm_ptr, mpir_errflag_t *errflag )
{
int rank, mpi_errno = MPI_SUCCESS, root;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -284,7 +284,7 @@ t-to-point messages.
#define FUNCNAME MPIR_Barrier
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Barrier(MPID_Comm *comm_ptr, int *errflag)
int MPIR_Barrier(MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -313,7 +313,7 @@ int MPIR_Barrier(MPID_Comm *comm_ptr, int *errflag)
#define FUNCNAME MPIR_Barrier_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Barrier_impl(MPID_Comm *comm_ptr, int *errflag)
int MPIR_Barrier_impl(MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -375,7 +375,7 @@ int MPI_Barrier( MPI_Comm comm )
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_BARRIER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -13,7 +13,7 @@
This is an intracommunicator barrier only!
*/
int MPIR_Barrier_group( MPID_Comm *comm_ptr, MPID_Group *group_ptr, int tag, int *errflag )
int MPIR_Barrier_group( MPID_Comm *comm_ptr, MPID_Group *group_ptr, int tag, mpir_errflag_t *errflag )
{
int src = 0;
int dst, mpi_errno = MPI_SUCCESS;
......
......@@ -127,7 +127,7 @@ static int MPIR_Bcast_binomial(
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int rank, comm_size, src, dst;
int relative_rank, mask;
......@@ -340,7 +340,7 @@ static int scatter_for_bcast(
void *tmp_buf,
int is_contig,
int is_homogeneous,
int *errflag)
mpir_errflag_t *errflag)
{
MPI_Status status;
int rank, comm_size, src, dst;
......@@ -484,7 +484,7 @@ static int MPIR_Bcast_scatter_doubling_allgather(
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
MPI_Status status;
int rank, comm_size, dst;
......@@ -794,7 +794,7 @@ static int MPIR_Bcast_scatter_ring_allgather(
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int rank, comm_size;
int mpi_errno = MPI_SUCCESS;
......@@ -1002,7 +1002,7 @@ static int MPIR_SMP_Bcast(
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -1229,7 +1229,7 @@ int MPIR_Bcast_intra (
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
int mpi_errno = MPI_SUCCESS;
int mpi_errno_ret = MPI_SUCCESS;
......@@ -1353,7 +1353,7 @@ int MPIR_Bcast_inter (
MPI_Datatype datatype,
int root,
MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
/* Intercommunicator broadcast.
Root sends to rank 0 in remote group. Remote group does local
......@@ -1444,7 +1444,7 @@ fn_fail:
#define FUNCNAME MPIR_Bcast_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, int *errflag)
int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -1476,7 +1476,7 @@ int MPIR_Bcast_impl(void *buffer, int count, MPI_Datatype datatype, int root, MP
#define FUNCNAME MPIR_Bcast
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
inline int MPIR_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, int *errflag)
inline int MPIR_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -1535,7 +1535,7 @@ int MPI_Bcast( void *buffer, int count, MPI_Datatype datatype, int root,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_BCAST);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -91,7 +91,7 @@ int MPIR_Exscan (
MPI_Datatype datatype,
MPI_Op op,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
MPI_Status status;
int rank, comm_size;
......@@ -240,7 +240,7 @@ fn_fail:
#define FUNCNAME MPIR_Exscan_impl
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Exscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag)
int MPIR_Exscan_impl(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -307,7 +307,7 @@ int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datat
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_EXSCAN);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -87,7 +87,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
......@@ -492,7 +492,7 @@ int MPIR_Gather_intra(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr,
int *errflag)
mpir_errflag_t *errflag)
{
/* Intercommunicator gather.
For short messages, remote group does a local intracommunicator
......@@ -664,7 +664,7 @@ int MPIR_Gather_inter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr, int *errflag)
int root, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -698,7 +698,7 @@ int MPIR_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Gather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr, int *errflag)
int root, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -764,7 +764,7 @@ int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GATHER);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -83,7 +83,7 @@ int MPIR_Gatherv (
MPI_Datatype recvtype,
int root,
MPID_Comm *comm_ptr,
int *errflag )
mpir_errflag_t *errflag )
{
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
......@@ -219,7 +219,7 @@ fn_fail:
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIR_Gatherv_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr, int *errflag)
int root, MPID_Comm *comm_ptr, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
......@@ -289,7 +289,7 @@ int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
{
int mpi_errno = MPI_SUCCESS;
MPID_Comm *comm_ptr = NULL;
int errflag = FALSE;
mpir_errflag_t errflag = MPIR_ERR_NONE;
MPID_MPI_STATE_DECL(MPID_STATE_MPI_GATHERV);
MPIR_ERRTEST_INITIALIZED_ORDIE();
......
......@@ -252,7 +252,7 @@ int MPIC_Wait(MPID_Request * request_ptr)
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, int *errflag)
MPI_Comm comm, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -262,13 +262,19 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_SEND);
MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
if (*errflag)
MPIR_TAG_SET_ERROR_BIT(tag);
switch(*errflag) {
case MPIR_ERR_NONE:
break;
case MPIR_ERR_PROC_FAILED:
MPIR_TAG_SET_PROC_FAILURE_BIT(tag);
case MPIR_ERR_OTHER:
MPIR_TAG_SET_ERROR_BIT(tag);
}
MPID_Comm_get_ptr(comm, comm_ptr);
context_id = (comm_ptr->comm_kind == MPID_INTRACOMM) ?
......@@ -298,7 +304,7 @@ int MPIC_Send(const void *buf, int count, MPI_Datatype datatype, int dest, int t
#undef FCNAME
#define FCNAME MPIU_QUOTE(FUNCNAME)
int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status, int *errflag)
MPI_Comm comm, MPI_Status *status, mpir_errflag_t *errflag)
{
int mpi_errno = MPI_SUCCESS;
int context_id;
......@@ -309,7 +315,7 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPIDI_FUNC_ENTER(MPID_STATE_MPIC_RECV);
MPIU_DBG_MSG_S(PT2PT, TYPICAL, "IN: errflag = %s", *errflag?"TRUE":"FALSE");
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "IN: errflag = %d", *errflag);
MPIU_ERR_CHKANDJUMP1((count < 0), mpi_errno, MPI_ERR_COUNT,
"**countneg", "**countneg %d", count);
......@@ -338,15 +344,20 @@ int MPIC_Recv(void *buf, int count, MPI_Datatype datatype, int source, int tag,
if (MPIX_ERR_REVOKED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
MPIX_ERR_PROC_FAILED == MPIR_ERR_GET_CLASS(status->MPI_ERROR) ||
MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
*errflag = TRUE;
MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
if (MPIR_TAG_CHECK_PROC_FAILURE_BIT(status->MPI_TAG)) {
*errflag = MPIR_ERR_PROC_FAILED;
MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
} else if (MPIR_TAG_CHECK_ERROR_BIT(status->MPI_TAG)) {
*errflag = MPIR_ERR_OTHER;
MPIR_TAG_CLEAR_ERROR_BITS(status->MPI_TAG);
}
} else if (MPI_SUCCESS == MPIR_ERR_GET_CLASS(status->MPI_ERROR)) {
MPIU_Assert(status->MPI_TAG == tag);
}
}
fn_exit:
MPIU_DBG_MSG_S(PT2PT, TYPICAL, "OUT: errflag = %s", *errflag?"TRUE":"FALSE");
MPIU_DBG_MSG_D(PT2PT, TYPICAL, "OUT: errflag = %d", *errflag);
MPIDI_FUNC_EXIT(MPID_STATE_MPIC_RECV);