OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs
timer.h File Reference

High resolution timer / cycle counter. More...

`#include "opal_config.h"`
`#include "opal/mca/mca.h"`
`#include "opal/mca/base/base.h"`

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.

## Detailed Description

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_NATIVE

  Whether opal_timer_base_get_cycle() is implemented directly or computed from some other data (such as a high res timer)

-     OPAL_TIMER_CYCLE_SUPPORTED

  Whether opal_timer_base_get_cycle() is supported on the current platform.

-     OPAL_TIMER_USEC_SUPPORTED

  Whether 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:

- 0 gettimeofday() wrapper
- 10 Assembly timers with bad frequency search (Linux)
- 20 NIC software stack (QSNet, Myrinet?)
- 30 Operating systems with native interfaces

## Macro Definition Documentation

#define OPAL_TIMER_BASE_VERSION_2_0_0

Value:
MCA_BASE_VERSION_2_0_0, \
"timer", 2, 0, 0