|
DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
|
Process-wide singleton aggregating wall-clock timings by category. More...
#include <Profiling.hpp>
Public Types | |
| enum | TimerType { Unknown = 0 , RHS = 1 , Dt = 2 , Reconstruction = 3 , ReconstructionCR = 4 , Limiter = 5 , LimiterA = 6 , LimiterB = 7 , Basis = 8 , Comm = 9 , Comm1 = 10 , Comm2 = 11 , Comm3 = 12 , LinSolve = 13 , LinSolve1 = 14 , LinSolve2 = 15 , LinSolve3 = 16 , Positivity = 17 , PositivityOuter = 18 , __EndTimerType = 64 } |
Named timer slots. New categories can be added before __EndTimerType. More... | |
Public Member Functions | |
| void | StartTimer (TimerType t) |
Record the current wall time in the "start" slot for timer t. | |
| void | StartTimer (int t) |
| Integer-id overload of StartTimer. | |
| void | StopTimer (TimerType t) |
Add (now - start) to the accumulated time for timer t. | |
| void | StopTimer (int t) |
| Integer-id overload of StopTimer. | |
| real | getTimer (TimerType t) |
| Current local (this-rank) accumulated wall time (seconds). | |
| real | getTimer (int t) |
| real | getTimerCollective (TimerType t, const MPIInfo &mpi) |
Global maximum across ranks (collective on mpi.comm). | |
| real | getTimerCollective (int t, const MPIInfo &mpi) |
| template<typename T > | |
| real | getTimerColOrLoc (T t, const MPIInfo &mpi, bool col) |
Either getTimerCollective (when col == true) or getTimer. | |
| void | clearTimer (TimerType t) |
| Zero the accumulated time for one timer slot. | |
| void | clearTimer (int t) |
| void | clearAllTimer () |
| Zero every timer slot. | |
Static Public Member Functions | |
| static PerformanceTimer & | Instance () |
| Access the process-wide singleton. | |
Static Public Attributes | |
| static const int | Ntype = __EndTimerType |
| static const int | Ntype_Past = 64 |
| static const int | Ntype_All = Ntype + Ntype_Past |
Process-wide singleton aggregating wall-clock timings by category.
Provides a fixed set of named timer slots (RHS, Comm, LinSolve, ...) that callers start / stop at well-known phases of the solver. Calls are expected to nest correctly (each StartTimer matched by a StopTimer).
The buffer holds two copies of each slot (Ntype_All == 2 * Ntype) so current and previous-iteration timings can be retained for reporting.
Thread-safe C++11 singleton; not reentrant for the same timer id.
Definition at line 22 of file Profiling.hpp.
Named timer slots. New categories can be added before __EndTimerType.
| Enumerator | |
|---|---|
| Unknown | |
| RHS | Total RHS evaluation. |
| Dt | Time-step computation. |
| Reconstruction | Variational reconstruction. |
| ReconstructionCR | CR (compact reconstruction) branch. |
| Limiter | Slope / variable limiter. |
| LimiterA | Limiter sub-phase A. |
| LimiterB | Limiter sub-phase B. |
| Basis | Basis-function evaluation. |
| Comm | Catch-all MPI comm. |
| Comm1 | Comm phase 1 (e.g., cell-ghost). |
| Comm2 | Comm phase 2 (e.g., face-ghost). |
| Comm3 | Comm phase 3. |
| LinSolve | Linear solve (total). |
| LinSolve1 | Linear solve phase 1. |
| LinSolve2 | Linear solve phase 2. |
| LinSolve3 | Linear solve phase 3. |
| Positivity | Positivity preservation. |
| PositivityOuter | Outer-iteration positivity. |
| __EndTimerType | One past the last valid id. |
Definition at line 26 of file Profiling.hpp.
| void DNDS::PerformanceTimer::clearAllTimer | ( | ) |
Zero every timer slot.
Definition at line 69 of file Profiling.cpp.
| void DNDS::PerformanceTimer::clearTimer | ( | int | t | ) |
Definition at line 64 of file Profiling.cpp.
| void DNDS::PerformanceTimer::clearTimer | ( | TimerType | t | ) |
Zero the accumulated time for one timer slot.
Definition at line 59 of file Profiling.cpp.
| real DNDS::PerformanceTimer::getTimer | ( | int | t | ) |
Definition at line 40 of file Profiling.cpp.
Current local (this-rank) accumulated wall time (seconds).
Definition at line 35 of file Profiling.cpp.
Global maximum across ranks (collective on mpi.comm).
Definition at line 45 of file Profiling.cpp.
|
inline |
Either getTimerCollective (when col == true) or getTimer.
Definition at line 80 of file Profiling.hpp.
|
static |
Access the process-wide singleton.
Definition at line 9 of file Profiling.cpp.
| void DNDS::PerformanceTimer::StartTimer | ( | int | t | ) |
Integer-id overload of StartTimer.
Definition at line 20 of file Profiling.cpp.
| void DNDS::PerformanceTimer::StartTimer | ( | TimerType | t | ) |
Record the current wall time in the "start" slot for timer t.
Definition at line 15 of file Profiling.cpp.
| void DNDS::PerformanceTimer::StopTimer | ( | int | t | ) |
Integer-id overload of StopTimer.
Definition at line 30 of file Profiling.cpp.
| void DNDS::PerformanceTimer::StopTimer | ( | TimerType | t | ) |
Add (now - start) to the accumulated time for timer t.
Definition at line 25 of file Profiling.cpp.
|
static |
Definition at line 50 of file Profiling.hpp.
|
static |
Definition at line 52 of file Profiling.hpp.
|
static |
Definition at line 51 of file Profiling.hpp.