From 9343d3d7202dab2574c0ce361f81ca8f5bf52e8c Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 28 Jul 2015 17:24:07 +0200 Subject: [PATCH] go back to using Dune's MPIHelper class in test_fluidmatrixinteractions Dune's MPIHelper API might be sub-optimal (because it easily leads to race conditions w.r.t. the destruction of singletons), but it does the job and we don't have to maintain it. --- tests/test_fluidmatrixinteractions.cpp | 33 +++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/tests/test_fluidmatrixinteractions.cpp b/tests/test_fluidmatrixinteractions.cpp index 40651f377..c3c8783d8 100644 --- a/tests/test_fluidmatrixinteractions.cpp +++ b/tests/test_fluidmatrixinteractions.cpp @@ -61,30 +61,13 @@ #include -// include the MPI header if available -#if HAVE_MPI -#include -#endif // HAVE_MPI - -// class to call MPI_Init() on construction and MPI_Finalize() in the -// destructor -class MyMpiHelper -{ -public: - MyMpiHelper(int &argc, char **&argv) - { -#if HAVE_MPI - MPI_Init(&argc, &argv); -#endif // HAVE_MPI - }; - - ~MyMpiHelper() - { -#if HAVE_MPI - MPI_Finalize(); -#endif // HAVE_MPI - }; -}; +// include dune's MPI helper header +#include +#if DUNE_VERSION_NEWER(DUNE_COMMON, 2,3) +#include +#else +#include +#endif // this function makes sure that a capillary pressure law adheres to // the generic programming interface for such laws. This API _must_ be @@ -299,7 +282,7 @@ int main(int argc, char **argv) typedef Opm::ImmiscibleFluidState TwoPhaseFluidState; typedef Opm::ImmiscibleFluidState ThreePhaseFluidState; - MyMpiHelper mpiHelper(argc, argv); + Dune::MPIHelper::instance(argc, argv); // test conformance to the capillary pressure APIs {