mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Unconditionally instantiate the (possibly fake) MPI helper.
This reduces the difference between flow and flow_mpi. For builds without MPI, the fake helper from Dune is instantiated, which has the same interface.
This commit is contained in:
parent
7c5256031c
commit
be9b6a3cd2
@ -124,16 +124,13 @@ main(int argc, char** argv)
|
||||
try
|
||||
{
|
||||
using namespace Opm;
|
||||
#if USE_DUNE_CORNERPOINTGRID
|
||||
|
||||
// Must ensure an instance of the helper is created to initialise MPI.
|
||||
// For a build without MPI the Dune::FakeMPIHelper is used, so rank will
|
||||
// be 0 and size 1.
|
||||
const Dune::MPIHelper& mpi_helper = Dune::MPIHelper::instance(argc, argv);
|
||||
const int mpi_rank = mpi_helper.rank();
|
||||
const int mpi_size = mpi_helper.size();
|
||||
#else
|
||||
// default values for serial run
|
||||
const int mpi_rank = 0;
|
||||
const int mpi_size = 1;
|
||||
#endif
|
||||
|
||||
// Write parameters used for later reference. (only if rank is zero)
|
||||
const bool output_cout = ( mpi_rank == 0 );
|
||||
|
Loading…
Reference in New Issue
Block a user