Write total solver time to TCPU.

This commit is contained in:
Atgeirr Flø Rasmussen
2017-06-06 21:35:05 +02:00
parent 2d0701c1e8
commit 42aa343d9f
2 changed files with 13 additions and 8 deletions

View File

@@ -389,7 +389,7 @@ public:
Dune::Timer perfTimer; Dune::Timer perfTimer;
perfTimer.start(); perfTimer.start();
const double nextstep = adaptiveTimeStepping ? adaptiveTimeStepping->suggestedNextStep() : -1.0; const double nextstep = adaptiveTimeStepping ? adaptiveTimeStepping->suggestedNextStep() : -1.0;
output_writer_.writeTimeStep( timer, state, well_state, solver->model(), false, nextstep ); output_writer_.writeTimeStep( timer, state, well_state, solver->model(), false, nextstep, report);
report.output_write_time += perfTimer.stop(); report.output_write_time += perfTimer.stop();
prev_well_state = well_state; prev_well_state = well_state;

View File

@@ -30,6 +30,7 @@
#include <opm/core/utility/parameters/ParameterGroup.hpp> #include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/wells/DynamicListEconLimited.hpp> #include <opm/core/wells/DynamicListEconLimited.hpp>
#include <opm/core/simulator/BlackoilState.hpp> #include <opm/core/simulator/BlackoilState.hpp>
#include <opm/core/simulator/SimulatorReport.hpp>
#include <opm/output/data/Cells.hpp> #include <opm/output/data/Cells.hpp>
#include <opm/output/data/Solution.hpp> #include <opm/output/data/Solution.hpp>
@@ -228,8 +229,9 @@ namespace Opm
const SimulationDataContainer& reservoirState, const SimulationDataContainer& reservoirState,
const Opm::WellStateFullyImplicitBlackoil& wellState, const Opm::WellStateFullyImplicitBlackoil& wellState,
const Model& physicalModel, const Model& physicalModel,
bool substep = false, const bool substep = false,
const double nextstep = -1.0); const double nextstep = -1.0,
const SimulatorReport& simulatorReport = SimulatorReport());
/*! /*!
@@ -989,8 +991,9 @@ namespace Opm
const SimulationDataContainer& localState, const SimulationDataContainer& localState,
const WellStateFullyImplicitBlackoil& localWellState, const WellStateFullyImplicitBlackoil& localWellState,
const Model& physicalModel, const Model& physicalModel,
bool substep, const bool substep,
const double nextstep) const double nextstep,
const SimulatorReport& simulatorReport)
{ {
data::Solution localCellData{}; data::Solution localCellData{};
const RestartConfig& restartConfig = eclipseState_.getRestartConfig(); const RestartConfig& restartConfig = eclipseState_.getRestartConfig();
@@ -1022,9 +1025,11 @@ namespace Opm
// Add suggested next timestep to extra data. // Add suggested next timestep to extra data.
extraRestartData["OPMEXTRA"] = std::vector<double>(1, nextstep); extraRestartData["OPMEXTRA"] = std::vector<double>(1, nextstep);
// @@@ HACK @@@ // Add TCPU if simulatorReport is not defaulted.
// Add TCPU const double totalSolverTime = simulatorReport.solver_time;
miscSummaryData["TCPU"] = 100.0; if (totalSolverTime != 0.0) {
miscSummaryData["TCPU"] = totalSolverTime;
}
} }
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, miscSummaryData, extraRestartData, substep); writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, miscSummaryData, extraRestartData, substep);