replace MPI_Wtime() with platform::walltime()

This commit is contained in:
Axel Kohlmeyer
2021-10-05 22:53:39 -04:00
parent f17aeebbcd
commit 8b36061db4
77 changed files with 175 additions and 189 deletions

View File

@ -21,7 +21,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
/* data structure for double/int */
@ -164,23 +163,10 @@ int MPI_Finalize()
}
/* ---------------------------------------------------------------------- */
static auto initial_time = std::chrono::steady_clock::now();
double MPI_Wtime()
{
#if defined(_MSC_VER)
double t;
t = GetTickCount();
t /= 1000.0;
return t;
#else
double time;
struct timeval tv;
gettimeofday(&tv, NULL);
time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec;
return time;
#endif
return std::chrono::duration<double>(std::chrono::steady_clock::now() - initial_time).count();
}
/* ---------------------------------------------------------------------- */