diff --git a/common/mpihelper.hh b/common/mpihelper.hh index 5f5ef5b7ea6b07ffd1b25bc23e6e7619febe82e1..51b0c38c8f41dc2bdb8ed53ba7a91b9d28ddac44 100644 --- a/common/mpihelper.hh +++ b/common/mpihelper.hh @@ -5,8 +5,10 @@ #define DUNE_MPIHELPER #include <cassert> +#include "collectivecommunication.hh" #if HAVE_MPI #include "mpi.h" +#include "mpicollectivecommunication.hh" #endif #include "stdstreams.hh" @@ -87,6 +89,12 @@ namespace Dune return -1; } + static CollectiveCommunication<MPICommunicator> + getCollectiveCommunication() + { + return CollectiveCommunication<MPICommunicator>(getCommunicator()); + } + /** * @brief Get the singleton instance of the helper. * @@ -155,7 +163,11 @@ namespace Dune static MPICommunicator getCommunicator(){ return MPI_COMM_WORLD; } - + static CollectiveCommunication<MPICommunicator> + getCollectiveCommunication() + { + return CollectiveCommunication<MPICommunicator>(getCommunicator()); + } /** * @brief Get the singleton instance of the helper. *