All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Static Public Attributes
tools::Logger Class Reference

List of all members.

Public Member Functions

 Logger (const int i_processRank=0, const std::string i_programName="SWE", const std::string i_welcomeMessage="Welcome to", const std::string i_copyRights="\n\nSWE Copyright (C) 2012-2013\n"" Technische Universitaet Muenchen\n"" Department of Informatics\n"" Chair of Scientific Computing\n"" http://www5.in.tum.de/SWE\n""\n""SWE comes with ABSOLUTELY NO WARRANTY.\n""SWE is free software, and you are welcome to redistribute it\n""under certain conditions.\n""Details can be found in the file \'gpl.txt\'.", const std::string i_finishMessage="finished successfully.", const std::string i_midDelimiter="\n------------------------------------------------------------------\n", const std::string i_largeDelimiter="\n*************************************************************\n", const std::string i_indentation="\t")
virtual ~Logger ()
void printWelcomeMessage ()
void printFinishMessage ()
std::ostream & cout ()
void setProcessRank (const int i_processRank)
void printString (const std::string i_string)
void printNumberOfProcesses (const int i_numberOfProcesses, const std::string i_processesName="MPI processes")
void printNumberOfCells (const int i_nX, const int i_nY, const std::string i_cellMessage="cells")
void printNumberOfCellsPerProcess (const int i_nX, const int i_nY)
void printCellSize (const float i_dX, const float i_dY, const std::string i_unit="m")
void printNumberOfBlocks (const int i_nX, const int i_nY)
void printStartMessage (const std::string i_startMessage="Everything is set up, starting the simulation.")
void printSimulationTime (const float i_time, const std::string i_simulationTimeMessage="Simulation at time")
void printOutputFileCreation (const std::string i_fileName, const int i_blockX, const int i_blockY, const std::string i_fileType="netCDF")
void printOutputTime (const float i_time, const std::string i_outputTimeMessage="Writing output file at time")
void printStatisticsMessage (const std::string i_statisticsMessage="Simulation finished. Printing statistics for each process.")
void printSolverStatistics (const long i_firstSolverCounter, const long i_secondSolverCounter, const int i_blockX=0, const int i_blockY=0, const std::string i_firstSolverName="f-Wave solver", const std::string i_secondSolverName="Augemented Riemann solver")
void updateCpuTime ()
void updateCpuCommunicationTime ()
void resetCpuClockToCurrentTime ()
void resetCpuCommunicationClockToCurrentTime ()
void initWallClockTime (const double i_wallClockTime)
void printWallClockTime (const double i_wallClockTime, const std::string i_wallClockTimeMessage="wall clock time")
void printCpuTime (const std::string i_cpuTimeMessage="CPU time")
void printCpuCommunicationTime (const std::string i_cpuCommunicationTimeMessage="CPU + communication time")
void printIterationsDone (unsigned int i_iterations, std::string i_iterationMessage="iterations done")

Static Public Attributes

static Logger logger

Constructor & Destructor Documentation

tools::Logger::Logger ( const int  i_processRank = 0,
const std::string  i_programName = "SWE",
const std::string  i_welcomeMessage = "Welcome to",
const std::string  i_copyRights = "\n\nSWE Copyright (C) 2012-2013\n" "  Technische Universitaet Muenchen\n" "  Department of Informatics\n" "  Chair of Scientific Computing\n" "  http://www5.in.tum.de/SWE\n" "\n" "SWE comes with ABSOLUTELY NO WARRANTY.\n" "SWE is free software, and you are welcome to redistribute it\n" "under certain conditions.\n" "Details can be found in the file \'gpl.txt\'.",
const std::string  i_finishMessage = "finished successfully.",
const std::string  i_midDelimiter = "\n------------------------------------------------------------------\n",
const std::string  i_largeDelimiter = "\n*************************************************************\n",
const std::string  i_indentation = "\t" 
) [inline]

The Constructor. Prints the welcome message (process rank 0 only).

i_processRankrank of the constructing process.
i_programNamedefinition of the program name.
i_welcomeMessagedefinition of the welcome message.
i_startMessagedefinition of the start message.
i_simulationTimeMessagedefinition of the simulation time message.
i_executionTimeMessagedefinition of the execution time message.
i_cpuTimeMessagedefinition of the CPU time message.
i_finishMessagedefinition of the finish message.
i_midDelimiterdefinition of the mid-size delimiter.
i_largeDelimiterdefinition of the large delimiter.
i_indentationdefinition of the indentation (used in all messages, except welcome, start and finish).
virtual tools::Logger::~Logger ( ) [inline, virtual]

The Destructor. Prints the finish message (process rank 0 only).

Member Function Documentation

std::ostream& tools::Logger::cout ( ) [inline]

