Monitors the time spent to achieve a certain task.
More...
#include <logger.h>
Monitors the time spent to achieve a certain task.
Definition at line 33 of file logger.h.
Constructor.
Definition at line 62 of file logger.h.
Logger::Logger |
( |
std::string |
folder | ) |
|
|
inline |
Constructor overloading. Opens files given the case directory.
- Parameters
-
folder | directory of the simulation |
Definition at line 69 of file logger.h.
void Logger::allocMemory |
( |
std::string |
event, |
|
|
double |
bytes |
|
) |
| |
|
inline |
Allocates memory for an event given a size.
- Parameters
-
event | a string that describes the event |
bytes | the number of bytes for allocation |
Definition at line 146 of file logger.h.
void Logger::eraseTimer |
( |
std::string |
event | ) |
|
|
inline |
Erases the timer of a given event.
- Parameters
-
event | a string that describes the event |
Definition at line 117 of file logger.h.
void Logger::freeMemory |
( |
std::string |
event, |
|
|
double |
bytes |
|
) |
| |
|
inline |
Frees memory allocated for a given event.
- Parameters
-
event | a string that describes the event |
bytes | the number of bytes |
Definition at line 157 of file logger.h.
double Logger::get_time |
( |
| ) |
|
|
inlineprivate |
void Logger::printAllTime |
( |
| ) |
|
|
inline |
void Logger::printMemory |
( |
std::string |
event | ) |
|
|
inline |
Prints the memory allocated for a given event.
- Parameters
-
event | a string that describes the event |
Definition at line 177 of file logger.h.
void Logger::printTime |
( |
std::string |
event | ) |
|
|
inline |
Prints the time spent to achieve a event.
- Parameters
-
event | a string that describes the event |
Definition at line 167 of file logger.h.
void Logger::resetTimer |
( |
| ) |
|
|
inline |
Resets the timer.
Definition at line 125 of file logger.h.
void Logger::resetTimeStep |
( |
| ) |
|
|
inline |
Resets the time-step timer.
Definition at line 134 of file logger.h.
void Logger::startTimer |
( |
std::string |
event | ) |
|
|
inline |
Starts the timer.
- Parameters
-
event | a string that describes the event to monitor |
Definition at line 92 of file logger.h.
References get_time().
void Logger::stopTimer |
( |
std::string |
event, |
|
|
bool |
print = false |
|
) |
| |
|
inline |
Stops the timer.
- Parameters
-
event | a string that describes the event monitored |
print | boolean to print the time or not in the terminal |
Definition at line 103 of file logger.h.
References get_time().
void Logger::writeLegend |
( |
| ) |
|
|
inline |
void Logger::writeTime |
( |
| ) |
|
|
inline |
Writes time spent for each event into a file.
Definition at line 214 of file logger.h.
void Logger::writeTimeStep |
( |
int |
n | ) |
|
|
inline |
Writes time spent for an iteration into a file.
- Parameters
-
Definition at line 225 of file logger.h.
std::ofstream Logger::file |
|
private |
file to write the time spent
Definition at line 36 of file logger.h.
std::ofstream Logger::legendFile |
|
private |
file to write the name of the events
Definition at line 36 of file logger.h.
contain info about the memomry allocated for events
Definition at line 39 of file logger.h.
boolean to print or not the time in the terminal
Definition at line 57 of file logger.h.
std::ofstream Logger::stepFile |
|
private |
file to write the time spent for 1 step
Definition at line 36 of file logger.h.
contain the starting time of events
Definition at line 39 of file logger.h.
contain the total time spent of events during the simulation
Definition at line 39 of file logger.h.
contain the tiem spent times of events for 1 step
Definition at line 39 of file logger.h.
The documentation for this class was generated from the following file:
- /home/mesnardo/git/barbagroup/cuIBM/src/utilities/logger.h