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 |
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_processRank | rank of the constructing process. |
i_programName | definition of the program name. |
i_welcomeMessage | definition of the welcome message. |
i_startMessage | definition of the start message. |
i_simulationTimeMessage | definition of the simulation time message. |
i_executionTimeMessage | definition of the execution time message. |
i_cpuTimeMessage | definition of the CPU time message. |
i_finishMessage | definition of the finish message. |
i_midDelimiter | definition of the mid-size delimiter. |
i_largeDelimiter | definition of the large delimiter. |
i_indentation | definition 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).
std::ostream& tools::Logger::cout | ( | ) | [inline] |
Default output stream of the logger.
void tools::Logger::initWallClockTime | ( | const double | i_wallClockTime | ) | [inline] |
Initialize the wall clock time.
i_wallClockTime | value 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_dX | size in x-direction. |
i_dY | size in y-direction. |
i_unit | measurement unit. |
void tools::Logger::printCpuCommunicationTime | ( | const std::string | i_cpuCommunicationTimeMessage = "CPU + communication time" | ) | [inline] |
Print elapsed CPU + communication time.
i_cpuCommunicationTimeMessage | CPU + communication time message. |
void tools::Logger::printCpuTime | ( | const std::string | i_cpuTimeMessage = "CPU time" | ) | [inline] |
Print elapsed CPU time.
i_cpuTimeMessage | cpu time message. |
void tools::Logger::printFinishMessage | ( | ) | [inline] |
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_iterations | Number of iterations done |
i_interationMessage | Iterations 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_nX | number of blocks in x-direction. |
i_nY | number 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_nX | number of cells in x-direction. |
i_nY | number of cells in y-direction. |
i_cellMessage | cell message. |
void tools::Logger::printNumberOfCellsPerProcess | ( | const int | i_nX, |
const int | i_nY | ||
) | [inline] |
Print the number of cells per Process.
i_nX | number of cells in x-direction. |
i_nY | number 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_numberOfProcesses | number of processes. |
i_processesName | name 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_fileName | name of the file. |
i_blockX | block position in x-direction. |
i_blockY | block position in y-direction. |
i_fileType | type 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_time | time in seconds. |
i_outputTimeMessage | output 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_time | time 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_firstSolverCounter | times the first solver was used. |
i_secondSolverCounter | times the second solver was used. |
i_blockX | position of the block in x-direction |
i_blockY | position of the block in y-direction |
i_firstSolverName | name of the first solver. |
i_secondSolverName | name 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_statisticsMessage | statistics message. |
void tools::Logger::printString | ( | const std::string | i_string | ) | [inline] |
Print an arbitrary string.
i_string | some 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_wallClockTime | wall clock time message. |
void tools::Logger::printWelcomeMessage | ( | ) | [inline] |
Print the welcome message.
void tools::Logger::setProcessRank | ( | const int | i_processRank | ) | [inline] |
Set the process rank.
i_processRank | process rank. |
void tools::Logger::updateCpuCommunicationTime | ( | ) | [inline] |
Update the CPU-Communication time.
void tools::Logger::updateCpuTime | ( | ) | [inline] |
Update the CPU time.
tools::Logger tools::Logger::logger [static] |
The logger all classes shoud use