int MPI_Alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { return PMPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); }
int MPI_Alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm) { int ret; cqueue_t* mycqueue = handle_get_cqueue(comm); if (mycqueue != NULL) { MPI_Request tmprequest; cqueue_ialltoall(mycqueue, sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &tmprequest); return MPI_Wait(&tmprequest, MPI_STATUS_IGNORE); } else { if (std_mpi_mode == STD_MPI_MODE_IMPLICIT && max_ep > 0) { int num_ep = 1; if (sendcount >= std_mpi_mode_implicit_alltoall_threshold) num_ep = max_ep; for (int epid = 0; epid < num_ep; epid++) { int sendstart, sendchunk; int recvstart, recvchunk; GET_MESSAGE_PAYLOAD(epid, num_ep, sendcount, sendchunk, sendstart); GET_MESSAGE_PAYLOAD(epid, num_ep, recvcount, recvchunk, recvstart); block_coll_request[epid] = MPI_REQUEST_NULL; ret = cqueue_ialltoall(client_get_cqueue(epid), sendbuf + sendstart, sendchunk, sendtype, recvbuf+recvstart, recvchunk, recvtype, comm, &block_coll_request[epid]); } return MPI_Waitall(num_ep, block_coll_request, MPI_STATUS_IGNORE); } return PMPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm); } return ret; }