|
| 1 | +/* |
| 2 | + * Copyright (C) by Argonne National Laboratory |
| 3 | + * See COPYRIGHT in top-level directory |
| 4 | + */ |
| 5 | + |
| 6 | +#include "mpiimpl.h" |
| 7 | +#include "coll_impl.h" |
| 8 | + |
| 9 | +int MPIR_Barrier_fallback(MPIR_Comm * comm_ptr, int coll_attr) |
| 10 | +{ |
| 11 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 12 | + return MPIR_Barrier_intra_dissemination(comm_ptr, coll_attr); |
| 13 | +} |
| 14 | + |
| 15 | +int MPIR_Allgather_fallback(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype, |
| 16 | + void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype, |
| 17 | + MPIR_Comm * comm_ptr, int coll_attr) |
| 18 | +{ |
| 19 | + if (comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM) { |
| 20 | + return MPIR_Allgather_intra_brucks(sendbuf, sendcount, sendtype, |
| 21 | + recvbuf, recvcount, recvtype, comm_ptr, coll_attr); |
| 22 | + } else { |
| 23 | + return MPIR_Allgather_inter_local_gather_remote_bcast(sendbuf, sendcount, sendtype, |
| 24 | + recvbuf, recvcount, recvtype, |
| 25 | + comm_ptr, coll_attr); |
| 26 | + } |
| 27 | +} |
| 28 | + |
| 29 | +int MPIR_Allgatherv_fallback(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype, |
| 30 | + void *recvbuf, const MPI_Aint * recvcounts, const MPI_Aint * displs, |
| 31 | + MPI_Datatype recvtype, MPIR_Comm * comm_ptr, int coll_attr) |
| 32 | +{ |
| 33 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 34 | + return MPIR_Allgatherv_intra_brucks(sendbuf, sendcount, sendtype, |
| 35 | + recvbuf, recvcounts, displs, recvtype, comm_ptr, coll_attr); |
| 36 | +} |
| 37 | + |
| 38 | +int MPIR_Allreduce_fallback(const void *sendbuf, void *recvbuf, |
| 39 | + MPI_Aint count, MPI_Datatype datatype, |
| 40 | + MPI_Op op, MPIR_Comm * comm_ptr, int coll_attr) |
| 41 | +{ |
| 42 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 43 | + return MPIR_Allreduce_intra_recursive_doubling(sendbuf, recvbuf, count, datatype, op, |
| 44 | + comm_ptr, coll_attr); |
| 45 | +} |
| 46 | + |
| 47 | +int MPIR_Bcast_fallback(void *buffer, MPI_Aint count, MPI_Datatype datatype, int root, |
| 48 | + MPIR_Comm * comm_ptr, int coll_attr) |
| 49 | +{ |
| 50 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 51 | + return MPIR_Bcast_intra_binomial(buffer, count, datatype, root, comm_ptr, coll_attr); |
| 52 | +} |
| 53 | + |
| 54 | +int MPIR_Gather_fallback(const void *sendbuf, MPI_Aint sendcount, MPI_Datatype sendtype, |
| 55 | + void *recvbuf, MPI_Aint recvcount, MPI_Datatype recvtype, int root, |
| 56 | + MPIR_Comm * comm_ptr, int coll_attr) |
| 57 | +{ |
| 58 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 59 | + return MPIR_Gather_intra_binomial(sendbuf, sendcount, sendtype, |
| 60 | + recvbuf, recvcount, recvtype, root, comm_ptr, coll_attr); |
| 61 | +} |
| 62 | + |
| 63 | +int MPIR_Reduce_scatter_block_fallback(const void *sendbuf, void *recvbuf, MPI_Aint recvcount, |
| 64 | + MPI_Datatype datatype, MPI_Op op, |
| 65 | + MPIR_Comm * comm_ptr, int coll_attr) |
| 66 | +{ |
| 67 | + MPIR_Assert(comm_ptr->comm_kind == MPIR_COMM_KIND__INTRACOMM); |
| 68 | + MPIR_Assert(MPIR_Op_is_commutative(op)); |
| 69 | + return MPIR_Reduce_scatter_block_intra_recursive_halving(sendbuf, recvbuf, recvcount, datatype, |
| 70 | + op, comm_ptr, coll_attr); |
| 71 | +} |
0 commit comments