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 /** @file
20  *
21  * Cycle counter reading instructions. Do not use directly - see the
22  * timer interface instead
23  */
24 
25 #ifndef OPAL_SYS_TIMER_H
26 #define OPAL_SYS_TIMER_H 1
27 
28 #include "opal_config.h"
29 
30 #include "opal/sys/architecture.h"
31 
32 #ifdef HAVE_SYS_TYPES_H
33 #include <sys/types.h>
34 #endif
35 
36 /* do some quick #define cleanup in cases where we are doing
37  testing... */
38 #ifdef OMPI_DISABLE_INLINE_ASM
39 #undef OPAL_C_GCC_INLINE_ASSEMBLY
40 #define OPAL_C_GCC_INLINE_ASSEMBLY 0
41 #undef OMPI_CXX_GCC_INLINE_ASSEMBLY
42 #define OMPI_CXX_GCC_INLINE_ASSEMBLY 0
43 #undef OPAL_C_DEC_INLINE_ASSEMBLY
44 #define OPAL_C_DEC_INLINE_ASSEMBLY 0
45 #undef OMPI_CXX_DEC_INLINE_ASSEMBLY
46 #define OMPI_CXX_DEC_INLINE_ASSEMBLY 0
47 #undef OPAL_C_XLC_INLINE_ASSEMBLY
48 #define OPAL_C_XLC_INLINE_ASSEMBLY 0
49 #undef OMPI_CXX_XLC_INLINE_ASSEMBLY
50 #define OMPI_CXX_XLC_INLINE_ASSEMBLY 0
51 #endif
52 
53 /* define OMPI_{GCC,DEC,XLC}_INLINE_ASSEMBLY based on the
54  OMPI_{C,CXX}_{GCC,DEC,XLC}_INLINE_ASSEMBLY defines and whether we
55  are in C or C++ */
56 #if defined(c_plusplus) || defined(__cplusplus)
57 #define OMPI_GCC_INLINE_ASSEMBLY OMPI_CXX_GCC_INLINE_ASSEMBLY
58 #define OMPI_DEC_INLINE_ASSEMBLY OMPI_CXX_DEC_INLINE_ASSEMBLY
59 #define OMPI_XLC_INLINE_ASSEMBLY OMPI_CXX_XLC_INLINE_ASSEMBLY
60 #else
61 #define OMPI_GCC_INLINE_ASSEMBLY OPAL_C_GCC_INLINE_ASSEMBLY
62 #define OMPI_DEC_INLINE_ASSEMBLY OPAL_C_DEC_INLINE_ASSEMBLY
63 #define OMPI_XLC_INLINE_ASSEMBLY OPAL_C_XLC_INLINE_ASSEMBLY
64 #endif
65 
66 /**********************************************************************
67  *
68  * Load the appropriate architecture files and set some reasonable
69  * default values for our support
70  *
71  *********************************************************************/
72 
73 BEGIN_C_DECLS
74 
75 /* If you update this list, you probably also want to update
76  opal/mca/timer/linux/configure.m4. Or not. */
77 
78 #if defined(DOXYGEN)
79 /* don't include system-level gorp when generating doxygen files */
80 #elif OPAL_ASSEMBLY_ARCH == OMPI_AMD64
81 #include "opal/sys/amd64/timer.h"
82 #elif OPAL_ASSEMBLY_ARCH == OMPI_ARM
83 #include "opal/sys/arm/timer.h"
84 #elif OPAL_ASSEMBLY_ARCH == OMPI_IA32
85 #include "opal/sys/ia32/timer.h"
86 #elif OPAL_ASSEMBLY_ARCH == OMPI_IA64
87 #include "opal/sys/ia64/timer.h"
88 #elif OPAL_ASSEMBLY_ARCH == OMPI_POWERPC32
89 #include "opal/sys/powerpc/timer.h"
90 #elif OPAL_ASSEMBLY_ARCH == OMPI_POWERPC64
91 #include "opal/sys/powerpc/timer.h"
92 #elif OPAL_ASSEMBLY_ARCH == OMPI_SPARCV9_32
93 #include "opal/sys/sparcv9/timer.h"
94 #elif OPAL_ASSEMBLY_ARCH == OMPI_SPARCV9_64
95 #include "opal/sys/sparcv9/timer.h"
96 #elif OPAL_ASSEMBLY_ARCH == OMPI_WINDOWS
97 #include "opal/sys/win32/timer.h"
98 #elif OPAL_ASSEMBLY_ARCH == OMPI_MIPS
99 #include "opal/sys/mips/timer.h"
100 #endif
101 
102 #ifndef DOXYGEN
103 #ifndef OPAL_HAVE_SYS_TIMER_GET_CYCLES
104 #define OPAL_HAVE_SYS_TIMER_GET_CYCLES 0
105 
106 typedef long opal_timer_t;
107 #endif
108 #endif
109 
110 END_C_DECLS
111 
112 #endif /* OPAL_SYS_TIMER_H */