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.
This commit is contained in:
parent
4ba1490310
commit
9343d3d720
@ -61,30 +61,13 @@
|
|||||||
|
|
||||||
#include <opm/material/common/Unused.hpp>
|
#include <opm/material/common/Unused.hpp>
|
||||||
|
|
||||||
// include the MPI header if available
|
// include dune's MPI helper header
|
||||||
#if HAVE_MPI
|
#include <dune/common/version.hh>
|
||||||
#include <mpi.h>
|
#if DUNE_VERSION_NEWER(DUNE_COMMON, 2,3)
|
||||||
#endif // HAVE_MPI
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
|
#else
|
||||||
// class to call MPI_Init() on construction and MPI_Finalize() in the
|
#include <dune/common/mpihelper.hh>
|
||||||
// destructor
|
#endif
|
||||||
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
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// this function makes sure that a capillary pressure law adheres to
|
// this function makes sure that a capillary pressure law adheres to
|
||||||
// the generic programming interface for such laws. This API _must_ be
|
// the generic programming interface for such laws. This API _must_ be
|
||||||
@ -299,7 +282,7 @@ int main(int argc, char **argv)
|
|||||||
typedef Opm::ImmiscibleFluidState<Evaluation, TwoPFluidSystem> TwoPhaseFluidState;
|
typedef Opm::ImmiscibleFluidState<Evaluation, TwoPFluidSystem> TwoPhaseFluidState;
|
||||||
typedef Opm::ImmiscibleFluidState<Evaluation, ThreePFluidSystem> ThreePhaseFluidState;
|
typedef Opm::ImmiscibleFluidState<Evaluation, ThreePFluidSystem> ThreePhaseFluidState;
|
||||||
|
|
||||||
MyMpiHelper mpiHelper(argc, argv);
|
Dune::MPIHelper::instance(argc, argv);
|
||||||
|
|
||||||
// test conformance to the capillary pressure APIs
|
// test conformance to the capillary pressure APIs
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user