Blame src/mpi/coll/gatherv/gatherv_allcomm_nb.c

Packit Service c5cf8c
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
Packit Service c5cf8c
/*
Packit Service c5cf8c
 *  (C) 2017 by Argonne National Laboratory.
Packit Service c5cf8c
 *      See COPYRIGHT in top-level directory.
Packit Service c5cf8c
 */
Packit Service c5cf8c
Packit Service c5cf8c
#include "mpiimpl.h"
Packit Service c5cf8c
Packit Service c5cf8c
#undef FUNCNAME
Packit Service c5cf8c
#define FUNCNAME MPIR_Gatherv_allcomm_nb
Packit Service c5cf8c
#undef FCNAME
Packit Service c5cf8c
#define FCNAME MPL_QUOTE(FUNCNAME)
Packit Service c5cf8c
int MPIR_Gatherv_allcomm_nb(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
Packit Service c5cf8c
                            void *recvbuf, const int *recvcounts, const int *displs,
Packit Service c5cf8c
                            MPI_Datatype recvtype, int root, MPIR_Comm * comm_ptr,
Packit Service c5cf8c
                            MPIR_Errflag_t * errflag)
Packit Service c5cf8c
{
Packit Service c5cf8c
    int mpi_errno = MPI_SUCCESS;
Packit Service c5cf8c
    MPI_Request req = MPI_REQUEST_NULL;
Packit Service c5cf8c
    MPIR_Request *req_ptr = NULL;
Packit Service c5cf8c
Packit Service c5cf8c
    /* just call the nonblocking version and wait on it */
Packit Service c5cf8c
    mpi_errno =
Packit Service c5cf8c
        MPIR_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root,
Packit Service c5cf8c
                      comm_ptr, &req_ptr);
Packit Service c5cf8c
    if (mpi_errno)
Packit Service c5cf8c
        MPIR_ERR_POP(mpi_errno);
Packit Service c5cf8c
    if (req_ptr)
Packit Service c5cf8c
        req = req_ptr->handle;
Packit Service c5cf8c
Packit Service c5cf8c
    mpi_errno = MPIR_Wait(&req, MPI_STATUS_IGNORE);
Packit Service c5cf8c
    if (mpi_errno)
Packit Service c5cf8c
        MPIR_ERR_POP(mpi_errno);
Packit Service c5cf8c
Packit Service c5cf8c
  fn_exit:
Packit Service c5cf8c
    return mpi_errno;
Packit Service c5cf8c
  fn_fail:
Packit Service c5cf8c
    goto fn_exit;
Packit Service c5cf8c
}