Opm::Timer Class Reference

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

#include <timer.hpp>

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 ( )

Member Function Documentation

◆ cpuTimeElapsed()

double Opm::Timer::cpuTimeElapsed ( ) const

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

◆ 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

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.

◆ halt()

void Opm::Timer::halt ( )

◆ operator+=()

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

Adds the time of another timer to the current one.

◆ realTimeElapsed()

double Opm::Timer::realTimeElapsed ( ) const

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

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

◆ reset()

void Opm::Timer::reset ( )

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

◆ start()

◆ stop()

double Opm::Timer::stop ( )

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