Peano
Loading...
Searching...
No Matches
tarch::logging::ChromeTraceFileLogger Class Reference

Chrome Trace File Logger. More...

#include <ChromeTraceFileLogger.h>

Collaboration diagram for tarch::logging::ChromeTraceFileLogger:

Public Member Functions

 ~ChromeTraceFileLogger ()
 
void debug (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void info (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void warning (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void error (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void traceIn (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void traceOut (long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void indent (bool indent, const std::string &trace, const std::string &message)
 Tells the logger to increment/decrement the indent.
 
void setOutputFile (const std::string &outputLogFileName)
 Is redundant, as you could use setLogFormat() instead.
 
void setQuitOnError (bool value)
 
void close ()
 

Static Public Member Functions

static ChromeTraceFileLoggergetInstance ()
 

Private Member Functions

void nextEntry ()
 
ChromeTraceFileLoggeroperator= (const ChromeTraceFileLogger &)
 Declared private since assignment does not make sense for an output class (output information mismatch).
 
 ChromeTraceFileLogger (const ChromeTraceFileLogger &)
 Declared private since copying does not make sense for an output class (output information mismatch).
 
std::string addSeparators (std::string message) const
 Ensures each column has same length.
 
std::string constructMessageString (std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 Construct message string for output to terminal.
 
std::string constructEventEntryInTraceFile (std::string messageType, long int timestampMS, int rank, int threadId, const std::string &trace, const std::string &message)
 
void configureOutputStreams ()
 Configures the output streams.
 
 ChromeTraceFileLogger ()
 It's a singleton.
 

Private Attributes

tarch::multicore::BooleanSemaphore _semaphore
 
std::ostream * _outputStream
 Test for the column separator of a string output.
 
bool _quitOnError
 
bool _hasWrittenEntry
 

Static Private Attributes

static Log _log
 
static ChromeTraceFileLogger _singleton
 

Detailed Description

Chrome Trace File Logger.

To visualise the output files, either use Google's Chrome or the trace file viewer from The Chromium Projects. In Ubuntu, simply install the Chromium web browser. Once launched, type in chrome://tracing/ and press enter. After that, you can load the trace file.

Author
Tobias Weinzierl

Definition at line 34 of file ChromeTraceFileLogger.h.

Constructor & Destructor Documentation

◆ ChromeTraceFileLogger() [1/2]

tarch::logging::ChromeTraceFileLogger::ChromeTraceFileLogger ( const ChromeTraceFileLogger & )
private

Declared private since copying does not make sense for an output class (output information mismatch).

Definition at line 64 of file ChromeTraceFileLogger.cpp.

◆ ChromeTraceFileLogger() [2/2]

tarch::logging::ChromeTraceFileLogger::ChromeTraceFileLogger ( )
private

It's a singleton.

Definition at line 26 of file ChromeTraceFileLogger.cpp.

References configureOutputStreams().

Here is the call graph for this function:

◆ ~ChromeTraceFileLogger()

tarch::logging::ChromeTraceFileLogger::~ChromeTraceFileLogger ( )

Definition at line 67 of file ChromeTraceFileLogger.cpp.

Member Function Documentation

◆ addSeparators()

std::string tarch::logging::ChromeTraceFileLogger::addSeparators ( std::string message) const
private

Ensures each column has same length.

Definition at line 74 of file ChromeTraceFileLogger.cpp.

◆ close()

void tarch::logging::ChromeTraceFileLogger::close ( )

Definition at line 291 of file ChromeTraceFileLogger.cpp.

◆ configureOutputStreams()

void tarch::logging::ChromeTraceFileLogger::configureOutputStreams ( )
private

Configures the output streams.

Definition at line 47 of file ChromeTraceFileLogger.cpp.

Referenced by ChromeTraceFileLogger().

Here is the caller graph for this function:

◆ constructEventEntryInTraceFile()

std::string tarch::logging::ChromeTraceFileLogger::constructEventEntryInTraceFile ( std::string messageType,
long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )
private

Definition at line 107 of file ChromeTraceFileLogger.cpp.

◆ constructMessageString()

std::string tarch::logging::ChromeTraceFileLogger::constructMessageString ( std::string messageType,
long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )
private

Construct message string for output to terminal.

I pipe data to the terminal for error messages, warnings and infos.

Definition at line 87 of file ChromeTraceFileLogger.cpp.

◆ debug()

void tarch::logging::ChromeTraceFileLogger::debug ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 131 of file ChromeTraceFileLogger.cpp.

Referenced by kernel_impl.impl::alloc(), kernel_impl.impl::loop(), and kernel_impl.impl::stencil().

Here is the caller graph for this function:

◆ error()

void tarch::logging::ChromeTraceFileLogger::error ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 239 of file ChromeTraceFileLogger.cpp.

References tarch::mpi::Rank::abort().

Here is the call graph for this function:

◆ getInstance()

tarch::logging::ChromeTraceFileLogger & tarch::logging::ChromeTraceFileLogger::getInstance ( )
static

Definition at line 34 of file ChromeTraceFileLogger.cpp.

Referenced by main(), and main().

Here is the caller graph for this function:

◆ indent()

void tarch::logging::ChromeTraceFileLogger::indent ( bool indent,
const std::string & trace,
const std::string & message )

Tells the logger to increment/decrement the indent.

Implemented for compatibility reasons

Definition at line 260 of file ChromeTraceFileLogger.cpp.

Referenced by printers.cpp_printer::alloc(), kernel_impl.impl::alloc(), printers.cpp_printer::loop(), kernel_impl.impl::loop(), and kernel_impl.impl::stencil().

Here is the caller graph for this function:

◆ info()

void tarch::logging::ChromeTraceFileLogger::info ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 153 of file ChromeTraceFileLogger.cpp.

◆ nextEntry()

void tarch::logging::ChromeTraceFileLogger::nextEntry ( )
private

Definition at line 39 of file ChromeTraceFileLogger.cpp.

◆ operator=()

tarch::logging::ChromeTraceFileLogger & tarch::logging::ChromeTraceFileLogger::operator= ( const ChromeTraceFileLogger & )
private

Declared private since assignment does not make sense for an output class (output information mismatch).

Definition at line 59 of file ChromeTraceFileLogger.cpp.

◆ setOutputFile()

void tarch::logging::ChromeTraceFileLogger::setOutputFile ( const std::string & outputLogFileName)

Is redundant, as you could use setLogFormat() instead.

However, it is tedious to specify all of these parameters if the only thing you want is to establish an output file.

Definition at line 262 of file ChromeTraceFileLogger.cpp.

References tarch::mpi::Rank::getInstance(), and tarch::mpi::Rank::getRank().

Referenced by main(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setQuitOnError()

void tarch::logging::ChromeTraceFileLogger::setQuitOnError ( bool value)

Definition at line 286 of file ChromeTraceFileLogger.cpp.

◆ traceIn()

void tarch::logging::ChromeTraceFileLogger::traceIn ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 195 of file ChromeTraceFileLogger.cpp.

◆ traceOut()

void tarch::logging::ChromeTraceFileLogger::traceOut ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 217 of file ChromeTraceFileLogger.cpp.

◆ warning()

void tarch::logging::ChromeTraceFileLogger::warning ( long int timestampMS,
int rank,
int threadId,
const std::string & trace,
const std::string & message )

Definition at line 174 of file ChromeTraceFileLogger.cpp.

Field Documentation

◆ _hasWrittenEntry

bool tarch::logging::ChromeTraceFileLogger::_hasWrittenEntry
private

Definition at line 47 of file ChromeTraceFileLogger.h.

◆ _log

tarch::logging::Log tarch::logging::ChromeTraceFileLogger::_log
staticprivate

Definition at line 36 of file ChromeTraceFileLogger.h.

◆ _outputStream

std::ostream* tarch::logging::ChromeTraceFileLogger::_outputStream
private

Test for the column separator of a string output.

Definition at line 45 of file ChromeTraceFileLogger.h.

◆ _quitOnError

bool tarch::logging::ChromeTraceFileLogger::_quitOnError
private

Definition at line 46 of file ChromeTraceFileLogger.h.

◆ _semaphore

tarch::multicore::BooleanSemaphore tarch::logging::ChromeTraceFileLogger::_semaphore
private

Definition at line 40 of file ChromeTraceFileLogger.h.

◆ _singleton

tarch::logging::ChromeTraceFileLogger tarch::logging::ChromeTraceFileLogger::_singleton
staticprivate

Definition at line 38 of file ChromeTraceFileLogger.h.


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