From ad39cda34df59598dcc21f2a5951811495728a3a Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Tue, 31 Mar 2020 15:06:29 +0200
Subject: [PATCH] [istlfactory] Only construct parallel helper if MPI is found

---
 dumux/linear/istlsolverfactorybackend.hh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dumux/linear/istlsolverfactorybackend.hh b/dumux/linear/istlsolverfactorybackend.hh
index fa96f2e425..71e330eb9c 100644
--- a/dumux/linear/istlsolverfactorybackend.hh
+++ b/dumux/linear/istlsolverfactorybackend.hh
@@ -85,8 +85,10 @@ public:
                              const typename LinearSolverTraits::DofMapper& dofMapper,
                              const std::string& paramGroup = "")
     : paramGroup_(paramGroup)
+#if HAVE_MPI
     , parallelHelper_(std::make_unique<ParallelISTLHelper<LinearSolverTraits>>(gridView, dofMapper))
     , isParallel_(Dune::MPIHelper::getCollectiveCommunication().size() > 1)
+#endif
     {
         reset();
     }
@@ -227,8 +229,10 @@ private:
     }
 
     const std::string paramGroup_;
+#if HAVE_MPI
     std::unique_ptr<ParallelISTLHelper<LinearSolverTraits>> parallelHelper_;
-    bool isParallel_;
+#endif
+    bool isParallel_ = false;
     bool firstCall_;
 
     Dune::InverseOperatorResult result_;
-- 
GitLab