138 "[PERF-FV] step=%.4f total=%.4f "
139 "census=%.4f flux=%.4f nodesolve=%.4f positivity=%.4f "
140 "cellupdate=%.4f nodeupdate=%.4f refreshdepths=%.4f "
141 "savestate=%.4f restore=%.4f structrefresh=%.4f bndcallback=%.4f "
142 "rebuild=%.4f reconstruct=%.4f ltsfire=%.4f settle=%.4f tier=%.4f "
143 "n.substep=%ld n.census=%ld n.censusface=%ld n.invert=%ld "
144 "n.savestate=%ld n.rollback=%ld n.structrefresh=%ld "
145 "n.algvisit=%ld n.algpassthru=%ld n.algsolve=%ld "
146 "n.algresidual=%ld n.algfaceflux=%ld "
147 "passthru_frac=%.4f rollback_frac=%.4f "
148 "algresid_per_solve=%.2f algflux_per_solve=%.2f\n",
170inline std::chrono::steady_clock::time_point
now() noexcept {
171 return std::chrono::steady_clock::now();
173inline double since(std::chrono::steady_clock::time_point t0)
noexcept {
174 return std::chrono::duration<double>(
now() - t0).count();
179 static const bool on = (std::getenv(
"OPENSWMM_PERF") !=
nullptr);
208 "[PERF-LOAD] open=%.4f open.prescan2d=%.4f open.read=%.4f "
209 "read.scan=%.4f read.dispatch=%.4f "
210 "open.resolve=%.4f open.validate=%.4f "
211 "res.extfiles=%.4f res.tables=%.4f res.transects=%.4f res.xsect=%.4f "
213 "init=%.4f init.state=%.4f init.hydraulics=%.4f init.hydrology=%.4f "
214 "init.quality=%.4f init.geometry=%.4f "
215 "start=%.4f start.iface=%.4f start.plugins=%.4f\n",
229 std::chrono::steady_clock::time_point
t0;
231 :
acc(&a),
t0(std::chrono::steady_clock::now()) {}
233 *
acc += std::chrono::duration<double>(
234 std::chrono::steady_clock::now() -
t0).count();
275 std::chrono::steady_clock::time_point
t0;
281 t0 = std::chrono::steady_clock::now();
286 const double wall = std::chrono::duration<double>(
287 std::chrono::steady_clock::now() -
t0).count();
300inline void count(
long& c,
long n = 1) noexcept {
Definition PerfTimers.hpp:15
double sec_res_tables
Definition PerfTimers.hpp:40
double sec_open_read
Definition PerfTimers.hpp:29
thread_local double nested_wall
ScopedTimer that reads the clock only when OPENSWMM_PERF is set.
Definition PerfTimers.hpp:270
void reset_load() noexcept
Zeroes the load-phase accumulators. Called from open().
Definition PerfTimers.hpp:184
double sec_fv_cellupdate
Definition PerfTimers.hpp:75
double sec_init_hydrology
Definition PerfTimers.hpp:47
long n_fv_alg_visit
Definition PerfTimers.hpp:95
double sec_init_hydraulics
Definition PerfTimers.hpp:46
double sec_read_dispatch
Definition PerfTimers.hpp:33
double sec_fv_ltsfire
Definition PerfTimers.hpp:84
double sec_fv_nodesolve
Definition PerfTimers.hpp:73
double sec_fv_bndcallback
Definition PerfTimers.hpp:81
void count(long &c, long n=1) noexcept
Definition PerfTimers.hpp:300
double sec_2d_advance
Definition PerfTimers.hpp:18
long n_fv_alg_resid
Definition PerfTimers.hpp:101
long n_fv_invert
Definition PerfTimers.hpp:91
double sec_res_extfiles
Definition PerfTimers.hpp:39
bool enabled() noexcept
True when OPENSWMM_PERF is set. Cached — getenv is not free.
Definition PerfTimers.hpp:178
double sec_start_iface
Definition PerfTimers.hpp:51
void reset_fv() noexcept
Zeroes the FV phase accumulators. Called from Router::initFv.
Definition PerfTimers.hpp:105
double sec_fv_reconstruct
Definition PerfTimers.hpp:83
long n_fv_savestate
Definition PerfTimers.hpp:92
double sec_res_xsect
Definition PerfTimers.hpp:42
long n_fv_alg_solve
Definition PerfTimers.hpp:100
double sec_open_validate
Definition PerfTimers.hpp:35
double sec_fv_restore
Definition PerfTimers.hpp:79
double sec_init_geometry
Definition PerfTimers.hpp:49
double sec_fv_settle
Definition PerfTimers.hpp:85
long n_fv_structref
Definition PerfTimers.hpp:94
void dump_fv() noexcept
One machine-scrapeable line for the FV phase split.
Definition PerfTimers.hpp:130
std::chrono::steady_clock::time_point now() noexcept
Manual timing pair, for phases that do not fit a lexical scope.
Definition PerfTimers.hpp:170
double sec_fv_structref
Definition PerfTimers.hpp:80
long n_fv_alg_flux
Definition PerfTimers.hpp:102
double sec_start_plugins
Definition PerfTimers.hpp:52
double sec_fv_tier
Definition PerfTimers.hpp:86
double sec_res_shrink
Definition PerfTimers.hpp:43
double sec_2d_window
Definition PerfTimers.hpp:17
double sec_fv_flux
Definition PerfTimers.hpp:72
double sec_fv_positivity
Definition PerfTimers.hpp:74
double sec_open_prescan2d
Definition PerfTimers.hpp:28
void dump_load() noexcept
One machine-scrapeable line per phase on stderr.
Definition PerfTimers.hpp:200
double sec_fv_savestate
Definition PerfTimers.hpp:78
double sec_init_quality
Definition PerfTimers.hpp:48
long n_fv_substep
Definition PerfTimers.hpp:88
long n_fv_restore
Definition PerfTimers.hpp:93
double sec_res_transects
Definition PerfTimers.hpp:41
double sec_fv_refreshdep
Definition PerfTimers.hpp:77
double since(std::chrono::steady_clock::time_point t0) noexcept
Definition PerfTimers.hpp:173
double sec_fv_rebuild
Definition PerfTimers.hpp:82
long n_fv_census
Definition PerfTimers.hpp:89
double sec_fv_nodeupdate
Definition PerfTimers.hpp:76
double sec_fv_census
Definition PerfTimers.hpp:71
long n_fv_alg_passthru
Definition PerfTimers.hpp:97
long n_fv_census_face
Definition PerfTimers.hpp:90
double sec_open_resolve
Definition PerfTimers.hpp:34
double sec_1d_step
Definition PerfTimers.hpp:19
double sec_init_state
Definition PerfTimers.hpp:45
double outer
enclosing timer's tally, restored on close
Definition PerfTimers.hpp:274
GatedTimer & operator=(const GatedTimer &)=delete
double * acc
Definition PerfTimers.hpp:273
~GatedTimer() noexcept
Definition PerfTimers.hpp:284
std::chrono::steady_clock::time_point t0
Definition PerfTimers.hpp:275
GatedTimer(const GatedTimer &)=delete
GatedTimer(double &a) noexcept
Definition PerfTimers.hpp:276
ScopedTimer(const ScopedTimer &)=delete
ScopedTimer(double &a) noexcept
Definition PerfTimers.hpp:230
std::chrono::steady_clock::time_point t0
Definition PerfTimers.hpp:229
~ScopedTimer() noexcept
Definition PerfTimers.hpp:232
ScopedTimer & operator=(const ScopedTimer &)=delete
double * acc
Definition PerfTimers.hpp:228