File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 2222#endif
2323#include <stdio.h>
2424
25+ #include MCA_timer_IMPLEMENTATION_HEADER
2526#include "ompi/mpi/c/bindings.h"
2627#include "ompi/runtime/mpiruntime.h"
2728
@@ -38,5 +39,12 @@ static const char FUNC_NAME[] = "MPI_Wtick";
3839
3940double MPI_Wtick (void )
4041{
41- return (double )0.000001 ;
42+ #if OPAL_TIMER_USEC_NATIVE
43+ return 0.000001 ;
44+ #else
45+ if ( (opal_timer_t )0 == opal_timer_base_get_freq () ) {
46+ opal_output ( 0 , "No timer frequency\n" );
47+ }
48+ return (double )opal_timer_base_get_freq ();
49+ #endif /* OPAL_TIMER_USEC_NATIVE */
4250}
Original file line number Diff line number Diff line change 2222#endif
2323#include <stdio.h>
2424
25+ #include MCA_timer_IMPLEMENTATION_HEADER
26+ #include "opal/prefetch.h"
2527#include "ompi/mpi/c/bindings.h"
2628#include "ompi/runtime/mpiruntime.h"
2729
@@ -38,10 +40,9 @@ static const char FUNC_NAME[] = "MPI_Wtime";
3840
3941double MPI_Wtime (void )
4042{
41- struct timeval tv ;
42- double wtime ;
43- gettimeofday (& tv , NULL );
44- wtime = tv .tv_sec ;
45- wtime += (double )tv .tv_usec / 1000000.0 ;
46- return wtime ;
47- }
43+ #if OPAL_TIMER_USEC_NATIVE
44+ return (double )opal_timer_base_get_usec ();
45+ #else
46+ return (double )opal_timer_base_get_cycles ();
47+ #endif /* OPAL_TIMER_USEC_NATIVE */
48+ }
You can’t perform that action at this time.
0 commit comments