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