1
1

Allow the use of the optimized used timers

Этот коммит содержится в:
George Bosilca 2014-11-23 23:51:13 -05:00
родитель 2e00e335b9
Коммит e27759956f
6 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2006 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -39,7 +39,7 @@ opal_timer_base_get_usec()
retval = (t.tb_high * 1000000) + t.tb_low / 1000;
return retval;
}
}
static inline opal_timer_t
opal_timer_base_get_cycles()

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -36,7 +36,7 @@ static inline opal_timer_t
opal_timer_base_get_usec(void)
{
return opal_timer_base_get_cycles() / opal_timer_altix_usec_conv;
}
}
static inline opal_timer_t

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -21,20 +21,24 @@
#include "opal_config.h"
#include <mach/mach_time.h>
#include <CoreServices/CoreServices.h>
typedef uint64_t opal_timer_t;
/* frequency in mhz */
OPAL_DECLSPEC extern opal_timer_t opal_timer_darwin_freq;
OPAL_DECLSPEC extern mach_timebase_info_data_t opal_timer_darwin_info;
static inline opal_timer_t
opal_timer_base_get_cycles(void)
{
if( opal_timer_darwin_info.denom == 0 ) {
(void) mach_timebase_info(&opal_timer_darwin_info);
}
/* this is basically a wrapper around the "right" assembly to get
the tick counter off the PowerPC Time Base. I believe it's
something similar on x86 */
return mach_absolute_time();
return mach_absolute_time() * opal_timer_darwin_info.numer / opal_timer_darwin_info.denom / 1000;
}
@ -43,7 +47,7 @@ opal_timer_base_get_usec(void)
{
/* freq is in Hz, so this gives usec */
return mach_absolute_time() * 1000000 / opal_timer_darwin_freq;
}
}
static inline opal_timer_t
@ -53,9 +57,9 @@ opal_timer_base_get_freq(void)
}
#define OPAL_TIMER_CYCLE_NATIVE 1
#define OPAL_TIMER_CYCLE_NATIVE 0
#define OPAL_TIMER_CYCLE_SUPPORTED 1
#define OPAL_TIMER_USEC_NATIVE 0
#define OPAL_TIMER_USEC_NATIVE 1
#define OPAL_TIMER_USEC_SUPPORTED 1
#endif

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -20,17 +20,15 @@
#include "opal_config.h"
#include <mach/mach_time.h>
#include "opal/mca/timer/timer.h"
#include "opal/mca/timer/darwin/timer_darwin.h"
#include "opal/constants.h"
opal_timer_t opal_timer_darwin_freq;
mach_timebase_info_data_t opal_timer_darwin_info;
static int opal_timer_darwin_open(void);
const opal_timer_base_component_2_0_0_t mca_timer_darwin_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -44,7 +44,7 @@ opal_timer_base_get_usec(void)
#else
return 0;
#endif
}
}
static inline opal_timer_t
@ -56,7 +56,7 @@ opal_timer_base_get_freq(void)
#define OPAL_TIMER_CYCLE_NATIVE OPAL_HAVE_SYS_TIMER_GET_CYCLES
#define OPAL_TIMER_CYCLE_SUPPORTED OPAL_HAVE_SYS_TIMER_GET_CYCLES
#define OPAL_TIMER_USEC_NATIVE 0
#define OPAL_TIMER_USEC_NATIVE 1
#define OPAL_TIMER_USEC_SUPPORTED OPAL_HAVE_SYS_TIMER_GET_CYCLES
#endif

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* Copyright (c) 2004-2014 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
@ -35,7 +35,7 @@ opal_timer_base_get_usec(void)
{
/* gethrtime returns nanoseconds */
return gethrtime() / 1000;
}
}
static inline opal_timer_t
opal_timer_base_get_freq(void)