DOLFINx 0.10.0.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
TimeLogger Class Reference

Time logger maintaining data collected by Timer, if registered. More...

#include <TimeLogger.h>

Public Member Functions

void register_timing (std::string task, std::chrono::duration< double, std::ratio< 1 > > wall)
 Register timing (for later summary)
 
Table timing_table () const
 Return a summary of timings and tasks in a Table.
 
void list_timings (MPI_Comm comm, Table::Reduction reduction) const
 
std::pair< int, std::chrono::duration< double, std::ratio< 1 > > > timing (std::string task) const
 Return timing.
 
std::map< std::string, std::pair< int, std::chrono::duration< double, std::ratio< 1 > > > > timings () const
 Logged elapsed times.
 

Static Public Member Functions

static TimeLoggerinstance ()
 Singleton access.
 

Detailed Description

Time logger maintaining data collected by Timer, if registered.

Note
This is a monotstate, i.e. the data members are static and thus timings are aggregated into a single map.

Member Function Documentation

◆ instance()

TimeLogger & instance ( )
static

Singleton access.

Returns
Unique time logger object.

◆ list_timings()

void list_timings ( MPI_Comm comm,
Table::Reduction reduction ) const

List a summary of timings and tasks. Reduction type is printed.

Parameters
commMPI Communicator
reductionReduction type (min, max or average)

◆ timing()

std::pair< int, std::chrono::duration< double, std::ratio< 1 > > > timing ( std::string task) const

Return timing.

Parameters
[in]taskThe task name to retrieve the timing for
Returns
Values (count, total wall time) for given task.

◆ timings()

std::map< std::string, std::pair< int, std::chrono::duration< double, std::ratio< 1 > > > > timings ( ) const

Logged elapsed times.

Returns
Elapsed [task id: (count, total wall time)].

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