include/pops/runtime/program/profiler.hpp Source FileΒΆ
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
profiler.hpp
Go to the documentation of this file.
3// A lightweight per-node / per-brick profiler for the compiled Program step (Spec 3 section 29-30,
8// Cost when disabled: record()/count() are a single predictable branch (zero work). A ProfileScope
10// twice -- so wrap a per-node / per-brick scope (the intended granularity), not the tightest inner
11// loops. Single-threaded: a Profiler / ProfileScope is not thread-safe and must not be shared inside
12// a parallel region. Host/serial today; on a device backend a Kokkos::fence() must precede the scope
13// close so the timing reflects the kernel (the fence lives at the call site, not here -- this header
14// has no Kokkos dependency). MPI: each rank profiles itself; the report is per-rank (any reduction
82 // Track a named PEAK counter: set it to max(current, value) instead of accumulating. Used for the
83 // scratch peak memory (the largest single scratch allocation seen, in bytes), where the running sum
119 // A human-readable report in first-seen order: one line per scope (count / total / mean / min /
149// RAII scope: times its own lifetime into `prof` under `name`. One per Program node / brick call.
Definition profiler.hpp:151
ProfileScope(ProfileScope &&)=delete
ProfileScope(Profiler &prof, std::string name)
Definition profiler.hpp:153
ProfileScope & operator=(const ProfileScope &)=delete
ProfileScope & operator=(ProfileScope &&)=delete
ProfileScope(const ProfileScope &)=delete
Definition profiler.hpp:27
std::int64_t counter(const std::string &name) const
Definition profiler.hpp:103
const Entry * entry(const std::string &name) const
Definition profiler.hpp:98
void record(const std::string &name, double seconds)
Definition profiler.hpp:50
std::size_t scope_count() const
Definition profiler.hpp:117
void count(const std::string &name, std::int64_t by=1)
Definition profiler.hpp:69
void count_max(const std::string &name, std::int64_t value)
Definition profiler.hpp:85
Definition cache_manager.hpp:37
Definition profiler.hpp:29
Generated by