added more timing macros

This commit is contained in:
hnil 2023-03-21 22:44:14 +01:00
parent af30df5dff
commit 122a478341
4 changed files with 13 additions and 4 deletions

View File

@ -27,6 +27,7 @@
#include <opm/common/OpmLog/OpmLog.hpp> #include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/common/utility/TimeService.hpp> #include <opm/common/utility/TimeService.hpp>
#include <opm/common/TimingMacros.hpp>
#include <opm/input/eclipse/EclipseState/EclipseState.hpp> #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
#include <opm/input/eclipse/Schedule/Action/ActionContext.hpp> #include <opm/input/eclipse/Schedule/Action/ActionContext.hpp>
@ -130,6 +131,7 @@ void EclActionHandler::applyActions(const int reportStep,
const double sim_time, const double sim_time,
const TransFunc& transUp) const TransFunc& transUp)
{ {
OPM_TIMEBLOCK(applyActions);
const auto& actions = schedule_[reportStep].actions(); const auto& actions = schedule_[reportStep].actions();
if (actions.empty()) { if (actions.empty()) {
return; return;
@ -188,6 +190,7 @@ void EclActionHandler::applySimulatorUpdate(const int report_step,
bool& commit_wellstate, bool& commit_wellstate,
const TransFunc& updateTrans) const TransFunc& updateTrans)
{ {
OPM_TIMEBLOCK(applySimulatorUpdate);
this->wellModel_.updateEclWells(report_step, sim_update.affected_wells, summaryState_); this->wellModel_.updateEclWells(report_step, sim_update.affected_wells, summaryState_);
if (!sim_update.affected_wells.empty()) if (!sim_update.affected_wells.empty())
commit_wellstate = true; commit_wellstate = true;

View File

@ -1127,7 +1127,8 @@ public:
// deal with DRSDT and DRVDT // deal with DRSDT and DRVDT
updateCompositionChangeLimits_(); updateCompositionChangeLimits_();
{
OPM_TIMEBLOCK(driftCompansation);
if (enableDriftCompensation_) { if (enableDriftCompensation_) {
const auto& residual = this->model().linearizer().residual(); const auto& residual = this->model().linearizer().residual();
for (unsigned globalDofIdx = 0; globalDofIdx < residual.size(); globalDofIdx ++) { for (unsigned globalDofIdx = 0; globalDofIdx < residual.size(); globalDofIdx ++) {
@ -1137,7 +1138,7 @@ public:
drift_[globalDofIdx] *= this->model().dofTotalVolume(globalDofIdx); drift_[globalDofIdx] *= this->model().dofTotalVolume(globalDofIdx);
} }
} }
}
bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver(); bool isSubStep = !EWOMS_GET_PARAM(TypeTag, bool, EnableWriteAllSolutions) && !this->simulator().episodeWillBeOver();
eclWriter_->evalSummaryState(isSubStep); eclWriter_->evalSummaryState(isSubStep);
@ -1155,11 +1156,12 @@ public:
[this,gridToEquilGrid](bool global) { [this,gridToEquilGrid](bool global) {
this->transmissibilities_.update(global,gridToEquilGrid); this->transmissibilities_.update(global,gridToEquilGrid);
}; };
{
OPM_TIMEBLOCK(applyActions);
actionHandler_.applyActions(episodeIdx, actionHandler_.applyActions(episodeIdx,
simulator.time() + simulator.timeStepSize(), simulator.time() + simulator.timeStepSize(),
transUp); transUp);
}
// deal with "clogging" for the MICP model // deal with "clogging" for the MICP model
if constexpr (enableMICP){ if constexpr (enableMICP){
auto& model = this->model(); auto& model = this->model();

View File

@ -183,6 +183,7 @@ namespace Opm {
void beginEpisode() void beginEpisode()
{ {
OPM_TIMEBLOCK(beginEpsiode);
beginReportStep(ebosSimulator_.episodeIndex()); beginReportStep(ebosSimulator_.episodeIndex());
} }
@ -190,6 +191,7 @@ namespace Opm {
void beginIteration() void beginIteration()
{ {
OPM_TIMEBLOCK(beginIteration);
assemble(ebosSimulator_.model().newtonMethod().numIterations(), assemble(ebosSimulator_.model().newtonMethod().numIterations(),
ebosSimulator_.timeStepSize()); ebosSimulator_.timeStepSize());
} }
@ -199,6 +201,7 @@ namespace Opm {
void endTimeStep() void endTimeStep()
{ {
OPM_TIMEBLOCK(endTimeStep);
timeStepSucceeded(ebosSimulator_.time(), ebosSimulator_.timeStepSize()); timeStepSucceeded(ebosSimulator_.time(), ebosSimulator_.timeStepSize());
} }

View File

@ -237,6 +237,7 @@ namespace Opm {
BlackoilWellModel<TypeTag>:: BlackoilWellModel<TypeTag>::
beginTimeStep() beginTimeStep()
{ {
OPM_TIMEBLOCK(beginTimeStep);
updatePerforationIntensiveQuantities(); updatePerforationIntensiveQuantities();
updateAverageFormationFactor(); updateAverageFormationFactor();
DeferredLogger local_deferredLogger; DeferredLogger local_deferredLogger;