\hypertarget{mca_2timer_2timer_8h}{\section{opal/mca/timer/timer.h File Reference}
\label{mca_2timer_2timer_8h}\index{opal/mca/timer/timer.\+h@{opal/mca/timer/timer.\+h}}
}


High resolution timer / cycle counter.  


{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/mca.\+h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}opal/mca/base/base.\+h\char`\"{}}\\*
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structopal__timer__base__component__2__0__0__t}{opal\+\_\+timer\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t}
\begin{DoxyCompactList}\small\item\em Structure for timer components. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bfseries O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{mca_2timer_2timer_8h_ab85da7694b112747ecc337d66f229724}{typedef struct \\*
\hyperlink{structopal__timer__base__component__2__0__0__t}{opal\+\_\+timer\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t} \hyperlink{mca_2timer_2timer_8h_ab85da7694b112747ecc337d66f229724}{opal\+\_\+timer\+\_\+base\+\_\+component\+\_\+2\+\_\+0\+\_\+0\+\_\+t}}\label{mca_2timer_2timer_8h_ab85da7694b112747ecc337d66f229724}

\begin{DoxyCompactList}\small\item\em Convenience typedef. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{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\+:


\begin{DoxyItemize}
\item 
\begin{DoxyPre}OPAL\_TIMER\_CYCLE\_NATIVE\end{DoxyPre}
 Whether opal\+\_\+timer\+\_\+base\+\_\+get\+\_\+cycle() is implemented directly or computed from some other data (such as a high res timer) 
\item 
\begin{DoxyPre}OPAL\_TIMER\_CYCLE\_SUPPORTED\end{DoxyPre}
 Whether opal\+\_\+timer\+\_\+base\+\_\+get\+\_\+cycle() is supported on the current platform. 
\item 
\begin{DoxyPre}OPAL\_TIMER\_USEC\_SUPPORTED\end{DoxyPre}
 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. 
\end{DoxyItemize}

The cycle count may not be the cycle count of the C\+P\+U itself, if there is another sufficiently close counter with better behavior characteristics (like the Time Base counter on many Power/\+Power\+P\+C platforms). The function opal\+\_\+timer\+\_\+base\+\_\+get\+\_\+freq() returns the frequency of the cycle counter in use, {\itshape N\+O\+T} the frequency of the main C\+P\+U.

Unless otherwise noted, no attempt is made to cope with the the differences in counters on S\+M\+P machines. If your process switches C\+P\+Us, your timer results may change.

Build time priorities are allocated as follows\+:


\begin{DoxyItemize}
\item 0 gettimeofday() wrapper
\item 10 Assembly timers with bad frequency search (Linux)
\item 20 N\+I\+C software stack (Q\+S\+Net, Myrinet?)
\item 30 Operating systems with native interfaces 
\end{DoxyItemize}

\subsection{Macro Definition Documentation}
\hypertarget{mca_2timer_2timer_8h_aec825d34e30b84553c6b64f311acacdc}{\index{mca/timer/timer.\+h@{mca/timer/timer.\+h}!O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0@{O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}}
\index{O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0@{O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}!mca/timer/timer.\+h@{mca/timer/timer.\+h}}
\subsubsection[{O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}]{\setlength{\rightskip}{0pt plus 5cm}\#define O\+P\+A\+L\+\_\+\+T\+I\+M\+E\+R\+\_\+\+B\+A\+S\+E\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+2\+\_\+0\+\_\+0}}\label{mca_2timer_2timer_8h_aec825d34e30b84553c6b64f311acacdc}
{\bfseries Value\+:}
\begin{DoxyCode}
MCA\_BASE\_VERSION\_2\_0\_0, \(\backslash\)
    \textcolor{stringliteral}{"timer"}, 2, 0, 0
\end{DoxyCode}
