From 68a080bc91c678a7f21b2209847885539338d73e Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@math.fu-berlin.de>
Date: Tue, 23 Oct 2018 09:31:35 +0200
Subject: [PATCH] Instantiate MPI in case the build is parallel

---
 nonlinelast.cc            | 1 +
 src/linear-elasticity.cc  | 1 +
 test/adolcmaterialtest.cc | 2 ++
 test/materialtest.cc      | 2 ++
 4 files changed, 6 insertions(+)

diff --git a/nonlinelast.cc b/nonlinelast.cc
index 735df39..ed5ee1f 100644
--- a/nonlinelast.cc
+++ b/nonlinelast.cc
@@ -45,6 +45,7 @@ using namespace Dune;
 
 int main (int argc, char *argv[]) try
 {
+    Dune::MPIHelper::instance(argc, argv);
     // Some types that I need
     typedef BCRSMatrix<FieldMatrix<double, dim, dim> > MatrixType;
     typedef BlockVector<FieldVector<double, dim> >     VectorType;
diff --git a/src/linear-elasticity.cc b/src/linear-elasticity.cc
index 126114b..687fd2f 100644
--- a/src/linear-elasticity.cc
+++ b/src/linear-elasticity.cc
@@ -45,6 +45,7 @@ using namespace Dune;
 
 int main (int argc, char *argv[]) try
 {
+    Dune::MPIHelper::instance(argc, argv);
     // Some types that I need
     typedef BCRSMatrix<FieldMatrix<double, dim, dim> > OperatorType;
     typedef BlockVector<FieldVector<double, dim> >     VectorType;
diff --git a/test/adolcmaterialtest.cc b/test/adolcmaterialtest.cc
index a27f911..fb55abb 100644
--- a/test/adolcmaterialtest.cc
+++ b/test/adolcmaterialtest.cc
@@ -36,6 +36,8 @@ const int dim = 3;
 using namespace Dune;
 int main (int argc, char *argv[]) try
 {
+    Dune::MPIHelper::instance(argc, argv);
+
     using FVector = FieldVector<double, dim>;
 
     //    Create the grid
diff --git a/test/materialtest.cc b/test/materialtest.cc
index 4abaa88..0d99181 100644
--- a/test/materialtest.cc
+++ b/test/materialtest.cc
@@ -159,6 +159,8 @@ using namespace Dune;
 
 int main(int argc, char* argv[]) try {
 
+  Dune::MPIHelper::instance(argc, argv);
+
   // parse eps
   double eps = 1e-6;
   if (argc == 2) eps = atof(argv[1]);
-- 
GitLab