mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Pass wbp index list to output module
This commit is contained in:
@@ -195,7 +195,7 @@ class EclOutputBlackOilModule
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
template<class CollectDataToIORankType>
|
template<class CollectDataToIORankType>
|
||||||
EclOutputBlackOilModule(const Simulator& simulator, const CollectDataToIORankType& collectToIORank)
|
EclOutputBlackOilModule(const Simulator& simulator, const std::vector<std::size_t>& wbp_index_list, const CollectDataToIORankType& collectToIORank)
|
||||||
: simulator_(simulator)
|
: simulator_(simulator)
|
||||||
{
|
{
|
||||||
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
||||||
|
|||||||
+18
-3
@@ -192,14 +192,27 @@ public:
|
|||||||
: simulator_(simulator)
|
: simulator_(simulator)
|
||||||
, collectToIORank_(simulator_.vanguard())
|
, collectToIORank_(simulator_.vanguard())
|
||||||
{
|
{
|
||||||
this->eclOutputModule_ = std::make_unique<EclOutputBlackOilModule<TypeTag>>(simulator, this->collectToIORank_);
|
std::vector<std::size_t> wbp_index_list;
|
||||||
if (collectToIORank_.isIORank()) {
|
if (collectToIORank_.isIORank()) {
|
||||||
|
const auto& schedule = simulator_.vanguard().schedule();
|
||||||
eclIO_.reset(new Opm::EclipseIO(simulator_.vanguard().eclState(),
|
eclIO_.reset(new Opm::EclipseIO(simulator_.vanguard().eclState(),
|
||||||
Opm::UgGridHelpers::createEclipseGrid(globalGrid(), simulator_.vanguard().eclState().getInputGrid()),
|
Opm::UgGridHelpers::createEclipseGrid(globalGrid(), simulator_.vanguard().eclState().getInputGrid()),
|
||||||
simulator_.vanguard().schedule(),
|
schedule,
|
||||||
simulator_.vanguard().summaryConfig()));
|
simulator_.vanguard().summaryConfig()));
|
||||||
}
|
|
||||||
|
|
||||||
|
const auto& wbp_calculators = eclIO_->summary().wbp_calculators( schedule.size() - 1 );
|
||||||
|
wbp_index_list = wbp_calculators.index_list();
|
||||||
|
}
|
||||||
|
if (collectToIORank_.isParallel()) {
|
||||||
|
#ifdef HAVE_MPI
|
||||||
|
unsigned long size = wbp_index_list.size();
|
||||||
|
MPI_Bcast(&size, 1, MPI_UNSIGNED_LONG, collectToIORank_.ioRank, MPI_COMM_WORLD);
|
||||||
|
if (!collectToIORank_.isIORank())
|
||||||
|
wbp_index_list.resize( size );
|
||||||
|
|
||||||
|
MPI_Bcast(wbp_index_list.data(), size * sizeof(std::size_t), MPI_CHAR, collectToIORank_.ioRank, MPI_COMM_WORLD);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
// create output thread if enabled and rank is I/O rank
|
// create output thread if enabled and rank is I/O rank
|
||||||
// async output is enabled by default if pthread are enabled
|
// async output is enabled by default if pthread are enabled
|
||||||
bool enableAsyncOutput = EWOMS_GET_PARAM(TypeTag, bool, EnableAsyncEclOutput);
|
bool enableAsyncOutput = EWOMS_GET_PARAM(TypeTag, bool, EnableAsyncEclOutput);
|
||||||
@@ -207,6 +220,8 @@ public:
|
|||||||
if (enableAsyncOutput && collectToIORank_.isIORank())
|
if (enableAsyncOutput && collectToIORank_.isIORank())
|
||||||
numWorkerThreads = 1;
|
numWorkerThreads = 1;
|
||||||
taskletRunner_.reset(new TaskletRunner(numWorkerThreads));
|
taskletRunner_.reset(new TaskletRunner(numWorkerThreads));
|
||||||
|
|
||||||
|
this->eclOutputModule_ = std::make_unique<EclOutputBlackOilModule<TypeTag>>(simulator, wbp_index_list, this->collectToIORank_);
|
||||||
}
|
}
|
||||||
|
|
||||||
~EclWriter()
|
~EclWriter()
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ BOOST_AUTO_TEST_CASE(Summary)
|
|||||||
using Vanguard = Opm::GetPropType<TypeTag, Opm::Properties::Vanguard>;
|
using Vanguard = Opm::GetPropType<TypeTag, Opm::Properties::Vanguard>;
|
||||||
typedef Opm::CollectDataToIORank< Vanguard > CollectDataToIORankType;
|
typedef Opm::CollectDataToIORank< Vanguard > CollectDataToIORankType;
|
||||||
CollectDataToIORankType collectToIORank(simulator->vanguard());
|
CollectDataToIORankType collectToIORank(simulator->vanguard());
|
||||||
Opm::EclOutputBlackOilModule<TypeTag> eclOutputModule(*simulator, collectToIORank);
|
Opm::EclOutputBlackOilModule<TypeTag> eclOutputModule(*simulator, {}, collectToIORank);
|
||||||
|
|
||||||
typedef Opm::EclWriter<TypeTag> EclWriterType;
|
typedef Opm::EclWriter<TypeTag> EclWriterType;
|
||||||
// create the actual ECL writer
|
// create the actual ECL writer
|
||||||
|
|||||||
Reference in New Issue
Block a user