Skip to content

Commit 48d13aa

Browse files
committed
mpi/c: Force wtick/wtime to use gettimeofday
* See #3003 for a discussion about this patch. Once we get a better version in place we can revert this change. Signed-off-by: Joshua Hursey <[email protected]>
1 parent 616f20c commit 48d13aa

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

ompi/mpi/c/wtick.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2007-2014 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015-2016 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -40,6 +41,12 @@ double MPI_Wtick(void)
4041
{
4142
OPAL_CR_NOOP_PROGRESS();
4243

44+
/*
45+
* See https://github.com/open-mpi/ompi/issues/3003
46+
* For now we are forcing the use of gettimeofday() until we find a
47+
* more portable solution.
48+
*/
49+
#if 0
4350
#if OPAL_TIMER_CYCLE_NATIVE
4451
{
4552
opal_timer_t freq = opal_timer_base_get_freq();
@@ -52,6 +59,7 @@ double MPI_Wtick(void)
5259
}
5360
#elif OPAL_TIMER_USEC_NATIVE
5461
return 0.000001;
62+
#endif
5563
#else
5664
/* Otherwise, we already return usec precision. */
5765
return 0.000001;

ompi/mpi/c/wtime.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2017 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -40,10 +41,17 @@ double MPI_Wtime(void)
4041
{
4142
double wtime;
4243

44+
/*
45+
* See https://github.com/open-mpi/ompi/issues/3003
46+
* For now we are forcing the use of gettimeofday() until we find a
47+
* more portable solution.
48+
*/
49+
#if 0
4350
#if OPAL_TIMER_CYCLE_NATIVE
4451
wtime = ((double) opal_timer_base_get_cycles()) / opal_timer_base_get_freq();
4552
#elif OPAL_TIMER_USEC_NATIVE
4653
wtime = ((double) opal_timer_base_get_usec()) / 1000000.0;
54+
#endif
4755
#else
4856
/* Fall back to gettimeofday() if we have nothing else */
4957
struct timeval tv;

0 commit comments

Comments
 (0)