votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::DFTTimings Class Reference

Wall-clock accounting for the parts of a DFT run. More...

#include <dfttimings.h>

Collaboration diagram for votca::xtp::DFTTimings:

Classes

class  Scope
struct  Entry

Public Types

using Clock = std::chrono::steady_clock

Public Member Functions

Scope Measure (const std::string &name)
void Add (const std::string &name, double seconds)
void Reset ()
double Elapsed () const
void Report (Logger &log, Log::Level level) const
 Table of all entries with their share of the time since Reset().

Static Public Member Functions

static double ResidentMemoryGB (bool peak)

Private Member Functions

void AddEntry (const std::string &name, double seconds)

Private Attributes

std::vector< Entry > entries_
std::vector< double > nested_
Clock::time_point start_ = Clock::now()

Detailed Description

Wall-clock accounting for the parts of a DFT run.

Entries keep the order in which they were first used, so the report reads like the run. Scopes may nest; each entry holds only its own time, without the time of scopes nested inside it, so the entries add up to the total. Scopes must be opened and closed on one thread (the serial driver code), not inside OpenMP regions.

Definition at line 45 of file dfttimings.h.

Member Typedef Documentation

◆ Clock

using votca::xtp::DFTTimings::Clock = std::chrono::steady_clock

Definition at line 47 of file dfttimings.h.

Member Function Documentation

◆ Add()

void votca::xtp::DFTTimings::Add ( const std::string & name,
double seconds )
inline

Adds time measured elsewhere. Inside an open scope it is taken out of that scope's own time, as if it had been a nested scope.

Definition at line 78 of file dfttimings.h.

◆ AddEntry()

void votca::xtp::DFTTimings::AddEntry ( const std::string & name,
double seconds )
inlineprivate

Definition at line 104 of file dfttimings.h.

◆ Elapsed()

double votca::xtp::DFTTimings::Elapsed ( ) const
inline

Definition at line 91 of file dfttimings.h.

◆ Measure()

Scope votca::xtp::DFTTimings::Measure ( const std::string & name)
inline

Definition at line 74 of file dfttimings.h.

◆ Report()

void votca::xtp::DFTTimings::Report ( Logger & log,
Log::Level level ) const

Table of all entries with their share of the time since Reset().

Definition at line 29 of file dfttimings.cc.

◆ Reset()

void votca::xtp::DFTTimings::Reset ( )
inline

Definition at line 85 of file dfttimings.h.

◆ ResidentMemoryGB()

double votca::xtp::DFTTimings::ResidentMemoryGB ( bool peak)
static

Resident memory of this process in GB, read from /proc/self/status (VmRSS, or VmHWM for the peak). Returns a negative value where that file does not exist.

Definition at line 57 of file dfttimings.cc.

Member Data Documentation

◆ entries_

std::vector<Entry> votca::xtp::DFTTimings::entries_
private

Definition at line 120 of file dfttimings.h.

◆ nested_

std::vector<double> votca::xtp::DFTTimings::nested_
private

Definition at line 121 of file dfttimings.h.

◆ start_

Clock::time_point votca::xtp::DFTTimings::start_ = Clock::now()
private

Definition at line 122 of file dfttimings.h.


The documentation for this class was generated from the following files: