diff --git a/libsrc/core/mpi_wrapper.hpp b/libsrc/core/mpi_wrapper.hpp index 3675db7e..ee252f23 100644 --- a/libsrc/core/mpi_wrapper.hpp +++ b/libsrc/core/mpi_wrapper.hpp @@ -254,6 +254,15 @@ namespace ngcore return global_d; } + template ())> + void AllReduce (FlatArray d, const MPI_Op & op) const + { + static Timer t("MPI - AllReduce Array"); RegionTimer reg(t); + if (size == 1) return d; + + MPI_Allreduce (MPI_IN_PLACE, d.Data(), d.Size(), GetMPIType(), op, comm); + } + template ())> void Bcast (T & s, int root = 0) const { if (size == 1) return ; @@ -396,6 +405,9 @@ namespace ngcore template T AllReduce (T d, const MPI_Op & op) const { return d; } + template + void AllReduce (FlatArray d, const MPI_Op & op) const { ; } + template void Bcast (T & s, int root = 0) const { ; }