int MPIR_Ialltoallw_impl(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_Request **request) { int mpi_errno = MPI_SUCCESS; int tag = -1; MPIR_Sched_t s = MPIR_SCHED_NULL; *request = NULL; mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Ialltoallw_sched(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, request); if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
int MPIR_Ineighbor_alltoallw_impl(const void *sendbuf, const int sendcounts[], const MPI_Aint sdispls[], const MPI_Datatype sendtypes[], void *recvbuf, const int recvcounts[], const MPI_Aint rdispls[], const MPI_Datatype recvtypes[], MPIR_Comm *comm_ptr, MPI_Request *request) { int mpi_errno = MPI_SUCCESS; int tag = -1; MPIR_Request *reqp = NULL; MPIR_Sched_t s = MPIR_SCHED_NULL; *request = MPI_REQUEST_NULL; mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); MPIR_Assert(comm_ptr->coll_fns != NULL); MPIR_Assert(comm_ptr->coll_fns->Ineighbor_alltoallw != NULL); mpi_errno = comm_ptr->coll_fns->Ineighbor_alltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm_ptr, s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, &reqp); if (reqp) *request = reqp->handle; if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
int MPIR_Igather_impl(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPIR_Comm * comm_ptr, MPIR_Request ** request) { int mpi_errno = MPI_SUCCESS; int tag = -1; MPIR_Sched_t s = MPIR_SCHED_NULL; *request = NULL; /* If the user picks one of the transport-enabled algorithms, branch there * before going down to the MPIR_Sched-based algorithms. */ /* TODO - Eventually the intention is to replace all of the * MPIR_Sched-based algorithms with transport-enabled algorithms, but that * will require sufficient performance testing and replacement algorithms. */ if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM) { /* intracommunicator */ switch (MPIR_CVAR_IGATHER_INTRA_ALGORITHM) { case MPIR_CVAR_IGATHER_INTRA_ALGORITHM_gentran_tree: mpi_errno = MPIR_Igather_intra_gentran_tree(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, request); if (mpi_errno) MPIR_ERR_POP(mpi_errno); goto fn_exit; break; default: /* go down to the MPIR_Sched-based algorithms */ break; } } mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Igather_sched(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm_ptr, s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, request); if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
int MPIR_Ireduce_scatter_block_impl(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPIR_Comm * comm_ptr, MPIR_Request ** request) { int mpi_errno = MPI_SUCCESS; int tag = -1; int is_commutative = MPIR_Op_is_commutative(op); MPIR_Sched_t s = MPIR_SCHED_NULL; *request = NULL; /* If the user picks one of the transport-enabled algorithms, branch there * before going down to the MPIR_Sched-based algorithms. */ /* TODO - Eventually the intention is to replace all of the * MPIR_Sched-based algorithms with transport-enabled algorithms, but that * will require sufficient performance testing and replacement algorithms. */ if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM) { /* intracommunicator */ switch (MPIR_CVAR_IREDUCE_SCATTER_BLOCK_INTRA_ALGORITHM) { case MPIR_CVAR_IREDUCE_SCATTER_BLOCK_INTRA_ALGORITHM_gentran_recexch: if (is_commutative) { mpi_errno = MPIR_Ireduce_scatter_block_intra_gentran_recexch(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, request); if (mpi_errno) MPIR_ERR_POP(mpi_errno); goto fn_exit; } break; default: /* go down to the MPIR_Sched-based algorithms */ break; } } mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Ireduce_scatter_block_sched(sendbuf, recvbuf, recvcount, datatype, op, comm_ptr, s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, request); if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_exit: return mpi_errno; fn_fail: goto fn_exit; }
int MPIR_Get_intercomm_contextid_nonblock(MPIR_Comm * comm_ptr, MPIR_Comm * newcommp, MPIR_Request ** req) { int mpi_errno = MPI_SUCCESS; int tag; MPIR_Sched_t s; MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID_NONBLOCK); MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID_NONBLOCK); /* do as much local setup as possible */ if (!comm_ptr->local_comm) { mpi_errno = MPII_Setup_intercomm_localcomm(comm_ptr); if (mpi_errno) MPIR_ERR_POP(mpi_errno); } /* now create a schedule */ mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); /* add some entries to it */ /* first get a context ID over the local comm */ mpi_errno = sched_get_cid_nonblock(comm_ptr, newcommp, &newcommp->recvcontext_id, &newcommp->context_id, s, MPIR_COMM_KIND__INTERCOMM); if (mpi_errno) MPIR_ERR_POP(mpi_errno); /* finally, kick off the schedule and give the caller a request */ mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, req); if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_fail: MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPIR_GET_INTERCOMM_CONTEXTID_NONBLOCK); return mpi_errno; }
int MPIR_Get_contextid_nonblock(MPIR_Comm * comm_ptr, MPIR_Comm * newcommp, MPIR_Request ** req) { int mpi_errno = MPI_SUCCESS; int tag; MPIR_Sched_t s; MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPIR_GET_CONTEXTID_NONBLOCK); MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPIR_GET_CONTEXTID_NONBLOCK); /* now create a schedule */ mpi_errno = MPIR_Sched_next_tag(comm_ptr, &tag); if (mpi_errno) MPIR_ERR_POP(mpi_errno); mpi_errno = MPIR_Sched_create(&s); if (mpi_errno) MPIR_ERR_POP(mpi_errno); /* add some entries to it */ mpi_errno = sched_get_cid_nonblock(comm_ptr, newcommp, &newcommp->context_id, &newcommp->recvcontext_id, s, MPIR_COMM_KIND__INTRACOMM); if (mpi_errno) MPIR_ERR_POP(mpi_errno); /* finally, kick off the schedule and give the caller a request */ mpi_errno = MPIR_Sched_start(&s, comm_ptr, tag, req); if (mpi_errno) MPIR_ERR_POP(mpi_errno); fn_exit: MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPIR_GET_CONTEXTID_NONBLOCK); return mpi_errno; /* --BEGIN ERROR HANDLING-- */ fn_fail: goto fn_exit; /* --END ERROR HANDLING-- */ }