1 /*
2 * Copyright (C) by Argonne National Laboratory
3 * See COPYRIGHT in top-level directory
4 */
5
6 #include "mpiimpl.h"
7
MPIR_Reduce_allcomm_nb(const void * sendbuf,void * recvbuf,int count,MPI_Datatype datatype,MPI_Op op,int root,MPIR_Comm * comm_ptr,MPIR_Errflag_t * errflag)8 int MPIR_Reduce_allcomm_nb(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
9 MPI_Op op, int root, MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
10 {
11 int mpi_errno = MPI_SUCCESS;
12 MPIR_Request *req_ptr = NULL;
13
14 /* just call the nonblocking version and wait on it */
15 mpi_errno = MPIR_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, &req_ptr);
16 MPIR_ERR_CHECK(mpi_errno);
17
18 mpi_errno = MPIC_Wait(req_ptr, errflag);
19 MPIR_ERR_CHECK(mpi_errno);
20 MPIR_Request_free(req_ptr);
21
22 fn_exit:
23 return mpi_errno;
24 fn_fail:
25 goto fn_exit;
26 }
27