timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::component::peak_rss Struct Reference

this struct extracts the high-water mark (or a change in the high-water mark) of the resident set size (RSS). Which is current amount of memory in RAM. When used on a system with swap enabled, this value may fluctuate but should not on an HPC system. More...

#include "timemory/components/rusage/components.hpp"

+ Collaboration diagram for tim::component::peak_rss:

Public Types

using storage_type = empty_storage
 
using base_type = void
 

Public Member Functions

double get () const
 
double get_display () const
 
void start ()
 
void stop ()
 
void sample ()
 sample a measurement More...
 
void sample (const cache_type &_cache)
 sample a measurement from cached data More...
 
void start (const cache_type &_cache)
 start a measurement using the cached data More...
 
void stop (const cache_type &_cache)
 stop a measurement using the cached data More...
 

Static Public Member Functions

static std::string label ()
 
static std::string description ()
 
static value_type record ()
 
static value_type record (const cache_type &_cache)
 read the value from cached data More...
 
template<typename... Args>
static opaque get_opaque (Args &&...)
 

Detailed Description

this struct extracts the high-water mark (or a change in the high-water mark) of the resident set size (RSS). Which is current amount of memory in RAM. When used on a system with swap enabled, this value may fluctuate but should not on an HPC system.

Definition at line 50 of file components.hpp.

Member Typedef Documentation

◆ base_type

using tim::component::empty_base::base_type = void
inherited

Definition at line 67 of file declaration.hpp.

◆ storage_type

Definition at line 66 of file declaration.hpp.

Member Function Documentation

◆ description()

static std::string tim::component::peak_rss::description ( )
inlinestatic

Definition at line 53 of file components.hpp.

54 {
55 return "Measures changes in the high-water mark for the amount of memory "
56 "allocated in RAM. May fluctuate if swap is enabled";
57 }

◆ get()

double tim::component::peak_rss::get ( ) const
inline

Definition at line 59 of file components.hpp.

60 {
61 auto val = base_type::load();
62 return val / static_cast<double>(base_type::get_unit());
63 }
void load(Archive &ar, tim::node::graph< Tp > &d)
Definition: node.hpp:520

References tim::cereal::load().

Referenced by get_display().

◆ get_display()

double tim::component::peak_rss::get_display ( ) const
inline

Definition at line 64 of file components.hpp.

64{ return get(); }

References get().

◆ get_opaque()

template<typename... Args>
static opaque tim::component::empty_base::get_opaque ( Args &&  ...)
inlinestaticinherited

Definition at line 72 of file declaration.hpp.

73 {
74 return opaque{};
75 }

◆ label()

static std::string tim::component::peak_rss::label ( )
inlinestatic

Definition at line 52 of file components.hpp.

52{ return "peak_rss"; }

◆ record() [1/2]

static value_type tim::component::peak_rss::record ( )
inlinestatic

Definition at line 58 of file components.hpp.

58{ return get_peak_rss(); }

Referenced by sample(), start(), and stop().

◆ record() [2/2]

static value_type tim::component::peak_rss::record ( const cache_type _cache)
inlinestatic

read the value from cached data

Definition at line 83 of file components.hpp.

83{ return _cache.get_peak_rss(); }

◆ sample() [1/2]

void tim::component::peak_rss::sample ( )
inline

sample a measurement

Definition at line 74 of file components.hpp.

74{ accum = value = std::max<int64_t>(value, record()); }
static value_type record()
Definition: components.hpp:58

References record().

◆ sample() [2/2]

void tim::component::peak_rss::sample ( const cache_type _cache)
inline

sample a measurement from cached data

Definition at line 77 of file components.hpp.

78 {
79 accum = value = std::max<int64_t>(value, record(_cache));
80 }

References record().

◆ start() [1/2]

void tim::component::peak_rss::start ( )
inline

Definition at line 66 of file components.hpp.

66{ value = record(); }

References record().

◆ start() [2/2]

void tim::component::peak_rss::start ( const cache_type _cache)
inline

start a measurement using the cached data

Definition at line 86 of file components.hpp.

86{ value = record(_cache); }

References record().

◆ stop() [1/2]

void tim::component::peak_rss::stop ( )
inline

Definition at line 67 of file components.hpp.

68 {
69 value = (record() - value);
70 accum += value;
71 }

References record().

◆ stop() [2/2]

void tim::component::peak_rss::stop ( const cache_type _cache)
inline

stop a measurement using the cached data

Definition at line 89 of file components.hpp.

90 {
91 auto tmp = record(_cache);
92 auto delta = tmp - value;
93 accum = std::max(static_cast<const value_type&>(accum), delta);
94 value = tmp;
95 }
::tim::statistics< Tp > max(::tim::statistics< Tp > lhs, const Tp &rhs)
Definition: statistics.hpp:320

References std::max(), and record().


The documentation for this struct was generated from the following file: