OpenMPI  0.1.1
vt_defs.h
1 /**
2  * VampirTrace
3  * http://www.tu-dresden.de/zih/vampirtrace
4  *
5  * Copyright (c) 2005-2012, ZIH, TU Dresden, Federal Republic of Germany
6  *
7  * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing
8  * Centre, Federal Republic of Germany
9  *
10  * See the file COPYING in the package base directory for details
11  **/
12 
13 #ifndef _VT_DEFS_H
14 #define _VT_DEFS_H
15 
16 /* macro for one-step declaration and definition of functions */
17 #define VT_DECLDEF(function) \
18 function; /* declaration */ \
19 function /* definition */
20 
21 /*
22  *-----------------------------------------------------------------------------
23  * Buffer
24  *-----------------------------------------------------------------------------
25  */
26 
27 #define VT_MIN_BUFSIZE 0x19000 /* 100KB */
28 #define VT_DEFAULT_BUFSIZE 0x2000000 /* 32MB */
29 #define VT_DEFAULT_COPY_BUFFER_SIZE 0x100000 /* 1MB */
30 
31 typedef unsigned char* buffer_t;
32 
33 /*
34  *-----------------------------------------------------------------------------
35  * Process ID partitioning
36  *-----------------------------------------------------------------------------
37  */
38 
39 #define VT_PROCESS_ID_BITNESS 32
40 #define VT_PROCESS_ID_SPLITTING 16
41 #define VT_TRACEID_BITMASK ((1<<VT_PROCESS_ID_SPLITTING) - 1)
42 #define VT_THREADID_BITMASK (~VT_TRACEID_BITMASK)
43 #define VT_PROCESS_ID(trace_id, thread_id) \
44  (((thread_id) << VT_PROCESS_ID_SPLITTING) + (trace_id) + 1)
45 
46 /*
47  *-----------------------------------------------------------------------------
48  * Upper bounds
49  *-----------------------------------------------------------------------------
50  */
51 
52 /* maximum number of threads */
53 #define VT_MAX_THREADS \
54  1<<(VT_PROCESS_ID_BITNESS - VT_PROCESS_ID_SPLITTING)
55 /* maximum string lengths */
56 #define VT_MAX_COMMENT_LEN 4096
57 #define VT_MAX_MARKER_LEN 4096
58 #define VT_MAX_THREAD_NAME_LEN 100
59 /* maximum number of certain MPI handles defined per process
60  (initial maximums; raised as needed) */
61 #define VT_MAX_MPI_COMMS_INIT 100
62 #define VT_MAX_MPI_GROUPS_INIT 100
63 #define VT_MAX_MPI_WINS_INIT 100
64 /* maximum number of regions to be instrumented by Dyninst */
65 #define VT_MAX_DYNINST_REGIONS 100000
66 
67 /*
68  *-----------------------------------------------------------------------------
69  * Trace statuses
70  *-----------------------------------------------------------------------------
71  */
72 
73 #define VT_TRACE_ON 0
74 #define VT_TRACE_OFF 1
75 #define VT_TRACE_OFF_PERMANENT 2
76 
77 /*
78  *-----------------------------------------------------------------------------
79  * Trace modes
80  *-----------------------------------------------------------------------------
81  */
82 
83 #define VT_MODE_TRACE 1<<0
84 #define VT_MODE_STAT 1<<1
85 
86 /*
87  *-----------------------------------------------------------------------------
88  * Statistics properties
89  *-----------------------------------------------------------------------------
90  */
91 
92 #define VT_SUM_PROP_FUNC 1<<0
93 #define VT_SUM_PROP_MSG 1<<1
94 #define VT_SUM_PROP_COLLOP 1<<2
95 #define VT_SUM_PROP_FILEOP 1<<3
96 
97 /*
98  *-----------------------------------------------------------------------------
99  * Message statistics details
100  *-----------------------------------------------------------------------------
101  */
102 
103 #define VT_SUM_MSG_DTL_PEER 1<<0
104 #define VT_SUM_MSG_DTL_COMM 1<<1
105 #define VT_SUM_MSG_DTL_TAG 1<<2
106 
107 /*
108  *-----------------------------------------------------------------------------
109  * Collop. statistics details
110  *-----------------------------------------------------------------------------
111  */
112 
113 #define VT_SUM_COLLOP_DTL_OP 1<<0
114 #define VT_SUM_COLLOP_DTL_COMM 1<<1
115 
116 /*
117  *-----------------------------------------------------------------------------
118  * Absent information
119  *-----------------------------------------------------------------------------
120  */
121 
122 #define VT_NO_ID 0xFFFFFFFF
123 #define VT_NO_LNO 0xFFFFFFFF
124 
125 /*
126  *-----------------------------------------------------------------------------
127  * Thread locations
128  *-----------------------------------------------------------------------------
129  */
130 
131 #define VT_MASTER_THREAD 0
132 #define VT_CURRENT_THREAD 0xFFFFFFFF
133 
134 /*
135  *-----------------------------------------------------------------------------
136  * Regions
137  *-----------------------------------------------------------------------------
138  */
139 
140 #define VT_DEFAULT_REGION_GROUP "Application"
141 
142 #define VT_UNKNOWN 0
143 
144 #define VT_INTERNAL 1
145 #define VT_FUNCTION 2
146 #define VT_LOOP 3
147 #define VT_USER_REGION 4
148 
149 #define VT_LIBC 5
150 #define VT_LIBC_IO 6
151 
152 #define VT_MEMORY 7
153 
154 #define VT_MPI_FUNCTION 8
155 #define VT_MPI_COLL_BARRIER 9
156 #define VT_MPI_COLL_ONE2ALL 10
157 #define VT_MPI_COLL_ALL2ONE 11
158 #define VT_MPI_COLL_ALL2ALL 12
159 
160 #define VT_OMP_FUNCTION 14
161 #define VT_OMP_PARALLEL 15
162 #define VT_OMP_PARALLEL_REGION 16
163 #define VT_OMP_LOOP 17
164 #define VT_OMP_SECTIONS 18
165 #define VT_OMP_SECTION 19
166 #define VT_OMP_WORKSHARE 20
167 #define VT_OMP_SINGLE 21
168 #define VT_OMP_MASTER 22
169 #define VT_OMP_CRITICAL 23
170 #define VT_OMP_ATOMIC 24
171 #define VT_OMP_BARRIER 25
172 #define VT_OMP_IBARRIER 26
173 #define VT_OMP_FLUSH 27
174 #define VT_OMP_CRITICAL_SBLOCK 28
175 #define VT_OMP_SINGLE_SBLOCK 29
176 
177 #define VT_PTHRD_FUNCTION 30
178 
179 /*
180  *-----------------------------------------------------------------------------
181  * MPI Integer size
182  *-----------------------------------------------------------------------------
183  */
184 #if (defined(_SX) && defined(_W8))
185  typedef long long VT_MPI_INT;
186 #else /* _SX && _W8 */
187  typedef int VT_MPI_INT;
188 #endif /* _SX && _W8 */
189 
190 /*
191  *-----------------------------------------------------------------------------
192  * MPI communicators/groups
193  *-----------------------------------------------------------------------------
194  */
195 
196 #define VT_MPI_COMM_WORLD 0
197 #define VT_MPI_COMM_SELF 1
198 #define VT_MPI_COMM_OTHER 2
199 #define VT_MPI_GROUP 3
200 
201 /*
202  *-----------------------------------------------------------------------------
203  * Process group attributes
204  *-----------------------------------------------------------------------------
205  */
206 
207 #define VT_PROCGRP_ISCOMMUNICATOR 1<<0
208 #define VT_PROCGRP_HASCOUNTERS 1<<1
209 
210 /*
211  *-----------------------------------------------------------------------------
212  * Counter properties
213  *-----------------------------------------------------------------------------
214  */
215 
216 #define VT_CNTR_ACC 1<<0
217 #define VT_CNTR_ABS 1<<1
218 #define VT_CNTR_START 1<<2
219 #define VT_CNTR_POINT 1<<3
220 #define VT_CNTR_LAST 1<<4
221 #define VT_CNTR_NEXT 1<<5
222 
223 #define VT_CNTR_SIGNED 1<<6
224 #define VT_CNTR_UNSIGNED 1<<7
225 #define VT_CNTR_FLOAT 1<<8
226 #define VT_CNTR_DOUBLE 1<<9
227 
228 /*
229  *-----------------------------------------------------------------------------
230  * Marker
231  *-----------------------------------------------------------------------------
232  */
233 
234 #define VT_MARKER_UNKNOWN 0
235 #define VT_MARKER_ERROR 1
236 #define VT_MARKER_WARNING 2
237 #define VT_MARKER_HINT 3
238 
239 /*
240  *-----------------------------------------------------------------------------
241  * I/O operations and flags
242  *-----------------------------------------------------------------------------
243  */
244 
245 #define VT_IOOP_BITS 0x0000001f
246 #define VT_IOOP_OPEN 0
247 #define VT_IOOP_CLOSE 1
248 #define VT_IOOP_READ 2
249 #define VT_IOOP_WRITE 3
250 #define VT_IOOP_SEEK 4
251 #define VT_IOOP_UNLINK 5
252 #define VT_IOOP_RENAME 6
253 #define VT_IOOP_DUP 7
254 #define VT_IOOP_SYNC 8
255 #define VT_IOOP_LOCK 9
256 #define VT_IOOP_UNLOCK 10
257 #define VT_IOOP_OTHER 31
258 #define VT_IOFLAGS_BITS 0xffffffe0
259 #define VT_IOFLAG_IOFAILED 32
260 #define VT_IOFLAG_ASYNC 64
261 #define VT_IOFLAG_COLL 128
262 #define VT_IOFLAG_DIRECT 256
263 #define VT_IOFLAG_SYNC 512
264 #define VT_IOFLAG_ISREADLOCK 1024
265 
266 /*
267  *-----------------------------------------------------------------------------
268  * Key-Value types
269  *-----------------------------------------------------------------------------
270  */
271 
272 #define VT_KEYVAL_TYPE_CHAR 0
273 #define VT_KEYVAL_TYPE_INT32 1
274 #define VT_KEYVAL_TYPE_UINT32 2
275 #define VT_KEYVAL_TYPE_INT64 3
276 #define VT_KEYVAL_TYPE_UINT64 4
277 #define VT_KEYVAL_TYPE_FLOAT 5
278 #define VT_KEYVAL_TYPE_DOUBLE 6
279 
280 /*
281  *-----------------------------------------------------------------------------
282  * common string identifiers used in VT libraries and vtunify
283  *-----------------------------------------------------------------------------
284  */
285 
286 #define VT_UNIFY_STRID_VT_COMMENT "__VT_COMMENT__"
287 #define VT_UNIFY_STRID_STARTTIME_COMMENT "__STARTTIME__"
288 #define VT_UNIFY_STRID_STOPTIME_COMMENT "__STOPTIME__"
289 #define VT_UNIFY_STRID_USRCOM_SEND_COMMENT "__USRCOM_S__"
290 #define VT_UNIFY_STRID_USRCOM_RECV_COMMENT "__USRCOM_R__"
291 #define VT_UNIFY_STRID_ETIMESYNC_COMMENT "__ETIMESYNC__"
292 
293 #define VT_UNIFY_STRID_ALL_PROCGRP "__ALL__"
294 #define VT_UNIFY_STRID_NODE_PROCGRP "__NODE__"
295 #define VT_UNIFY_STRID_MPI_COMM_WORLD_PROCGRP "__MPI_COMM_WORLD__"
296 #define VT_UNIFY_STRID_MPI_COMM_SELF_PROCGRP "__MPI_COMM_SELF__"
297 #define VT_UNIFY_STRID_MPI_COMM_OTHER_PROCGRP "__MPI_COMM_OTHER__"
298 #define VT_UNIFY_STRID_MPI_GROUP_PROCGRP "__MPI_GROUP__"
299 #define VT_UNIFY_STRID_USER_COMM_PROCGRP "__USER_COMM__"
300 
301 #define VT_UNIFY_STRID_ASYNC_SOURCE_KEY "__ASYNC_SOURCE__"
302 
303 /*
304  *-----------------------------------------------------------------------------
305  * Miscellaneous
306  *-----------------------------------------------------------------------------
307  */
308 
309 #define VT_MAX_GETHOSTID_RETRIES 10
310 
311 #endif /* _VT_DEFS_H */