Skip to content

Commit 5dd17e3

Browse files
committed
feat: Implement PCU_Time without MPI_WTime
I use clock_gettime, which is one of the many methods mpich uses depending on the system. Signed-off-by: Aiden Woodruff <[email protected]>
1 parent 5e4d826 commit 5dd17e3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pcu/pcu_pnompi.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <stdio.h>
1313
#include <stdlib.h>
1414
#include <limits.h>
15+
#include <time.h>
1516

1617
static int global_size;
1718
static int global_rank;
@@ -110,7 +111,9 @@ void free_nompi_msg(NoMpiMsg* msg)
110111

111112
double MPI_Wtime(void)
112113
{
113-
return 0.0;
114+
struct timespec now;
115+
clock_gettime(CLOCK_REALTIME, &now);
116+
return (double)now.tv_sec + now.tv_nsec * 1.0e-9;
114117
}
115118

116119
pcu_mpi pcu_pmpi =

0 commit comments

Comments
 (0)