Provides an encapsulation to measure the system time. More...

#include <timer.hh>

Public Member Functions

 Timer ()
 
void start ()
 Start counting the time resources used by the simulation. More...
 
double stop ()
 Stop counting the time resources. More...
 
void halt ()
 Stop the measurement reset all timing values. More...
 
void reset ()
 Make the current point in time t=0 but do not change the status of the timer. More...
 
double realTimeElapsed () const
 Return the real time [s] elapsed during the periods the timer was active since the last reset. More...
 
double elapsed () const
 This is an alias for realTimeElapsed() More...
 
double cpuTimeElapsed () const
 Return the CPU time [s] used by all threads of the local process for the periods the timer was active. More...
 
double globalCpuTimeElapsed () const
 Return the CPU time [s] used by all threads of the all processes of program. More...
 
Timeroperator+= (const Timer &other)
 Adds the time of another timer to the current one. More...
 

Detailed Description

Provides an encapsulation to measure the system time.

This means the wall clock time used by the simulation, the CPU time used by all threads of a single process and the CPU time used by the overall simulation. (i.e., the time used by all threads of all involved processes.)

Constructor & Destructor Documentation

◆ Timer()

Opm::Timer::Timer ( )
inline

References halt().

Member Function Documentation

◆ cpuTimeElapsed()

double Opm::Timer::cpuTimeElapsed ( ) const
inline

Return the CPU time [s] used by all threads of the local process for the periods the timer was active.

Referenced by globalCpuTimeElapsed(), and operator+=().

◆ elapsed()

double Opm::Timer::elapsed ( ) const
inline

This is an alias for realTimeElapsed()

Its main purpose is to make the API of the class a superset of Dune::Timer

References realTimeElapsed().

◆ globalCpuTimeElapsed()

double Opm::Timer::globalCpuTimeElapsed ( ) const
inline

Return the CPU time [s] used by all threads of the all processes of program.

The value returned only differs from cpuTimeElapsed() if MPI is used.

References cpuTimeElapsed().

◆ halt()

void Opm::Timer::halt ( )
inline

◆ operator+=()

Timer & Opm::Timer::operator+= ( const Timer other)
inline

Adds the time of another timer to the current one.

References cpuTimeElapsed(), and realTimeElapsed().

◆ realTimeElapsed()

double Opm::Timer::realTimeElapsed ( ) const
inline

Return the real time [s] elapsed during the periods the timer was active since the last reset.

Referenced by Opm::NewtonMethod< TypeTag >::apply(), elapsed(), operator+=(), and Opm::Simulator< TypeTag >::run().

◆ reset()

void Opm::Timer::reset ( )
inline

Make the current point in time t=0 but do not change the status of the timer.

◆ start()

◆ stop()

double Opm::Timer::stop ( )
inline

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