Remove MPI function calls from the logger

parent 7f7e21be
...@@ -90,11 +90,7 @@ class tools::Logger { ...@@ -90,11 +90,7 @@ class tools::Logger {
const std::string indentation; const std::string indentation;
//! Clocks //! Clocks
#if (defined USEMPI && !defined CUDA)
std::map<std::string, double> clocks;
#else
std::map<std::string, clock_t> clocks; std::map<std::string, clock_t> clocks;
#endif
//! Timer //! Timer
std::map<std::string, double> timer; std::map<std::string, double> timer;
...@@ -421,13 +417,7 @@ class tools::Logger { ...@@ -421,13 +417,7 @@ class tools::Logger {
* @param i_name Name of timer * @param i_name Name of timer
*/ */
void updateTime(const std::string &i_name) { void updateTime(const std::string &i_name) {
// If the timer does not yet exist it will be initialized with 0 by std::map
// Works only with [] no with .at()
#if (defined USEMPI && !defined CUDA)
timer[i_name] += MPI_Wtime() - clocks.at(i_name);
#else
timer[i_name] += (clock() - clocks.at(i_name))/(double)CLOCKS_PER_SEC; timer[i_name] += (clock() - clocks.at(i_name))/(double)CLOCKS_PER_SEC;
#endif
} }
/** /**
...@@ -436,11 +426,7 @@ class tools::Logger { ...@@ -436,11 +426,7 @@ class tools::Logger {
* @param i_name Name of timer/clock * @param i_name Name of timer/clock
*/ */
void resetClockToCurrentTime(const std::string &i_name) { void resetClockToCurrentTime(const std::string &i_name) {
#if (defined USEMPI && !defined CUDA)
clocks[i_name] = MPI_Wtime();
#else
clocks[i_name] = clock(); clocks[i_name] = clock();
#endif
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment