1 #ifndef LIBFASTER_DEFINITIONS_H
2 #define LIBFASTER_DEFINITIONS_H
8 #include <unordered_map>
11 #define UNUSED __attribute__((unused))
16 typedef unsigned int fddType;
21 #define LongInt 0x0004
25 #define POINTER 0x0100
28 #define LongIntP 0x0104
30 #define DoubleP 0x0110
35 #define LongIntV 0x1004
37 #define DoubleV 0x1010
38 #define GroupFDD 0x8000
40 typedef unsigned int fddOpType;
42 #define OP_GENERICMAP 0x0100
44 #define OP_BulkMap 0x0102
45 #define OP_FlatMap 0x0104
46 #define OP_BulkFlatMap 0x0108
47 #define OP_MapByKey 0x0110
48 #define OP_FlatMapByKey 0x0120
49 #define OP_GENERICREDUCE 0x0200
50 #define OP_Reduce 0x0201
51 #define OP_BulkReduce 0x0202
52 #define OP_GENERICUPDATE 0x0400
53 #define OP_UpdateByKey 0x0401
54 #define OP_BulkUpdate 0x0402
55 #define OP_GENERICMISC 0x0800
56 #define OP_CountByKey 0x0801
57 #define OP_GroupByKey 0x0802
58 #define OP_CoGroup 0x0804
59 #define OP_Calibrate 0x0808
64 DiscardWorkerDL = 0x03,
72 GetLineSizesDL = 0x08,
93 ExchangeDataByKeyDL = 0x18,
94 GetKeyLocationDL = 0x19
101 template <
typename T,
typename U>
102 using mapFunctionP = U (*) (T & input);
103 template <
typename T,
typename L,
typename U>
104 using ImapFunctionP = std::pair<L,U> (*) (T & input);
105 template <
typename T,
typename U>
106 using PmapFunctionP = std::pair<U,size_t> (*) (T & input);
107 template <
typename T,
typename L,
typename U>
108 using IPmapFunctionP = std::tuple<L,U,size_t> (*) (T & input);
110 template <
typename T,
typename U>
111 using bulkMapFunctionP = void (*) (U * output, T * input,
size_t size);
112 template <
typename T,
typename L,
typename U>
113 using IbulkMapFunctionP = void (*) (L * outKey, U * output, T * input,
size_t size);
114 template <
typename T,
typename U>
115 using PbulkMapFunctionP = void (*) (U * output,
size_t * outputDataSizes, T * input,
size_t size);
116 template <
typename T,
typename L,
typename U>
117 using IPbulkMapFunctionP = void (*) (L * outKey, U * output,
size_t * outputDataSizes, T * input,
size_t size);
119 template <
typename T,
typename U>
120 using flatMapFunctionP = std::deque<U> (*) (T & input);
121 template <
typename T,
typename L,
typename U>
122 using IflatMapFunctionP = std::deque<std::pair<L,U>> (*) (T & input);
123 template <
typename T,
typename U>
124 using PflatMapFunctionP = std::deque<std::pair<U,size_t>> (*) (T & input);
125 template <
typename T,
typename L,
typename U>
126 using IPflatMapFunctionP = std::deque<std::tuple<L, U,size_t>> (*) (T & input);
128 template <
typename T,
typename U>
129 using bulkFlatMapFunctionP = void (*) (U *& output,
size_t & outputSize, T * input,
size_t size);
130 template <
typename T,
typename L,
typename U>
131 using IbulkFlatMapFunctionP = void (*) (L *& outKey, U *& output,
size_t & outputSize, T * input,
size_t size);
132 template <
typename T,
typename U>
133 using PbulkFlatMapFunctionP = void (*) (U *& output,
size_t *& outputDataSizes,
size_t & outputSize, T * input,
size_t size);
134 template <
typename T,
typename L,
typename U>
135 using IPbulkFlatMapFunctionP = void (*) (L *& outKey, U *& output,
size_t *& outputDataSizes,
size_t & outputSize, T * input,
size_t size);
137 template <
typename T>
138 using reduceFunctionP = T (*) (T & a, T & b);
140 template <
typename T>
141 using bulkReduceFunctionP = T (*) (T * input,
size_t size);
146 template <
typename T,
typename U>
147 using mapPFunctionP = U (*) (T * input,
size_t size);
148 template <
typename T,
typename L,
typename U>
149 using ImapPFunctionP = std::pair<L,U> (*) (T * input,
size_t size);
150 template <
typename T,
typename U>
151 using PmapPFunctionP = std::pair<U,size_t> (*) (T * input,
size_t size);
152 template <
typename T,
typename L,
typename U>
153 using IPmapPFunctionP = std::tuple<L,U,size_t> (*) (T * input,
size_t size);
156 template <
typename T,
typename U>
157 using bulkMapPFunctionP = void (*) (U * output, T ** input,
size_t * inputDataSizes,
size_t size);
158 template <
typename T,
typename L,
typename U>
159 using IbulkMapPFunctionP = void (*) (L * outKey, U * output, T ** input,
size_t * inputDataSizes,
size_t size);
160 template <
typename T,
typename U>
161 using PbulkMapPFunctionP = void (*) (U * output,
size_t * outputDataSizes, T ** input,
size_t * inputDataSizes,
size_t size);
162 template <
typename T,
typename L,
typename U>
163 using IPbulkMapPFunctionP = void (*) (L * outKey, U * output,
size_t * outputDataSizes, T ** input,
size_t * inputDataSizes,
size_t size);
166 template <
typename T,
typename U>
167 using flatMapPFunctionP = std::deque<U> (*) (T *& input,
size_t size);
168 template <
typename T,
typename L,
typename U>
169 using IflatMapPFunctionP = std::deque<std::pair<L,U>> (*) (T *& input,
size_t size);
170 template <
typename T,
typename U>
171 using PflatMapPFunctionP = std::deque<std::pair<U, size_t>> (*) (T *& input,
size_t size);
172 template <
typename T,
typename L,
typename U>
173 using IPflatMapPFunctionP = std::deque<std::tuple<L, U, size_t>> (*) (T *& input,
size_t size);
176 template <
typename T,
typename U>
177 using bulkFlatMapPFunctionP = void (*) (U *& output,
size_t & outputSize, T ** input,
size_t * inputDataSizes,
size_t size) ;
178 template <
typename T,
typename L,
typename U>
179 using IbulkFlatMapPFunctionP = void (*) (L *& outKey, U *& output,
size_t & outputSize, T ** input,
size_t * inputDataSizes,
size_t size) ;
180 template <
typename T,
typename U>
181 using PbulkFlatMapPFunctionP = void (*) (U *& output,
size_t * outputDataSizes,
size_t & outputSize, T ** input,
size_t * inputDataSizes,
size_t size);
182 template <
typename T,
typename L,
typename U>
183 using IPbulkFlatMapPFunctionP = void (*) (L *& outKey, U *& output,
size_t * outputDataSizes,
size_t & outputSize, T ** input,
size_t * inputDataSizes,
size_t size);
187 template <
typename T>
188 using PreducePFunctionP = std::pair<T *, size_t> (*) (T * a,
size_t sizeA, T * b,
size_t sizeB);
190 template <
typename T>
191 using PbulkReducePFunctionP = std::pair<T *, size_t> (*) (T ** input,
size_t * inputDataSizes,
size_t size);
196 template <
typename K,
typename T,
typename L,
typename U>
197 using ImapIFunctionP = std::pair<L,U> (*) (
const K & inKey, T & input);
198 template <
typename K,
typename T,
typename U>
199 using mapIFunctionP = U (*) (
const K & inKey, T & input);
200 template <
typename K,
typename T,
typename L,
typename U>
202 using IPmapIFunctionP = std::tuple<L,U,size_t> (*) (
const K & inKey, T & input);
203 template <
typename K,
typename T,
typename U>
204 using PmapIFunctionP = std::pair<U, size_t> (*) (
const K & inKey, T & input);
216 template <
typename K,
typename T,
typename L,
typename U>
217 using ImapByKeyIFunctionP = std::pair<L,U> (*) (
const K & inKey, std::vector<T *> & input);
218 template <
typename K,
typename T,
typename U>
219 using mapByKeyIFunctionP = U (*) (
const K & inKey, std::vector <T *> & input);
220 template <
typename K,
typename T,
typename L,
typename U>
221 using IPmapByKeyIFunctionP = std::tuple<L,U,size_t> (*) (
const K & inKey, std::vector <T *> & input);
222 template <
typename K,
typename T,
typename U>
223 using PmapByKeyIFunctionP = std::pair<U, size_t> (*) (
const K & inKey, std::vector <T *> & input);
225 template <
typename K,
typename T,
typename L,
typename U>
226 using IbulkMapIFunctionP = void (*) (L * outKey, U * output, K * inKey, T * input,
size_t size);
227 template <
typename K,
typename T,
typename U>
228 using bulkMapIFunctionP = void (*) (U * output, K * inKey, T * input,
size_t size);
229 template <
typename K,
typename T,
typename L,
typename U>
230 using IPbulkMapIFunctionP = void (*) (L * outKey, U * output,
size_t * outputDataSizes, K * inKey, T * input,
size_t size);
231 template <
typename K,
typename T,
typename U>
232 using PbulkMapIFunctionP = void (*) (U * output,
size_t * outputDataSizes, K * inKey, T * input,
size_t size);
234 template <
typename K,
typename T,
typename L,
typename U>
235 using IflatMapIFunctionP = std::deque<std::pair<L,U>> (*) (K inKey, T & input);
236 template <
typename K,
typename T,
typename U>
237 using flatMapIFunctionP = std::deque<U> (*) (K inKey, T & input);
238 template <
typename K,
typename T,
typename L,
typename U>
239 using IPflatMapIFunctionP = std::deque<std::tuple<L, U,size_t>> (*) (K inKey, T & input);
240 template <
typename K,
typename T,
typename U>
241 using PflatMapIFunctionP = std::deque<std::pair<U, size_t>> (*) (K inKey, T & input);
243 template <
typename K,
typename T,
typename L,
typename U>
244 using IbulkFlatMapIFunctionP = void (*) (L *& outKey, U *& output,
size_t & outputSize, K * inKey, T * input,
size_t size);
245 template <
typename K,
typename T,
typename U>
246 using bulkFlatMapIFunctionP = void (*) (U *& output,
size_t & outputSize, K * inKey, T * input,
size_t size);
247 template <
typename K,
typename T,
typename L,
typename U>
248 using IPbulkFlatMapIFunctionP = void (*) (L *& outKey, U *& output,
size_t *& outputDataSizes,
size_t & outputSize, K * inKey, T * input,
size_t size);
249 template <
typename K,
typename T,
typename U>
250 using PbulkFlatMapIFunctionP = void (*) (U *& output,
size_t *& outputDataSizes,
size_t & outputSize, K * inKey, T * input,
size_t size);
252 template <
typename K,
typename T>
253 using IreduceIFunctionP = std::pair<K,T> (*) (
const K & keyA, T & a,
const K & keyB, T & b);
255 template <
typename K,
typename T>
256 using IreduceByKeyIFunctionP = std::pair<K,T> (*) (
const K & keyA, T * a,
size_t sizeA,
const K & keyB, T * b,
size_t sizeB);
258 template <
typename K,
typename T>
259 using IbulkReduceIFunctionP = std::pair<K,T> (*) (K * key, T * input,
size_t size);
264 template <
typename K,
typename T,
typename L,
typename U>
265 using ImapIPFunctionP = std::pair<L,U> (*) (K inKey, T * input,
size_t size);
266 template <
typename K,
typename T,
typename U>
267 using mapIPFunctionP = U (*) (K inKey, T * input,
size_t size);
268 template <
typename K,
typename T,
typename L,
typename U>
269 using IPmapIPFunctionP = std::tuple<L,U,size_t> (*) (K inKey, T * input,
size_t size);
270 template <
typename K,
typename T,
typename U>
271 using PmapIPFunctionP = std::pair<U, size_t> (*) (K inKey, T * input,
size_t size);
273 template <
typename K,
typename T,
typename L,
typename U>
274 using ImapByKeyIPFunctionP = std::pair<L,U> (*) (
const K & inKey, std::vector<std::pair<T*,size_t>>);
275 template <
typename K,
typename T,
typename U>
276 using mapByKeyIPFunctionP = U (*) (
const K & inKey, std::vector<std::pair<T*,size_t>>);
277 template <
typename K,
typename T,
typename L,
typename U>
278 using IPmapByKeyIPFunctionP = std::tuple<L,U,size_t> (*) (
const K & inKey, std::vector<std::pair<T*,size_t>>);
279 template <
typename K,
typename T,
typename U>
280 using PmapByKeyIPFunctionP = std::pair<U, size_t> (*) (
const K & inKey, std::vector<std::pair<T*,size_t>>);
282 template <
typename K,
typename T,
typename L,
typename U>
283 using IbulkMapIPFunctionP = void (*) (L * outKey, U * output, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
284 template <
typename K,
typename T,
typename U>
285 using bulkMapIPFunctionP = void (*) (U * output, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
286 template <
typename K,
typename T,
typename L,
typename U>
287 using IPbulkMapIPFunctionP = void (*) (L * outKey, U * output,
size_t * outputDataSizes, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
288 template <
typename K,
typename T,
typename U>
289 using PbulkMapIPFunctionP = void (*) (U * output,
size_t * outputDataSizes, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
292 template <
typename K,
typename T,
typename L,
typename U>
293 using IflatMapIPFunctionP = std::deque<std::pair<L,U>> (*) (T *& input,
size_t size);
294 template <
typename K,
typename T,
typename U>
295 using flatMapIPFunctionP = std::deque<U> (*) (T *& input,
size_t size);
296 template <
typename K,
typename T,
typename L,
typename U>
297 using IPflatMapIPFunctionP = std::deque<std::tuple<L, U, size_t>> (*) (T *& input,
size_t size);
298 template <
typename K,
typename T,
typename U>
299 using PflatMapIPFunctionP = std::deque<std::pair<U, size_t>> (*) (T *& input,
size_t size);
302 template <
typename K,
typename T,
typename L,
typename U>
303 using IbulkFlatMapIPFunctionP = void (*) (L *& outKey, U *& output,
size_t & outputSize, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size) ;
304 template <
typename K,
typename T,
typename U>
305 using bulkFlatMapIPFunctionP = void (*) (U *& output,
size_t & outputSize, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size) ;
306 template <
typename K,
typename T,
typename L,
typename U>
307 using IPbulkFlatMapIPFunctionP = void (*) (L *& outKey, U *& output,
size_t * outputDataSizes,
size_t & outputSize, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
308 template <
typename K,
typename T,
typename U>
309 using PbulkFlatMapIPFunctionP = void (*) (U *& output,
size_t * outputDataSizes,
size_t & outputSize, K * inKey, T ** input,
size_t * inputDataSizes,
size_t size);
313 template <
typename K,
typename T>
314 using IPreduceIPFunctionP = std::tuple<K,T*,size_t> (*) (K keyA, T * a,
size_t sizeA, K keyB, T * b,
size_t sizeB);
316 template <
typename K,
typename T>
317 using IPreduceByKeyIPFunctionP = std::tuple<K,T*,size_t> (*) (K keyA, T ** a,
size_t * dataSizesA,
size_t sizeA, K keyB, T ** b,
size_t * dataSizesB,
size_t sizeB);
319 template <
typename K,
typename T>
320 using IPbulkReduceIPFunctionP = std::tuple<K,T*,size_t> (*) (K * key, T ** input,
size_t * inputDataSizes,
size_t size);
325 template <
typename K>
326 using updateByKeyG2FunctionP = void (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b);
328 template <
typename K>
329 using updateByKeyG3FunctionP = void (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b, std::vector<void*> & c);
332 template <
typename K>
333 using bulkUpdateG2FunctionP = void (*) (K * keyA,
void * a,
size_t na, K * keyB,
void * b,
size_t nb);
335 template <
typename K>
336 using bulkUpdateG3FunctionP = void (*) (K * keyA,
void * a,
size_t na, K * keyB,
void * b,
size_t nb, K * keyC,
void * c,
size_t nc);
339 template <
typename K,
typename To>
340 using mapByKeyG2FunctionP = To (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b);
342 template <
typename K,
typename To>
343 using mapByKeyG3FunctionP = To (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b, std::vector<void*> & c);
345 template <
typename K,
typename Ko,
typename To>
346 using ImapByKeyG2FunctionP = std::pair<Ko,To> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b);
348 template <
typename K,
typename Ko,
typename To>
349 using ImapByKeyG3FunctionP = std::pair<Ko,To> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b, std::vector<void*> & c);
352 template <
typename K,
typename To>
353 using flatMapByKeyG2FunctionP = std::deque<To> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b);
355 template <
typename K,
typename To>
356 using flatMapByKeyG3FunctionP = std::deque<To> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b, std::vector<void*> & c);
358 template <
typename K,
typename Ko,
typename To>
359 using IflatMapByKeyG2FunctionP = std::deque<std::pair<Ko,To>> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b);
361 template <
typename K,
typename Ko,
typename To>
362 using IflatMapByKeyG3FunctionP = std::deque<std::pair<Ko,To>> (*) (
const K & key, std::vector<void*> & a, std::vector<void*> & b, std::vector<void*> & c);
365 template <
typename K,
typename To>
366 using bulkFlatMapG2FunctionP = std::deque<To> (*) (K * keyA,
void* a,
size_t na, K * keyB,
void* b,
size_t nb);
368 template <
typename K,
typename To>
369 using bulkFlatMapG3FunctionP = std::deque<To> (*) (K * keyA,
void* a,
size_t na, K * keyB,
void* b,
size_t nb, K * keyC,
void* c,
size_t nc);
371 template <
typename K,
typename Ko,
typename To>
372 using IbulkFlatMapG2FunctionP = std::deque<std::pair<Ko,To>> (*) (K * keyA,
void* a,
size_t na, K * keyB,
void* b,
size_t nb);
374 template <
typename K,
typename Ko,
typename To>
375 using IbulkFlatMapG3FunctionP = std::deque<std::pair<Ko,To>> (*) (K * keyA,
void* a,
size_t na, K * keyB,
void* b,
size_t nb, K * keyC,
void* c,
size_t nc);
Definition: _workerFdd.h:11