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