OpenMPI  0.1.1
OTF_Definitions.h
Go to the documentation of this file.
1 /*
2  This is part of the OTF library. Copyright by ZIH, TU Dresden 2005-2012.
3  Authors: Andreas Knuepfer, Holger Brunst, Ronny Brendel, Thomas Kriebitzsch
4 */
5 
6 /**
7  * @file OTF_Definitions.h
8  *
9  * @brief Provides many many macros for different purposes.
10  *
11  * \ingroup misc
12  */
13 
14 
15 #ifndef OTF_DEFINITIONS_H
16 #define OTF_DEFINITIONS_H
17 
18 
19 #include "OTF_Version.h"
20 
21 /* definitions of record type identifiers */
22 
23 
24 /* Event records -- have them numbered and sorted,
25 this does not affect the format at all.
26 This is always safe with recompilation and re-linking,
27 yet it breaks the link compatibility of library versions.*/
28 
29 #define OTF_EVENTCOMMENT_RECORD 0
30 #define OTF_COUNTER_RECORD 1
31 #define OTF_ENTER_RECORD 2
32 
33 #define OTF_NOOP_RECORD 58
34 
35 #define OTF_COLLOP_RECORD 5
36 
37 #define OTF_RECEIVE_RECORD 10
38 #define OTF_SEND_RECORD 11
39 #define OTF_LEAVE_RECORD 12
40 
41 #define OTF_BEGINPROCESS_RECORD 35
42 #define OTF_ENDPROCESS_RECORD 36
43 
44 #define OTF_FILEOPERATION_RECORD 42
45 
46 #define OTF_RMAPUT_RECORD 47
47 #define OTF_RMAPUTRE_RECORD 48
48 #define OTF_RMAGET_RECORD 49
49 #define OTF_RMAEND_RECORD 50
50 
51 #define OTF_BEGINCOLLOP_RECORD 51
52 #define OTF_ENDCOLLOP_RECORD 52
53 
54 #define OTF_BEGINFILEOP_RECORD 53
55 #define OTF_ENDFILEOP_RECORD 54
56 
57 /* Definition records*/
58 
59 #define OTF_DEFTIMERRESOLUTION_RECORD 13
60 #define OTF_DEFPROCESS_RECORD 14
61 #define OTF_DEFPROCESSGROUP_RECORD 15
62 #define OTF_DEFATTRLIST_RECORD 55
63 #define OTF_DEFPROCESSORGROUPATTR_RECORD 56
64 #define OTF_DEFPROCESSSUBSTITUTES_RECORD 63
65 #define OTF_DEFFUNCTION_RECORD 16
66 #define OTF_DEFFUNCTIONGROUP_RECORD 17
67 #define OTF_DEFCOUNTER_RECORD 18
68 #define OTF_DEFCOUNTERGROUP_RECORD 19
69 #define OTF_DEFCOLLOP_RECORD 20
70 #define OTF_DEFSCL_RECORD 21
71 #define OTF_DEFSCLFILE_RECORD 22
72 #define OTF_DEFVERSION_RECORD 23
73 #define OTF_DEFCREATOR_RECORD 24
74 #define OTF_DEFFILE_RECORD 25
75 #define OTF_DEFFILEGROUP_RECORD 26
76 #define OTF_DEFTIMERANGE_RECORD 61
77 #define OTF_DEFCOUNTERASSIGNMENTS_RECORD 62
78 
79 #define OTF_DEFKEYVALUE_RECORD 57
80 
81 
82 #define OTF_FUNCTIONSUMMARY_RECORD 28
83 #define OTF_FUNCTIONGROUPSUMMARY_RECORD 29
84 #define OTF_MESSAGESUMMARY_RECORD 30
85 #define OTF_COLLOPSUMMARY_RECORD 44
86 #define OTF_FILEOPERATIONSUMMARY_RECORD 31
87 #define OTF_FILEGROUPOPERATIONSUMMARY_RECORD 32
88 
89 #define OTF_DEFINITIONCOMMENT_RECORD 34
90 
91 #define OTF_ENTERSNAPSHOT_RECORD 37
92 #define OTF_SENDSNAPSHOT_RECORD 38
93 
94 #define OTF_SUMMARYCOMMENT_RECORD 39
95 #define OTF_SNAPSHOTCOMMENT_RECORD 40
96 #define OTF_OPENFILESNAPSHOT_RECORD 43
97 #define OTF_BEGINCOLLOPSNAPSHOT_RECORD 59
98 #define OTF_BEGINFILEOPSNAPSHOT_RECORD 60
99 
100 #define OTF_UNKNOWN_RECORD 41
101 
102 #define OTF_DEFMARKER_RECORD 45
103 #define OTF_MARKER_RECORD 46
104 
105 /* Number of records */
106 #define OTF_NRECORDS 64
107 
108 /* Stream format definition */
109 
110 #define OTF_WSTREAM_FORMAT_SHORT 0
111 #define OTF_WSTREAM_FORMAT_LONG 1
112 
113 
114 /*
115 
116 Counter properties
117 
118 There are three groups of counter properties that can be combined.
119 Not all combinations make perfect sense, some are only there for completeness.
120 
121 For all groups the _BITS macro allows to identify the bits that are valid for
122 this group. This might be useful to AND away all other bits.
123 */
124 
125 
126 /*
127 The counter type uses the first bit (the second is reserved so far). It says
128 whether the counter is an accumulating counter ( OTF_COUNTER_TYPE_ACC) that is
129 monotonously increasing. Then it's probably a good idea to visualize it's
130 derivative instead of the original value. The alternative is an absolute
131 value (OTF_COUNTER_TYPE_ABS) that should be displayed as is.
132 */
133 
134 
135 /* 1st-2nd bit */
136 #define OTF_COUNTER_TYPE_BITS 3
137 #define OTF_COUNTER_TYPE_ACC 0
138 #define OTF_COUNTER_TYPE_ABS 1
139 
140 /*
141 The counter scope says when the values have been collected or for which
142 interval of time they are valid. It uses the 3rd and 4th bit(bit 5 is
143 reserved again). The default is OTF_COUNTER_SCOPE_START which means the values
144 belong to the time interval since the beginning of the measurement.
145 OTF_COUNTER_SCOPE_POINT means the value is only valid at a point in time but
146 not necessarily for any interval of time. OTF_COUNTER_SCOPE_LAST means the
147 value is related to the time interval since the last counter sample of the
148 same counter, i.e. the immediate past. And finally OTF_COUNTER_SCOPE_NEXT
149 means it is valid from now until the next counter sample, i.e. the future
150 right ahead.
151 */
152 
153 #define OTF_COUNTER_SCOPE_BITS 12
154 #define OTF_COUNTER_SCOPE_START 0
155 #define OTF_COUNTER_SCOPE_POINT 4
156 #define OTF_COUNTER_SCOPE_LAST 8
157 #define OTF_COUNTER_SCOPE_NEXT 12
158 
159 /*
160 Finally, there is the variable type which occupies the 6th - 9th bit. The bit
161 values are chosen to allow easy distinction of integers and non-integers as
162 well as unsigned and signed.
163 Furthermore, there are some macros to ask for the type. Some similar macros
164 could be added for convenience.
165 */
166 
167 #define OTF_COUNTER_VARTYPE_ISINTEGER(x) (x < 256)
168 #define OTF_COUNTER_VARTYPE_ISSIGNED(x) ((x&32) == 32)
169 #define OTF_COUNTER_VARTYPE_ISUNSIGNED(x) ((x&32) == 0)
170 
171 #define OTF_COUNTER_VARTYPE_BITS 480 /* 1111xxxxx */
172 #define OTF_COUNTER_VARTYPE_UNSIGNED8 0 /* 0000 */
173 #define OTF_COUNTER_VARTYPE_SIGNED8 32 /* 0001 */
174 #define OTF_COUNTER_VARTYPE_UNSIGNED4 64 /* 0010 */
175 #define OTF_COUNTER_VARTYPE_SIGNED4 96 /* 0011 */
176 #define OTF_COUNTER_VARTYPE_UNSIGNED2 128 /* 0100 */
177 #define OTF_COUNTER_VARTYPE_SIGNED2 160 /* 0101 */
178 #define OTF_COUNTER_VARTYPE_FLOAT 256 /* 1000 */
179 #define OTF_COUNTER_VARTYPE_DOUBLE 288 /* 1001 */
180 
181 
182 
183 #define OTF_COUNTER_PROP_DEFAULT 0
184 
185 
186 /* Types of collective operations */
187 
188 #define OTF_COLLECTIVE_TYPE_UNKNOWN 0
189 #define OTF_COLLECTIVE_TYPE_BARRIER 1
190 #define OTF_COLLECTIVE_TYPE_ONE2ALL 2
191 #define OTF_COLLECTIVE_TYPE_ALL2ONE 3
192 #define OTF_COLLECTIVE_TYPE_ALL2ALL 4
193 
194 
195 /*
196 File Operations - 32-bit
197 The bits 0-5 contain the identifier of the file operation that has happened.
198 The bits 6-31 are bit flags that carry additional information on the operation.
199 A macro allows for accessing the file operation in a convenient way.
200 */
201 #define OTF_FILEOP_BITS 0x0000001f
202 #define OTF_FILEOP_OPEN 0
203 #define OTF_FILEOP_CLOSE 1
204 #define OTF_FILEOP_READ 2
205 #define OTF_FILEOP_WRITE 3
206 #define OTF_FILEOP_SEEK 4
207 #define OTF_FILEOP_UNLINK 5
208 #define OTF_FILEOP_RENAME 6
209 #define OTF_FILEOP_DUP 7
210 #define OTF_FILEOP_SYNC 8
211 #define OTF_FILEOP_LOCK 9
212 #define OTF_FILEOP_UNLOCK 10
213 #define OTF_FILEOP_OTHER 31
214 #define OTF_IOFLAGS_BITS 0xffffffe0
215 #define OTF_IOFLAG_IOFAILED 32
216 #define OTF_IOFLAG_ASYNC 64
217 #define OTF_IOFLAG_COLL 128
218 #define OTF_IOFLAG_DIRECT 256
219 #define OTF_IOFLAG_SYNC 512
220 #define OTF_IOFLAG_ISREADLOCK 1024
221 #define OTF_FILEOP(x) (x & OTF_FILEOP_BITS)
222 
223 /* Types of markers */
224 
225 #define OTF_MARKER_TYPE_UNKNOWN 0
226 #define OTF_MARKER_TYPE_ERROR 1
227 #define OTF_MARKER_TYPE_WARNING 2
228 #define OTF_MARKER_TYPE_HINT 3
229 
230 /* otf_errno related defines */
231 #define OTF_ERR_LEN 1000
232 #define OTF_NO_ERROR 0
233 #define OTF_ERROR -1
234 
235 extern char otf_strerr[OTF_ERR_LEN];
236 extern int otf_errno;
237 
238 /* OTF_KeyValueList related defines */
239 
240 /* This macro defines the maximum length of a byte array that can be
241  appended internally to an OTF_KeyValueList() --> internal use only
242  For the user a byte array can contain an unlimited number of bytes.
243 NOTE: Do not edit this constant unless you know exactly what you do! */
244 #define OTF_KEYVALUE_MAX_ARRAY_LEN 100
245 
246 /* enum used for DefAttributeList record */
247 /** An enum which holds all values that are possible to set with datatype OTF_ATTR_TYPE().*/
248 typedef enum OTF_ATTR_TYPE_enum {
249  OTF_ATTR_UNKNOWN = 0, /**< */
250  OTF_ATTR_IsMPIRank = 1, /**< */
251  OTF_ATTR_IsPThread = 2, /**< */
252  OTF_ATTR_IsOMPThread = 3, /**< */
253  OTF_ATTR_IsCellSPUThread = 4, /**< */
254  OTF_ATTR_hasGroupCounters = 5, /**< */
255  OTF_ATTR_hasEnterLeaveRecords = 6, /**< */
256  OTF_ATTR_IsCommunicator = 7 /**< */
257 } OTF_ATTR_TYPE;
258 
259 
260 /* return values for handlers. they are not yet evaluated!!! */
261 
262 /** When writing an own handler, use these macros to tell OTF, what to do.
263 if you return OTF_RETURN_OK OTF continues reading the trace and calling the
264 appropriate handlers. If you return OTF_RETURN_BREAK or OTF_RETURN_ABORT OTF
265 stops reading immediately */
266 #define OTF_RETURN_OK 0
267 /** @see OTF_RETURN_OK */
268 #define OTF_RETURN_BREAK 1
269 /** @see OTF_RETURN_OK */
270 #define OTF_RETURN_ABORT 1
271 
272 #define OTF_READ_ERROR (uint64_t)-1
273 #define OTF_READ_MAXRECORDS (uint64_t)-2
274 
275 #endif /* OTF_DEFINITIONS_H */
Provides version information.
enum OTF_ATTR_TYPE_enum OTF_ATTR_TYPE
An enum which holds all values that are possible to set with datatype OTF_ATTR_TYPE().
OTF_ATTR_TYPE_enum
An enum which holds all values that are possible to set with datatype OTF_ATTR_TYPE().
Definition: OTF_Definitions.h:248