Commit 2a85168c authored by Darius Buntinas's avatar Darius Buntinas
Browse files

[svn-r7803] merging error returns for collective branch into trunk

parent 973ac801
......@@ -1739,35 +1739,35 @@ typedef struct MPID_Collops {
int ref_count; /* Supports lazy copies */
/* Contains pointers to the functions for the MPI collectives */
int (*Barrier) (MPID_Comm *);
int (*Bcast) (void*, int, MPI_Datatype, int, MPID_Comm * );
int (*Bcast) (void*, int, MPI_Datatype, int, MPID_Comm *, int *);
int (*Gather) (void*, int, MPI_Datatype, void*, int, MPI_Datatype,
int, MPID_Comm *);
int, MPID_Comm *, int *);
int (*Gatherv) (void*, int, MPI_Datatype, void*, int *, int *,
MPI_Datatype, int, MPID_Comm *);
MPI_Datatype, int, MPID_Comm *, int *);
int (*Scatter) (void*, int, MPI_Datatype, void*, int, MPI_Datatype,
int, MPID_Comm *);
int, MPID_Comm *, int *);
int (*Scatterv) (void*, int *, int *, MPI_Datatype, void*, int,
MPI_Datatype, int, MPID_Comm *);
MPI_Datatype, int, MPID_Comm *, int *);
int (*Allgather) (void*, int, MPI_Datatype, void*, int,
MPI_Datatype, MPID_Comm *);
MPI_Datatype, MPID_Comm *, int *);
int (*Allgatherv) (void*, int, MPI_Datatype, void*, int *, int *,
MPI_Datatype, MPID_Comm *);
MPI_Datatype, MPID_Comm *, int *);
int (*Alltoall) (void*, int, MPI_Datatype, void*, int, MPI_Datatype,
MPID_Comm *);
MPID_Comm *, int *);
int (*Alltoallv) (void*, int *, int *, MPI_Datatype, void*, int *,
int *, MPI_Datatype, MPID_Comm *);
int *, MPI_Datatype, MPID_Comm *, int *);
int (*Alltoallw) (void*, int *, int *, MPI_Datatype *, void*, int *,
int *, MPI_Datatype *, MPID_Comm *);
int *, MPI_Datatype *, MPID_Comm *, int *);
int (*Reduce) (void*, void*, int, MPI_Datatype, MPI_Op, int,
MPID_Comm *);
MPID_Comm *, int *);
int (*Allreduce) (void*, void*, int, MPI_Datatype, MPI_Op,
MPID_Comm *);
MPID_Comm *, int *);
int (*Reduce_scatter) (void*, void*, int *, MPI_Datatype, MPI_Op,
MPID_Comm *);
int (*Scan) (void*, void*, int, MPI_Datatype, MPI_Op, MPID_Comm * );
int (*Exscan) (void*, void*, int, MPI_Datatype, MPI_Op, MPID_Comm * );
MPID_Comm *, int *);
int (*Scan) (void*, void*, int, MPI_Datatype, MPI_Op, MPID_Comm *, int * );
int (*Exscan) (void*, void*, int, MPI_Datatype, MPI_Op, MPID_Comm *, int * );
int (*Reduce_scatter_block) (void*, void*, int, MPI_Datatype, MPI_Op,
MPID_Comm *);
MPID_Comm *, int *);
/* MPI-3 nonblocking collectives */
int (*Ibarrier)(MPID_Comm *comm_ptr, MPID_Sched_t s);
......@@ -3260,6 +3260,7 @@ int MPID_VCR_Get_lpid(MPID_VCR vcr, int * lpid_ptr);
#define MPIR_TOPO_A_TAG 26
#define MPIR_TOPO_B_TAG 27
#define MPIR_REDUCE_SCATTER_BLOCK_TAG 28
#define MPIR_ERROR_TAG 29
/* These functions are used in the implementation of collective and
other internal operations. They are wrappers around MPID send/recv
......@@ -3288,6 +3289,28 @@ int MPIC_Isend(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
int MPIC_Wait(MPID_Request * request_ptr);
int MPIC_Probe(int source, int tag, MPI_Comm comm, MPI_Status *status);
/* FT versions of te MPIC_ functions */
int MPIC_Send_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, int *errflag);
int MPIC_Recv_ft(void *buf, int count, MPI_Datatype datatype, int source, int tag,
MPI_Comm comm, MPI_Status *status, int *errflag);
int MPIC_Ssend_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, int *errflag);
int MPIC_Sendrecv_ft(void *sendbuf, int sendcount, MPI_Datatype sendtype,
int dest, int sendtag, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int source, int recvtag,
MPI_Comm comm, MPI_Status *status, int *errflag);
int MPIC_Sendrecv_replace_ft(void *buf, int count, MPI_Datatype datatype,
int dest, int sendtag,
int source, int recvtag,
MPI_Comm comm, MPI_Status *status, int *errflag);
int MPIC_Isend_ft(void *buf, int count, MPI_Datatype datatype, int dest, int tag,
MPI_Comm comm, MPI_Request *request, int *errflag);
int MPIC_Irecv_ft(void *buf, int count, MPI_Datatype datatype, int source,
int tag, MPI_Comm comm, MPI_Request *request);
int MPIC_Waitall_ft(int numreq, MPI_Request requests[], MPI_Status statuses[], int *errflag);
void MPIR_MAXF ( void *, void *, int *, MPI_Datatype * ) ;
void MPIR_MINF ( void *, void *, int *, MPI_Datatype * ) ;
void MPIR_SUM ( void *, void *, int *, MPI_Datatype * ) ;
......@@ -3330,160 +3353,160 @@ extern MPIR_Op_check_dtype_fn *MPIR_Op_check_dtype_table[];
int MPIR_Allgather_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr );
MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr );
MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgather_intra(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr );
MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgather_inter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr );
MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgatherv_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPID_Comm *comm_ptr );
MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPID_Comm *comm_ptr );
MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allgatherv_intra(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPID_Comm *comm_ptr );
MPI_Datatype recvtype, MPID_Comm *comm_pt, int *errflag );
int MPIR_Allgatherv_inter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, MPID_Comm *comm_ptr );
MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Allreduce_impl(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Allreduce(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Allreduce_intra(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Allreduce_inter(void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoall_impl(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoall_intra(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoall_inter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallv_impl(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype sendtype, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallv(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype sendtype, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallv_intra(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype sendtype, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype recvtype, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallv_inter(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype sendtype, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype recvtype,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallw_impl(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallw(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallw_intra(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts,
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr);
int *rdispls, MPI_Datatype *recvtypes, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Alltoallw_inter(void *sendbuf, int *sendcnts, int *sdispls,
MPI_Datatype *sendtypes, void *recvbuf,
int *recvcnts, int *rdispls, MPI_Datatype *recvtypes,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Bcast_inter(void *buffer, int count, MPI_Datatype datatype,
int root, MPID_Comm *comm_ptr);
int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Bcast_intra (void *buffer, int count, MPI_Datatype datatype, int
root, MPID_Comm *comm_ptr);
root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Bcast (void *buffer, int count, MPI_Datatype datatype, int
root, MPID_Comm *comm_ptr);
root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Bcast_impl (void *buffer, int count, MPI_Datatype datatype, int
root, MPID_Comm *comm_ptr);
root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr );
MPI_Op op, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Exscan_impl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr );
MPI_Op op, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Gather_impl (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr);
int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Gather (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr);
int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Gather_intra (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr);
int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Gather_inter (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr );
int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Gatherv (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int *recvcnts, int *displs,
MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr);
MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Gatherv_impl (void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int *recvcnts, int *displs,
MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr);
MPI_Datatype recvtype, int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Reduce_scatter_impl(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Reduce_scatter_intra(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr);
MPI_Datatype datatype, MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Reduce_scatter_inter(void *sendbuf, void *recvbuf, int *recvcnts,
MPI_Datatype datatype, MPI_Op op,
MPID_Comm *comm_ptr);
MPID_Comm *comm_ptr, int *errflag);
int MPIR_Reduce_scatter_block_impl(void *sendbuf, void *recvbuf, int recvcount,
MPI_Datatype datatype, MPI_Op op, MPID_Comm
*comm_ptr );
*comm_ptr, int *errflag );
int MPIR_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount,
MPI_Datatype datatype, MPI_Op op, MPID_Comm
*comm_ptr );
*comm_ptr, int *errflag );
int MPIR_Reduce_scatter_block_intra(void *sendbuf, void *recvbuf, int recvcount,
MPI_Datatype datatype, MPI_Op op, MPID_Comm
*comm_ptr );
*comm_ptr, int *errflag );
int MPIR_Reduce_scatter_block_inter(void *sendbuf, void *recvbuf, int recvcount,
MPI_Datatype datatype, MPI_Op op, MPID_Comm
*comm_ptr);
*comm_ptr, int *errflag);
int MPIR_Reduce_impl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, MPID_Comm *comm_ptr );
MPI_Op op, int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, MPID_Comm *comm_ptr );
MPI_Op op, int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Reduce_intra(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, MPID_Comm *comm_ptr );
MPI_Op op, int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Reduce_inter (void *sendbuf, void *recvbuf, int count, MPI_Datatype
datatype, MPI_Op op, int root, MPID_Comm *comm_ptr);
datatype, MPI_Op op, int root, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Scan_impl(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr);
MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, MPID_Comm *comm_ptr);
MPI_Op op, MPID_Comm *comm_ptr, int *errflag);
int MPIR_Scatter_impl(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr );
int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Scatter(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr );
int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Scatter_intra(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr );
int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Scatter_inter(void *sendbuf, int sendcnt, MPI_Datatype sendtype,
void *recvbuf, int recvcnt, MPI_Datatype recvtype,
int root, MPID_Comm *comm_ptr );
int root, MPID_Comm *comm_ptr, int *errflag );
int MPIR_Scatterv_impl (void *sendbuf, int *sendcnts, int *displs,
MPI_Datatype sendtype, void *recvbuf, int recvcnt,
MPI_Datatype recvtype, int root, MPID_Comm
*comm_ptr);
*comm_ptr, int *errflag);
int MPIR_Scatterv (void *sendbuf, int *sendcnts, int *displs,
MPI_Datatype sendtype, void *recvbuf, int recvcnt,
MPI_Datatype recvtype, int root, MPID_Comm
*comm_ptr);
*comm_ptr, int *errflag);
int MPIR_Barrier_impl( MPID_Comm *comm_ptr);
int MPIR_Barrier( MPID_Comm *comm_ptr);
int MPIR_Barrier_intra( MPID_Comm *comm_ptr );
int MPIR_Barrier_intra( MPID_Comm *comm_ptr);
int MPIR_Barrier_inter( MPID_Comm *comm_ptr);
int MPIR_Reduce_local_impl(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op);
......
......@@ -81,7 +81,8 @@ int MPIR_Allgather_intra (
void *recvbuf,
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr )
MPID_Comm *comm_ptr,
int *errflag )
{
int comm_size, rank;
int mpi_errno = MPI_SUCCESS;
......@@ -167,15 +168,16 @@ int MPIR_Allgather_intra (
recv_offset = dst_tree_root * recvcount * recvtype_extent;
if (dst < comm_size) {
mpi_errno = MPIC_Sendrecv(((char *)recvbuf + send_offset),
curr_cnt, recvtype, dst,
MPIR_ALLGATHER_TAG,
((char *)recvbuf + recv_offset),
(comm_size-dst_tree_root)*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm, &status);
mpi_errno = MPIC_Sendrecv_ft(((char *)recvbuf + send_offset),
curr_cnt, recvtype, dst,
MPIR_ALLGATHER_TAG,
((char *)recvbuf + recv_offset),
(comm_size-dst_tree_root)*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
last_recv_cnt = 0;
......@@ -231,15 +233,16 @@ int MPIR_Allgather_intra (
if ((dst > rank) &&
(rank < tree_root + nprocs_completed)
&& (dst >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Send(((char *)recvbuf + offset),
last_recv_cnt,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm);
mpi_errno = MPIC_Send_ft(((char *)recvbuf + offset),
last_recv_cnt,
recvtype, dst,
MPIR_ALLGATHER_TAG, comm, errflag);
/* last_recv_cnt was set in the previous
receive. that's the amount of data to be
sent now. */
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -249,15 +252,16 @@ int MPIR_Allgather_intra (
else if ((dst < rank) &&
(dst < tree_root + nprocs_completed) &&
(rank >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Recv(((char *)recvbuf + offset),
(comm_size - (my_tree_root + mask))*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG,
comm, &status);
mpi_errno = MPIC_Recv_ft(((char *)recvbuf + offset),
(comm_size - (my_tree_root + mask))*recvcount,
recvtype, dst,
MPIR_ALLGATHER_TAG,
comm, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
last_recv_cnt = 0;
......@@ -332,15 +336,16 @@ int MPIR_Allgather_intra (
recv_offset = dst_tree_root * nbytes;
if (dst < comm_size) {
mpi_errno = MPIC_Sendrecv(((char *)tmp_buf + send_offset),
curr_cnt, MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + recv_offset),
tmp_buf_size - recv_offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG, comm, &status);
mpi_errno = MPIC_Sendrecv_ft(((char *)tmp_buf + send_offset),
curr_cnt, MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + recv_offset),
tmp_buf_size - recv_offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG, comm, &status, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
last_recv_cnt = 0;
......@@ -389,12 +394,13 @@ int MPIR_Allgather_intra (
(rank < tree_root + nprocs_completed)
&& (dst >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Send(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHER_TAG,
comm);
mpi_errno = MPIC_Send_ft(((char *)tmp_buf + offset),
last_recv_cnt, MPI_BYTE,
dst, MPIR_ALLGATHER_TAG,
comm, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -407,15 +413,16 @@ int MPIR_Allgather_intra (
else if ((dst < rank) &&
(dst < tree_root + nprocs_completed) &&
(rank >= tree_root + nprocs_completed)) {
mpi_errno = MPIC_Recv(((char *)tmp_buf + offset),
tmp_buf_size - offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
comm, &status);
mpi_errno = MPIC_Recv_ft(((char *)tmp_buf + offset),
tmp_buf_size - offset,
MPI_BYTE, dst,
MPIR_ALLGATHER_TAG,
comm, &status, errflag);
/* nprocs_completed is also equal to the
no. of processes whose data we don't have */
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
last_recv_cnt = 0;
......@@ -482,14 +489,15 @@ int MPIR_Allgather_intra (
src = (rank + pof2) % comm_size;
dst = (rank - pof2 + comm_size) % comm_size;
mpi_errno = MPIC_Sendrecv(tmp_buf, curr_cnt, recvtype, dst,
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
curr_cnt, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(tmp_buf, curr_cnt, recvtype, dst,
MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
curr_cnt, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -504,14 +512,15 @@ int MPIR_Allgather_intra (
src = (rank + pof2) % comm_size;
dst = (rank - pof2 + comm_size) % comm_size;
mpi_errno = MPIC_Sendrecv(tmp_buf, rem * recvcount, recvtype,
dst, MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
rem * recvcount, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(tmp_buf, rem * recvcount, recvtype,
dst, MPIR_ALLGATHER_TAG,
((char *)tmp_buf + curr_cnt*recvtype_extent),
rem * recvcount, recvtype,
src, MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -562,17 +571,18 @@ int MPIR_Allgather_intra (
j = rank;
jnext = left;
for (i=1; i<comm_size; i++) {
mpi_errno = MPIC_Sendrecv(((char *)recvbuf +
j*recvcount*recvtype_extent),
recvcount, recvtype, right,
MPIR_ALLGATHER_TAG,
((char *)recvbuf +
jnext*recvcount*recvtype_extent),
recvcount, recvtype, left,
MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE);
mpi_errno = MPIC_Sendrecv_ft(((char *)recvbuf +
j*recvcount*recvtype_extent),
recvcount, recvtype, right,
MPIR_ALLGATHER_TAG,
((char *)recvbuf +
jnext*recvcount*recvtype_extent),
recvcount, recvtype, left,
MPIR_ALLGATHER_TAG, comm,
MPI_STATUS_IGNORE, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -587,6 +597,9 @@ int MPIR_Allgather_intra (
MPIDU_ERR_CHECK_MULTIPLE_THREADS_EXIT( comm_ptr );
if (mpi_errno_ret)
mpi_errno = mpi_errno_ret;
else if (*errflag)
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**coll_fail");
return mpi_errno;
fn_fail:
......@@ -608,7 +621,8 @@ int MPIR_Allgather_inter (
void *recvbuf,
int recvcount,
MPI_Datatype recvtype,
MPID_Comm *comm_ptr )
MPID_Comm *comm_ptr,
int *errflag)
{
/* Intercommunicator Allgather.
Each group does a gather to local root with the local
......@@ -650,9 +664,10 @@ int MPIR_Allgather_inter (
if (sendcount != 0) {
mpi_errno = MPIR_Gather_impl(sendbuf, sendcount, sendtype, tmp_buf, sendcount,
sendtype, 0, newcomm_ptr);
sendtype, 0, newcomm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -665,9 +680,10 @@ int MPIR_Allgather_inter (
if (sendcount != 0) {
root = (rank == 0) ? MPI_ROOT : MPI_PROC_NULL;
mpi_errno = MPIR_Bcast_inter(tmp_buf, sendcount*local_size,
sendtype, root, comm_ptr);
sendtype, root, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");
MPIU_ERR_ADD(mpi_errno_ret, mpi_errno);
}
......@@ -677,9 +693,10 @@ int MPIR_Allgather_inter (
if (recvcount != 0) {
root = 0;
mpi_errno = MPIR_Bcast_inter(recvbuf, recvcount*remote_size,
recvtype, root, comm_ptr);
recvtype, root, comm_ptr, errflag);
if (mpi_errno) {
/* for communication errors, just record the error but continue */
*errflag = TRUE;
MPIU_ERR_SET(mpi_errno, MPI_ERR_OTHER, "**fail");