-
Notifications
You must be signed in to change notification settings - Fork 10
/
IOtf2Constants.java
273 lines (234 loc) · 6.48 KB
/
IOtf2Constants.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
/**********************************************************************
* Copyright (c) 2021 École Polytechnique de Montréal
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License 2.0 which
* accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
**********************************************************************/
package org.eclipse.tracecompass.incubator.internal.otf2.core.analysis;
import java.util.regex.Pattern;
/**
* Constants for the OTF2 format
*
* @author Yoann Heitz
*/
public interface IOtf2Constants {
/**
* Pattern to match an OTF2 event name (<event type>_<event name>) like:
* GlobalDef_Region
*/
Pattern OTF2_EVENT_NAME_PATTERN = Pattern.compile("^(?<type>.*)_(?<name>.*)"); //$NON-NLS-1$
/**
* Edges
*/
String EDGES = "Edges"; //$NON-NLS-1$
/**
* Unknown string
*/
String UNKNOWN_STRING = "UNKNOWN"; //$NON-NLS-1$
/**
* type group in {@link IOtf2Constants#OTF2_EVENT_NAME_PATTERN}
*/
String OTF2_TYPE_GROUP = "type"; //$NON-NLS-1$
/**
* name group in {@link IOtf2Constants#OTF2_EVENT_NAME_PATTERN}
*/
String OTF2_NAME_GROUP = "name"; //$NON-NLS-1$
/**
* Global definition event type
*/
String OTF2_GLOBAL_DEFINITION = "GlobalDef"; //$NON-NLS-1$
/**
* Event event type
*/
String OTF2_EVENT = "Event"; //$NON-NLS-1$
/**
* Enum for collective MPI operations
*/
public enum CollectiveOperation {
/**
* MPI_Barrier operation
*/
BARRIER,
/**
* MPI_Bcast operation
*/
BCAST,
/**
* MPI_Gather operation
*/
GATHER,
/**
* MPI_Gatherv operation
*/
GATHERV,
/**
* MPI_Scatter operation
*/
SCATTER,
/**
* MPI_Scatterv operation
*/
SCATTERV,
/**
* MPI_Allgather operation
*/
ALLGATHER,
/**
* MPI_Allgatherv operation
*/
ALLGATHERV,
/**
* MPI_Alltoall operation
*/
ALLTOALL,
/**
* MPI_Alltoallv operation
*/
ALLTOALLV,
/**
* MPI_Alltoallw operation
*/
ALLTOALLW,
/**
* MPI_Allreduce operation
*/
ALLREDUCE,
/**
* MPI_Reduce operation
*/
REDUCE,
/**
* MPI_Reducescatter operation
*/
REDUCE_SCATTER,
/**
* MPI_Scan operation
*/
SCAN,
/**
* MPI_Exscan operation
*/
EXSCAN,
/**
* MPI_Reduce_scatter_block operation
*/
REDUCE_SCATTER_BLOCK,
/**
* MPI create handle operation
*/
CREATE_HANDLE,
/**
* MPI destroy handle operation
*/
DESTROY_HANDLE,
/**
* MPI allocate operation
*/
ALLOCATE,
/**
* MPI deallocate operation
*/
DEALLOCATE,
/**
* MPI create handle and allocate operation
*/
CREATE_HANDLE_AND_ALLOCATE,
/**
* MPI destroy handle and deallocate operation
*/
DESTROY_HANDLE_AND_DEALLOCATE,
/**
* Unknown operation
*/
UNKNOWN_OPERATION;
}
/**
* @param operationCode
* The code for the collective operation
* @return the associated operation member from CollectiveOperation
*/
public static CollectiveOperation getOperation(int operationCode) {
switch (operationCode) {
case 0:
return CollectiveOperation.BARRIER;
case 1:
return CollectiveOperation.BCAST;
case 2:
return CollectiveOperation.GATHER;
case 3:
return CollectiveOperation.GATHERV;
case 4:
return CollectiveOperation.SCATTER;
case 5:
return CollectiveOperation.SCATTERV;
case 6:
return CollectiveOperation.ALLGATHER;
case 7:
return CollectiveOperation.ALLGATHERV;
case 8:
return CollectiveOperation.ALLTOALL;
case 9:
return CollectiveOperation.ALLTOALLV;
case 10:
return CollectiveOperation.ALLTOALLW;
case 11:
return CollectiveOperation.ALLREDUCE;
case 12:
return CollectiveOperation.REDUCE;
case 13:
return CollectiveOperation.REDUCE_SCATTER;
case 14:
return CollectiveOperation.SCAN;
case 15:
return CollectiveOperation.EXSCAN;
case 16:
return CollectiveOperation.REDUCE_SCATTER_BLOCK;
case 17:
return CollectiveOperation.CREATE_HANDLE;
case 18:
return CollectiveOperation.DESTROY_HANDLE;
case 19:
return CollectiveOperation.ALLOCATE;
case 20:
return CollectiveOperation.DEALLOCATE;
case 21:
return CollectiveOperation.CREATE_HANDLE_AND_ALLOCATE;
case 22:
return CollectiveOperation.DESTROY_HANDLE_AND_DEALLOCATE;
default:
return CollectiveOperation.UNKNOWN_OPERATION;
}
}
/**
* long constant representing OTF2 undefined uint32 value
*/
long OTF2_UNDEFINED_UINT32 = (1L << 32) - 1;
/**
* In the following lines, undefined and unknown constants are defined for
* the different OTF2 references.
*
* The undefined constants should be used when no issues occurred while
* reading a reference field but when the reference value is the undefined
* value in the OTF2 standards.
*
* The unknown constants should be used when an issue occurred while reading
* a reference but a default value should be used to continue to process the
* trace.
*/
/**
* Constant representing an unknown string reference.
*/
long OTF2_UNKNOWN_STRING = OTF2_UNDEFINED_UINT32;
/**
* Constant representing an undefined system tree node reference.
*/
long OTF2_UNDEFINED_SYSTEM_TREE_NODE = OTF2_UNDEFINED_UINT32;
/**
* Constant representing an unknown system tree node reference.
*/
long OTF2_UNKNOWN_SYSTEM_TREE_NODE = OTF2_UNDEFINED_UINT32;
}