--- trunk/src/utils/ProgressBar.cpp 2013/06/16 15:15:42 1879 +++ trunk/src/utils/ProgressBar.cpp 2014/02/26 14:14:50 1969 @@ -40,6 +40,10 @@ * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ +#ifdef IS_MPI +#include +#endif + #include #include @@ -55,10 +59,6 @@ #include #endif -#ifdef IS_MPI -#include -#endif - #include "utils/ProgressBar.hpp" using namespace std; @@ -72,7 +72,9 @@ namespace OpenMD { void ProgressBar::clear() { #ifdef IS_MPI - if (MPI::COMM_WORLD.Get_rank() == 0) { + int myRank; + MPI_Comm_rank( MPI_COMM_WORLD, &myRank); + if (myRank == 0) { #endif cout << endl; cout.flush(); @@ -88,7 +90,9 @@ namespace OpenMD { void ProgressBar::update() { #ifdef IS_MPI - if (MPI::COMM_WORLD.Get_rank() == 0) { + int myRank; + MPI_Comm_rank( MPI_COMM_WORLD, &myRank); + if (myRank == 0) { #endif // only do the progress bar if we are actually running in a tty: @@ -130,7 +134,8 @@ namespace OpenMD { // compute the best estimate of the ending time: time_t current_ = time(NULL); - time_t end_ = start_ + (current_ - start_) * (100.0/percent); + time_t end_ = static_cast(start_ + (current_ - start_) * + (100.0/percent) ); struct tm * ender = localtime(&end_); char buffer[22]; strftime(buffer, 22, "%a %b %d @ %I:%M %p", ender);