profiler  0.0
molpro::profiler::Counter Class Reference

Resource counter used for storing operation count, call count, timing information. More...

#include <Counter.h>

Collaboration diagram for molpro::profiler::Counter:

Public Member Functions

 Counter ()=default
 
 Counter (bool with_cpu_time, bool with_wall_time)
 
 Counter (size_t call_count_, size_t operation_count_, double wall_time_, double cpu_time_, bool with_cpu_time, bool with_wall_time)
 Construct counter with initial values. More...
 
Counterstart ()
 Start timing, and increment call_count;. More...
 
Counterstop ()
 Stop timing. More...
 
Counterreset ()
 Reset all counters and timers. More...
 
void add_operations (size_t ops)
 Add to the operation count. More...
 
void operator+= (const Counter &other)
 Accumulates all attributes. More...
 
size_t get_call_count () const
 
size_t get_operation_count () const
 
const Timerget_cpu () const
 
const Timerget_wall () const
 

Protected Attributes

size_t call_count = 0
 number of times this node was merged More...
 
size_t operation_count = 0
 number of operations performed More...
 
Timer cpu = {Timer::cpu, true}
 cpu time More...
 
Timer wall = {Timer::wall, true}
 wall time More...
 

Detailed Description

Resource counter used for storing operation count, call count, timing information.

Constructor & Destructor Documentation

◆ Counter() [1/3]

molpro::profiler::Counter::Counter ( )
default

◆ Counter() [2/3]

molpro::profiler::Counter::Counter ( bool  with_cpu_time,
bool  with_wall_time 
)

◆ Counter() [3/3]

molpro::profiler::Counter::Counter ( size_t  call_count_,
size_t  operation_count_,
double  wall_time_,
double  cpu_time_,
bool  with_cpu_time,
bool  with_wall_time 
)

Construct counter with initial values.

Member Function Documentation

◆ add_operations()

void molpro::profiler::Counter::add_operations ( size_t  ops)
inline

Add to the operation count.

◆ get_call_count()

size_t molpro::profiler::Counter::get_call_count ( ) const
inline

◆ get_cpu()

const Timer& molpro::profiler::Counter::get_cpu ( ) const
inline

◆ get_operation_count()

size_t molpro::profiler::Counter::get_operation_count ( ) const
inline

◆ get_wall()

const Timer& molpro::profiler::Counter::get_wall ( ) const
inline

◆ operator+=()

void molpro::profiler::Counter::operator+= ( const Counter other)

Accumulates all attributes.

◆ reset()

Counter & molpro::profiler::Counter::reset ( )

Reset all counters and timers.

◆ start()

Counter & molpro::profiler::Counter::start ( )

Start timing, and increment call_count;.

◆ stop()

Counter & molpro::profiler::Counter::stop ( )

Stop timing.

Member Data Documentation

◆ call_count

size_t molpro::profiler::Counter::call_count = 0
protected

number of times this node was merged

◆ cpu

Timer molpro::profiler::Counter::cpu = {Timer::cpu, true}
protected

cpu time

◆ operation_count

size_t molpro::profiler::Counter::operation_count = 0
protected

number of operations performed

◆ wall

Timer molpro::profiler::Counter::wall = {Timer::wall, true}
protected

wall time