From 9e105c48ea87bf90f8e57ba9c4520ab817be46e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Mon, 17 Aug 2020 20:28:00 +0200 Subject: [PATCH] mpi-wrapper --- libsrc/core/mpi_wrapper.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libsrc/core/mpi_wrapper.hpp b/libsrc/core/mpi_wrapper.hpp index bf9540a5..8d9631f5 100644 --- a/libsrc/core/mpi_wrapper.hpp +++ b/libsrc/core/mpi_wrapper.hpp @@ -275,6 +275,18 @@ namespace ngcore &recv, 1, GetMPIType(), 0, comm); } + template + void AllGather (T val, FlatArray recv) const + { + if (size == 1) + { + recv[0] = val; + return; + } + MPI_Allgather (&val, 1, GetMPIType(), + recv.Data(), 1, GetMPIType(), + comm); + } NgMPI_Comm SubCommunicator (FlatArray procs) const