ebos: make it possible to account for external setup costs

This commit is contained in:
Andreas Lauser
2019-02-05 16:51:34 +01:00
parent 4ecda15b11
commit dc1b92521a
2 changed files with 24 additions and 3 deletions

View File

@@ -148,6 +148,20 @@ public:
throw std::invalid_argument("Cannot find input case '"+caseName+"'"); throw std::invalid_argument("Cannot find input case '"+caseName+"'");
} }
/*!
* \brief Set the wall time which was spend externally to set up the external data structures
*
* i.e., the objects specified via the other setExternal*() methods.
*/
static void setExternalSetupTime(Scalar t)
{ externalSetupTime_ = t; }
/*!
* \brief Returns the wall time required to set up the simulator before it was born.
*/
static Scalar externalSetupTime()
{ return externalSetupTime_; }
/*! /*!
* \brief Set the Opm::EclipseState and the Opm::Deck object which ought to be used * \brief Set the Opm::EclipseState and the Opm::Deck object which ought to be used
* when the simulator vanguard is instantiated. * when the simulator vanguard is instantiated.
@@ -469,6 +483,7 @@ private:
std::string caseName_; std::string caseName_;
static Scalar externalSetupTime_;
static Opm::Deck* externalDeck_; static Opm::Deck* externalDeck_;
static Opm::EclipseState* externalEclState_; static Opm::EclipseState* externalEclState_;
static Opm::Schedule* externalEclSchedule_; static Opm::Schedule* externalEclSchedule_;
@@ -487,6 +502,9 @@ private:
Opm::SummaryConfig* eclSummaryConfig_; Opm::SummaryConfig* eclSummaryConfig_;
}; };
template <class TypeTag>
typename EclBaseVanguard<TypeTag>::Scalar EclBaseVanguard<TypeTag>::externalSetupTime_ = 0.0;
template <class TypeTag> template <class TypeTag>
Opm::Deck* EclBaseVanguard<TypeTag>::externalDeck_ = nullptr; Opm::Deck* EclBaseVanguard<TypeTag>::externalDeck_ = nullptr;

View File

@@ -150,7 +150,10 @@ public:
void writeOutput(bool isSubStep) void writeOutput(bool isSubStep)
{ {
Scalar curTime = simulator_.time() + simulator_.timeStepSize(); Scalar curTime = simulator_.time() + simulator_.timeStepSize();
Scalar totalSolverTime = simulator_.executionTimer().realTimeElapsed(); Scalar totalCpuTime =
simulator_.executionTimer().realTimeElapsed() +
simulator_.setupTimer().realTimeElapsed() +
simulator_.vanguard().externalSetupTime();
Scalar nextStepSize = simulator_.problem().nextTimeStepSize(); Scalar nextStepSize = simulator_.problem().nextTimeStepSize();
// output using eclWriter if enabled // output using eclWriter if enabled
@@ -195,8 +198,8 @@ public:
const auto& simConfig = eclState.getSimulationConfig(); const auto& simConfig = eclState.getSimulationConfig();
// Add TCPU // Add TCPU
if (totalSolverTime != 0.0) if (totalCpuTime != 0.0)
miscSummaryData["TCPU"] = totalSolverTime; miscSummaryData["TCPU"] = totalCpuTime;
bool enableDoublePrecisionOutput = EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision); bool enableDoublePrecisionOutput = EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision);
const Opm::data::Solution& cellData = collectToIORank_.isParallel() ? collectToIORank_.globalCellData() : localCellData; const Opm::data::Solution& cellData = collectToIORank_.isParallel() ? collectToIORank_.globalCellData() : localCellData;