From cb253ae7faa74b2a9ca32a7d39291b1de347fced Mon Sep 17 00:00:00 2001
From: Tobias Leibner <tobias.leibner@googlemail.com>
Date: Tue, 1 Oct 2019 18:19:32 +0200
Subject: [PATCH] [parallel] fix tests and headercheck without mpi

---
 dune/xt/common/parallel/communicator.hh     | 11 +++++++++++
 dune/xt/common/parallel/mpi_comm_wrapper.hh |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/dune/xt/common/parallel/communicator.hh b/dune/xt/common/parallel/communicator.hh
index f88a00b5b..47263d110 100644
--- a/dune/xt/common/parallel/communicator.hh
+++ b/dune/xt/common/parallel/communicator.hh
@@ -29,6 +29,17 @@ bool operator!=(const No_Comm& lhs, const No_Comm& rhs)
   return !(lhs == rhs);
 }
 
+// CollectiveCommunication<No_Comm> is also missing a comparison operator (CollectiveCommunication<MPI_Comm> does not
+// have a comparison operator either, but it has a conversion operator to MPI_Comm which does have operator==)
+bool operator==(const CollectiveCommunication<No_Comm>& /*lhs*/, const CollectiveCommunication<No_Comm>& /*rhs*/)
+{
+  return true;
+}
+bool operator!=(const CollectiveCommunication<No_Comm>& lhs, const CollectiveCommunication<No_Comm>& rhs)
+{
+  return !(lhs == rhs);
+}
+
 
 } // namespace Dune
 
diff --git a/dune/xt/common/parallel/mpi_comm_wrapper.hh b/dune/xt/common/parallel/mpi_comm_wrapper.hh
index 73960f9e5..0545a658e 100644
--- a/dune/xt/common/parallel/mpi_comm_wrapper.hh
+++ b/dune/xt/common/parallel/mpi_comm_wrapper.hh
@@ -21,6 +21,8 @@
 #  include <dune/pybindxi/stl.h>
 #endif
 
+#include <dune/xt/common/parallel/communicator.hh>
+
 namespace Dune {
 namespace XT {
 namespace Common {
-- 
GitLab