mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: make it possible to account for external setup costs
This commit is contained in:
@@ -148,6 +148,20 @@ public:
|
||||
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
|
||||
* when the simulator vanguard is instantiated.
|
||||
@@ -469,6 +483,7 @@ private:
|
||||
|
||||
std::string caseName_;
|
||||
|
||||
static Scalar externalSetupTime_;
|
||||
static Opm::Deck* externalDeck_;
|
||||
static Opm::EclipseState* externalEclState_;
|
||||
static Opm::Schedule* externalEclSchedule_;
|
||||
@@ -487,6 +502,9 @@ private:
|
||||
Opm::SummaryConfig* eclSummaryConfig_;
|
||||
};
|
||||
|
||||
template <class TypeTag>
|
||||
typename EclBaseVanguard<TypeTag>::Scalar EclBaseVanguard<TypeTag>::externalSetupTime_ = 0.0;
|
||||
|
||||
template <class TypeTag>
|
||||
Opm::Deck* EclBaseVanguard<TypeTag>::externalDeck_ = nullptr;
|
||||
|
||||
|
||||
@@ -150,7 +150,10 @@ public:
|
||||
void writeOutput(bool isSubStep)
|
||||
{
|
||||
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();
|
||||
|
||||
// output using eclWriter if enabled
|
||||
@@ -195,8 +198,8 @@ public:
|
||||
const auto& simConfig = eclState.getSimulationConfig();
|
||||
|
||||
// Add TCPU
|
||||
if (totalSolverTime != 0.0)
|
||||
miscSummaryData["TCPU"] = totalSolverTime;
|
||||
if (totalCpuTime != 0.0)
|
||||
miscSummaryData["TCPU"] = totalCpuTime;
|
||||
|
||||
bool enableDoublePrecisionOutput = EWOMS_GET_PARAM(TypeTag, bool, EclOutputDoublePrecision);
|
||||
const Opm::data::Solution& cellData = collectToIORank_.isParallel() ? collectToIORank_.globalCellData() : localCellData;
|
||||
|
||||
Reference in New Issue
Block a user