Default output stream of the logger.

extended (time + indentation) std::cout stream.
void tools::Logger::initWallClockTime ( const double  i_wallClockTime) [inline]

Initialize the wall clock time.

i_wallClockTimevalue the wall block time will be set to.
void tools::Logger::printCellSize ( const float  i_dX,
const float  i_dY,
const std::string  i_unit = "m" 
) [inline]

Print the size of a cell

i_dXsize in x-direction.
i_dYsize in y-direction.
i_unitmeasurement unit.
void tools::Logger::printCpuCommunicationTime ( const std::string  i_cpuCommunicationTimeMessage = "CPU + communication time") [inline]

Print elapsed CPU + communication time.

i_cpuCommunicationTimeMessageCPU + communication time message.
void tools::Logger::printCpuTime ( const std::string  i_cpuTimeMessage = "CPU time") [inline]

Print elapsed CPU time.

i_cpuTimeMessagecpu time message.

Print the finish message.

void tools::Logger::printIterationsDone ( unsigned int  i_iterations,
std::string  i_iterationMessage = "iterations done" 
) [inline]

Print number of iterations done

i_iterationsNumber of iterations done
i_interationMessageIterations done message
void tools::Logger::printNumberOfBlocks ( const int  i_nX,
const int  i_nY 
) [inline]

Print the number of defined blocks. (process rank 0 only)

i_nXnumber of blocks in x-direction.
i_nYnumber of blocks in y-direction.
void tools::Logger::printNumberOfCells ( const int  i_nX,
const int  i_nY,
const std::string  i_cellMessage = "cells" 
) [inline]

Print the number of cells. (process rank 0 only)

i_nXnumber of cells in x-direction.
i_nYnumber of cells in y-direction.
i_cellMessagecell message.
void tools::Logger::printNumberOfCellsPerProcess ( const int  i_nX,
const int  i_nY 
) [inline]

Print the number of cells per Process.

i_nXnumber of cells in x-direction.
i_nYnumber of cells in y-direction.
void tools::Logger::printNumberOfProcesses ( const int  i_numberOfProcesses,
const std::string  i_processesName = "MPI processes" 
) [inline]

Print the number of processes. (process rank 0 only)

i_numberOfProcessesnumber of processes.
i_processesNamename of the processes.
void tools::Logger::printOutputFileCreation ( const std::string  i_fileName,
const int  i_blockX,
const int  i_blockY,
const std::string  i_fileType = "netCDF" 
) [inline]

Print the creation of an output file.

i_fileNamename of the file.
i_blockXblock position in x-direction.
i_blockYblock position in y-direction.
i_fileTypetype of the output file.
void tools::Logger::printOutputTime ( const float  i_time,
const std::string  i_outputTimeMessage = "Writing output file at time" 
) [inline]

Print the current output time.

i_timetime in seconds.
i_outputTimeMessageoutput message.
void tools::Logger::printSimulationTime ( const float  i_time,
const std::string  i_simulationTimeMessage = "Simulation at time" 
) [inline]

Print current simulation time. (process rank 0 only)

i_timetime in seconds.
void tools::Logger::printSolverStatistics ( const long  i_firstSolverCounter,
const long  i_secondSolverCounter,
const int  i_blockX = 0,
const int  i_blockY = 0,
const std::string  i_firstSolverName = "f-Wave solver",
const std::string  i_secondSolverName = "Augemented Riemann solver" 
) [inline]

Print solver statistics

i_firstSolverCountertimes the first solver was used.
i_secondSolverCountertimes the second solver was used.
i_blockXposition of the block in x-direction
i_blockYposition of the block in y-direction
i_firstSolverNamename of the first solver.
i_secondSolverNamename of the second solver.
void tools::Logger::printStartMessage ( const std::string  i_startMessage = "Everything is set up, starting the simulation.") [inline]

Print the start message. (process rank 0 only)

void tools::Logger::printStatisticsMessage ( const std::string  i_statisticsMessage = "Simulation finished. Printing statistics for each process.") [inline]

Print the statics message.

i_statisticsMessagestatistics message.
void tools::Logger::printString ( const std::string  i_string) [inline]

Print an arbitrary string.

i_stringsome string.
void tools::Logger::printWallClockTime ( const double  i_wallClockTime,
const std::string  i_wallClockTimeMessage = "wall clock time" 
) [inline]

Print the elapsed wall clock time.

i_wallClockTimewall clock time message.

Print the welcome message.

void tools::Logger::setProcessRank ( const int  i_processRank) [inline]

Set the process rank.

i_processRankprocess rank.

Update the CPU-Communication time.

void tools::Logger::updateCpuTime ( ) [inline]

Update the CPU time.

Member Data Documentation

The logger all classes shoud use

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends