diff --git a/libsrc/core/mpi_wrapper.hpp b/libsrc/core/mpi_wrapper.hpp index a9be73ca..82c072fa 100644 --- a/libsrc/core/mpi_wrapper.hpp +++ b/libsrc/core/mpi_wrapper.hpp @@ -303,6 +303,24 @@ namespace ngcore &recv, 1, GetMPIType(), 0, comm); } + template + void GatherRoot (FlatArray recv) const + { + recv[0] = T(0); + if (size == 1) return; + MPI_Gather (MPI_IN_PLACE, 1, GetMPIType(), + recv.Data(), 1, GetMPIType(), 0, comm); + } + + template + void Gather (T send) const + { + if (size == 1) return; + MPI_Gather (&send, 1, GetMPIType(), + NULL, 1, GetMPIType(), 0, comm); + } + + template void AllGather (T val, FlatArray recv) const {