int MPIR_Reduce_scatter_allcomm_nb(const void *sendbuf, void *recvbuf, const int recvcounts[],
                                   MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr,
                                   MPIR_Errflag_t * errflag)
{
    int mpi_errno = MPI_SUCCESS;
    MPI_Request req = MPI_REQUEST_NULL;
    MPIR_Request *req_ptr = NULL;

    /* just call the nonblocking version and wait on it */
    mpi_errno =
        MPIR_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm_ptr, &req_ptr);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);
    if (req_ptr)
        req = req_ptr->handle;

    mpi_errno = MPIR_Wait(&req, MPI_STATUS_IGNORE);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);

  fn_exit:
    return mpi_errno;
  fn_fail:
    goto fn_exit;
}
Esempio n. 2
0
int MPIR_Alltoallw_allcomm_nb(const void *sendbuf, const int sendcounts[], const int sdispls[],
                              const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[],
                              const int rdispls[], const MPI_Datatype recvtypes[],
                              MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag)
{
    int mpi_errno = MPI_SUCCESS;
    MPI_Request req = MPI_REQUEST_NULL;
    MPIR_Request *req_ptr = NULL;

    /* just call the nonblocking version and wait on it */
    mpi_errno =
        MPIR_Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls,
                        recvtypes, comm_ptr, &req_ptr);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);
    if (req_ptr)
        req = req_ptr->handle;

    mpi_errno = MPIR_Wait(&req, MPI_STATUS_IGNORE);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);

  fn_exit:
    return mpi_errno;
  fn_fail:
    goto fn_exit;
}
Esempio n. 3
0
PMPI_LOCAL int MPIR_Ibsend_cancel(void *extra, int complete)
{
    int mpi_errno = MPI_SUCCESS;
    ibsend_req_info *ibsend_info = (ibsend_req_info *) extra;
    MPI_Status status;
    MPIR_Request *req = ibsend_info->req;
    MPI_Request req_hdl = req->handle;

    /* FIXME: There should be no unreferenced args! */
    /* Note that this value should always be 1 because
     * Grequest_complete is called on this request when it is
     * created */
    MPL_UNREFERENCED_ARG(complete);


    /* Try to cancel the underlying request */
    mpi_errno = MPIR_Cancel(req);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);
    mpi_errno = MPIR_Wait(&req_hdl, &status);
    if (mpi_errno)
        MPIR_ERR_POP(mpi_errno);
    ibsend_info->cancelled = MPIR_STATUS_GET_CANCEL_BIT(status);

    /* If the cancelation is successful, free the memory in the
     * attached buffer used by the request */
    if (ibsend_info->cancelled) {
        mpi_errno = MPIR_Bsend_free_req_seg(ibsend_info->req);
        if (mpi_errno)
            MPIR_ERR_POP(mpi_errno);
    }
  fn_exit:
    return mpi_errno;
  fn_fail:
    goto fn_exit;
}