mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #420 from dr-robertk/PR/bug-fix-is-parallel-init
SimulatorBase[bugfix]: is_parallel_run_ was not initialized correctly.
This commit is contained in:
commit
e24cb27ad4
@ -52,7 +52,8 @@ namespace Opm
|
|||||||
eclipse_state_(eclipse_state),
|
eclipse_state_(eclipse_state),
|
||||||
output_writer_(output_writer),
|
output_writer_(output_writer),
|
||||||
rateConverter_(props_, std::vector<int>(AutoDiffGrid::numCells(grid_), 0)),
|
rateConverter_(props_, std::vector<int>(AutoDiffGrid::numCells(grid_), 0)),
|
||||||
threshold_pressures_by_face_(threshold_pressures_by_face)
|
threshold_pressures_by_face_(threshold_pressures_by_face),
|
||||||
|
is_parallel_run_( false )
|
||||||
{
|
{
|
||||||
// Misc init.
|
// Misc init.
|
||||||
const int num_cells = AutoDiffGrid::numCells(grid);
|
const int num_cells = AutoDiffGrid::numCells(grid);
|
||||||
@ -61,16 +62,14 @@ namespace Opm
|
|||||||
allcells_[cell] = cell;
|
allcells_[cell] = cell;
|
||||||
}
|
}
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
if ( terminal_output_ ) {
|
|
||||||
if ( solver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
if ( solver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
||||||
{
|
{
|
||||||
const ParallelISTLInformation& info =
|
const ParallelISTLInformation& info =
|
||||||
boost::any_cast<const ParallelISTLInformation&>(solver_.parallelInformation());
|
boost::any_cast<const ParallelISTLInformation&>(solver_.parallelInformation());
|
||||||
// Only rank 0 does print to std::cout
|
// Only rank 0 does print to std::cout
|
||||||
terminal_output_ = ( info.communicator().rank() == 0 );
|
terminal_output_ &= ( info.communicator().rank() == 0 );
|
||||||
is_parallel_run_ = ( info.communicator().size() > 1 );
|
is_parallel_run_ = ( info.communicator().size() > 1 );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user