File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,13 @@ double MPI_Wtick(void)
60
60
#elif OPAL_TIMER_USEC_NATIVE
61
61
return 0.000001 ;
62
62
#endif
63
+ #else
64
+ #if defined(__linux__ ) && OPAL_HAVE_CLOCK_GETTIME
65
+ /* QAD no call clock_getres */
66
+ return 1.0e-09 ;
63
67
#else
64
68
/* Otherwise, we already return usec precision. */
65
69
return 0.000001 ;
66
70
#endif
71
+ #endif
67
72
}
Original file line number Diff line number Diff line change 25
25
#include <sys/time.h>
26
26
#endif
27
27
#include <stdio.h>
28
+ #ifdef HAVE_TIME_H
29
+ #include <time.h>
30
+ #endif /* HAVE_TIME_H */
28
31
29
32
#include MCA_timer_IMPLEMENTATION_HEADER
30
33
#include "ompi/mpi/c/bindings.h"
@@ -52,12 +55,18 @@ double MPI_Wtime(void)
52
55
#elif OPAL_TIMER_USEC_NATIVE
53
56
wtime = ((double ) opal_timer_base_get_usec ()) / 1000000.0 ;
54
57
#endif
58
+ #else
59
+ #if defined(__linux__ ) && OPAL_HAVE_CLOCK_GETTIME
60
+ struct timespec tp = {.tv_sec = 0 , .tv_nsec = 0 };
61
+ (void ) clock_gettime (CLOCK_MONOTONIC , & tp );
62
+ return (tp .tv_sec + tp .tv_nsec /1.0e+9 );
55
63
#else
56
64
/* Fall back to gettimeofday() if we have nothing else */
57
65
struct timeval tv ;
58
66
gettimeofday (& tv , NULL );
59
67
wtime = tv .tv_sec ;
60
68
wtime += (double )tv .tv_usec / 1000000.0 ;
69
+ #endif
61
70
#endif
62
71
63
72
OPAL_CR_NOOP_PROGRESS ();
You can’t perform that action at this time.
0 commit comments