OpenMPI  0.1.1
timer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3  * University Research and Technology
4  * Corporation. All rights reserved.
5  * Copyright (c) 2004-2005 The University of Tennessee and The University
6  * of Tennessee Research Foundation. All rights
7  * reserved.
8  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9  * University of Stuttgart. All rights reserved.
10  * Copyright (c) 2004-2005 The Regents of the University of California.
11  * All rights reserved.
12  * $COPYRIGHT$
13  *
14  * Additional copyrights may follow
15  *
16  * $HEADER$
17  */
18 
19 /**
20  * @file
21  *
22  * High resolution timer / cycle counter
23  *
24  * High resolution timer / cycle counter interface. This interface is
25  * intended to hide the system-dependent nature of timers that provide
26  * higher resolution and lower calling cost than gettimeofday().
27  * Unlike most component interfaces, there should only ever be one
28  * component available to be built on a particular platform.
29  * Therefore, a number of #defines are available to determine how well
30  * the platform supports high resolution timers:
31  *
32  * <UL>
33  * <LI><PRE>OPAL_TIMER_CYCLE_NATIVE</PRE> Whether
34  * opal_timer_base_get_cycle() is implemented directly or computed
35  * from some other data (such as a high res timer)</LI>
36  * <LI><PRE>OPAL_TIMER_CYCLE_SUPPORTED</PRE> Whether
37  * opal_timer_base_get_cycle() is supported on the current
38  * platform.</LI>
39  * <LI><PRE>OPAL_TIMER_USEC_SUPPORTED</PRE> Whether
40  * opal_timer_base_get_usec() is supported on the current
41  * platform or implemented on top of gettimeofday(), which
42  * may be unsuitable for some uses.
43  * </UL>
44  *
45  * The cycle count may not be the cycle count of the CPU itself, if
46  * there is another sufficiently close counter with better behavior
47  * characteristics (like the Time Base counter on many Power/PowerPC
48  * platforms). The function opal_timer_base_get_freq() returns the
49  * frequency of the cycle counter in use, *NOT* the frequency of the
50  * main CPU.
51  *
52  * Unless otherwise noted, no attempt is made to cope with the the
53  * differences in counters on SMP machines. If your process switches
54  * CPUs, your timer results may change.
55  *
56  * Build time priorities are allocated as follows:
57  *
58  * - 0 gettimeofday() wrapper
59  * - 10 Assembly timers with bad frequency search (Linux)
60  * - 20 NIC software stack (QSNet, Myrinet?)
61  * - 30 Operating systems with native interfaces
62  */
63 
64 #ifndef OPAL_MCA_TIMER_TIMER_H
65 #define OPAL_MCA_TIMER_TIMER_H
66 
67 #include "opal_config.h"
68 
69 #include "opal/mca/mca.h"
70 #include "opal/mca/base/base.h"
71 
72 
73 /**
74  * Structure for timer components.
75  */
77  /** MCA base component */
79  /** MCA base data */
81 };
82 /**
83  * Convenience typedef
84  */
86 
87 /*
88  * Macro for use in components that are of type timer
89  */
90 #define OPAL_TIMER_BASE_VERSION_2_0_0 \
91  MCA_BASE_VERSION_2_0_0, \
92  "timer", 2, 0, 0
93 
94 #endif /* OPAL_MCA_TIMER_TIMER_H */
mca_base_component_t timerc_version
MCA base component.
Definition: timer.h:78
Common type for all MCA components.
Definition: mca.h:250
Structure for timer components.
Definition: timer.h:76
Top-level interface for all MCA components.
Meta data for MCA v2.0.0 components.
Definition: mca.h:309
mca_base_component_data_t timerc_data
MCA base data.
Definition: timer.h:80