Skip to content

Commit

Permalink
Merge pull request #4961 from ye-luo/driver-timer
Browse files Browse the repository at this point in the history
Remove driver scope time and use function scope
  • Loading branch information
prckent committed Apr 20, 2024
2 parents 587dcdb + f5ac4fa commit 34c64b0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
17 changes: 11 additions & 6 deletions src/QMCApp/QMCMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -631,12 +631,17 @@ bool QMCMain::runQMC(xmlNodePtr cur, bool reuse)
#if !defined(REMOVE_TRACEMANAGER)
qmc_driver->putTraces(traces_xml_);
#endif
qmc_driver->process(cur);
infoSummary.flush();
infoLog.flush();
Timer qmcTimer;
qmc_driver->run();
app_log() << " QMC Execution time = " << std::setprecision(4) << qmcTimer.elapsed() << " secs" << std::endl;
{
ScopedTimer qmc_run_timer(createGlobalTimer(qmc_driver->getEngineName(), timer_level_coarse));
Timer process_and_run;
qmc_driver->process(cur);
infoSummary.flush();
infoLog.flush();

qmc_driver->run();
app_log() << " " << qmc_driver->getEngineName() << " Execution time = " << std::setprecision(4)
<< process_and_run.elapsed() << " secs" << std::endl;
}
// transfer the states of a driver before its destruction
last_branch_engine_legacy_driver_ = qmc_driver->getBranchEngine();
// save the driver in a driver loop
Expand Down
1 change: 0 additions & 1 deletion src/QMCDrivers/QMCDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ QMCDriver::QMCDriver(const ProjectData& project_data,
Psi(psi),
H(h),
checkpoint_timer_(createGlobalTimer("checkpoint::recordBlock", timer_level_medium)),
driver_scope_timer_(createGlobalTimer(QMC_driver_type, timer_level_coarse)),
driver_scope_profiler_(enable_profiling)
{
ResetRandom = false;
Expand Down
2 changes: 0 additions & 2 deletions src/QMCDrivers/QMCDriver.h
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ class QMCDriver : public QMCDriverInterface, public QMCTraits, public MPIObjectB

private:
NewTimer& checkpoint_timer_;
///time the driver lifetime
ScopedTimer driver_scope_timer_;
///profile the driver lifetime
ScopedProfiler driver_scope_profiler_;
};
Expand Down
1 change: 0 additions & 1 deletion src/QMCDrivers/QMCDriverNew.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ QMCDriverNew::QMCDriverNew(const ProjectData& project_data,
dispatchers_(!qmcdriver_input_.areWalkersSerialized()),
estimator_manager_(nullptr),
timers_(timer_prefix),
driver_scope_timer_(createGlobalTimer(QMC_driver_type, timer_level_coarse)),
driver_scope_profiler_(qmcdriver_input_.get_scoped_profiling()),
project_data_(project_data),
walker_configs_ref_(wc)
Expand Down
2 changes: 0 additions & 2 deletions src/QMCDrivers/QMCDriverNew.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,6 @@ class QMCDriverNew : public QMCDriverInterface, public MPIObjectBase

DriverTimers timers_;

///time the driver lifetime
ScopedTimer driver_scope_timer_;
///profile the driver lifetime
ScopedProfiler driver_scope_profiler_;

Expand Down

0 comments on commit 34c64b0

Please sign in to comment.