vibeqc.PerfTracker¶
- class vibeqc.PerfTracker(phases=<factory>, scf_iters=<factory>, memory_snapshots=<factory>, threads=1, t_start=<factory>)[source]¶
Bases:
objectAccumulator for per-phase wall/CPU timings, per-iteration SCF rows, and memory snapshots over the course of a calculation.
Constructed inside
perf_log()and passed implicitly to everyPerfScopeopened in the same async-context (usescontextvars.ContextVar, so perf trackers do NOT leak across threads or asyncio tasks). Call sites that want to read the live tracker — to add a custom snapshot, for instance — useactive_tracker().Public attributes:
phases— mapphase_name → _PhaseStat;wall_son each entry is the cumulative wall time across all calls.scf_iters— list of per-iteration dicts (energy / dE / grad / DIIS / wall_s); populated by SCF entry points wired into the progress logger.memory_snapshots— list of{label, rss_mb, t_s}taken at SCF transitions.threads— snapshot of the OpenMP thread count at tracker construction (used to compute parallelism = cpu_s / (wall_s × threads) per phase).t_start— perf_counter timestamp; phase rows report wall-time deltas relative to this anchor.
- Parameters:
- __init__(phases=<factory>, scf_iters=<factory>, memory_snapshots=<factory>, threads=1, t_start=<factory>)¶
Methods
__init__([phases, scf_iters, ...])add_scf_iter(**fields)Record one SCF iteration.
add_scope(name, wall_s, cpu_s)snapshot_memory(label)Take a labeled RSS snapshot.
Attributes
- add_scf_iter(**fields)[source]¶
Record one SCF iteration. Recognized keys:
iter,energy,dE,grad,diis. Extra keys are kept verbatim in the row.- Parameters:
fields (Any)
- Return type:
None