OpenMPI
0.1.1
|
High resolution timer / cycle counter. More...
Go to the source code of this file.
Data Structures | |
struct | opal_timer_base_component_2_0_0_t |
Structure for timer components. More... | |
Macros | |
#define | OPAL_TIMER_BASE_VERSION_2_0_0 |
Typedefs | |
typedef struct opal_timer_base_component_2_0_0_t | opal_timer_base_component_2_0_0_t |
Convenience typedef. | |
High resolution timer / cycle counter.
High resolution timer / cycle counter interface. This interface is intended to hide the system-dependent nature of timers that provide higher resolution and lower calling cost than gettimeofday(). Unlike most component interfaces, there should only ever be one component available to be built on a particular platform. Therefore, a number of #defines are available to determine how well the platform supports high resolution timers:
OPAL_TIMER_CYCLE_NATIVEWhether opal_timer_base_get_cycle() is implemented directly or computed from some other data (such as a high res timer)
OPAL_TIMER_CYCLE_SUPPORTEDWhether opal_timer_base_get_cycle() is supported on the current platform.
OPAL_TIMER_USEC_SUPPORTEDWhether opal_timer_base_get_usec() is supported on the current platform or implemented on top of gettimeofday(), which may be unsuitable for some uses.
The cycle count may not be the cycle count of the CPU itself, if there is another sufficiently close counter with better behavior characteristics (like the Time Base counter on many Power/PowerPC platforms). The function opal_timer_base_get_freq() returns the frequency of the cycle counter in use, NOT the frequency of the main CPU.
Unless otherwise noted, no attempt is made to cope with the the differences in counters on SMP machines. If your process switches CPUs, your timer results may change.
Build time priorities are allocated as follows:
#define OPAL_TIMER_BASE_VERSION_2_0_0 |