libfaster API Documentation  Development Version
Super fast distributted computing
fdd.h
1 #ifndef LIBFASTER_FDD_H
2 #define LIBFASTER_FDD_H
3 
4 #include <vector>
5 #include <typeinfo>
6 #include <stdio.h>
7 #include <list>
8 #include <omp.h>
9 
10 
11 #include "definitions.h"
12 #include "fddBase.h"
13 #include "fastContext.h"
14 
15 namespace faster{
16 
17  class fastTask;
18 
19  template <class K, class T>
20  class indexedFdd ;
21 
25  template <typename T>
26  class fddCore : public fddBase {
27  protected :
28  fastContext * context;
29 
30  // -------------- Core FDD Functions --------------- //
31 
32  fddCore() {
33  cached = false;
34  }
35 
36  fddCore(fastContext & c);
37 
38  virtual ~fddCore() {}
39 
40  // Create a empty fdd with a pre allocated size
41  fddCore(fastContext &c, size_t s, const std::vector<size_t> & dataAlloc);
42 
43  // 1->1 function (map, bulkmap, flatmap...)
44  fddBase * _map( void * funcP, fddOpType op, fddBase * newFdd);
45  template <typename L, typename U>
46  indexedFdd<L,U> * mapI( void * funcP, fddOpType op);
47  template <typename U>
48  fdd<U> * map( void * funcP, fddOpType op);
49 
50  public:
51 
54  void discard(){
55  context->discardFDD(id);
56  }
57 
65  void writeToFile(std::string & path, std::string & sufix);
66 
68  void * getKeyMap() { return NULL; }
70  void setKeyMap(void * keyMap UNUSED) {}
72  bool isGroupedByKey() { return false; }
74  void setGroupedByKey(bool gbk UNUSED) {}
75 
76  };
77 
78  // Driver side FDD
79  // It just sends commands to the workers.
84  template <class T>
85  class fdd : public fddCore<T>{
86  private:
87  T finishReduces(char ** partResult, size_t * pSize, int funcId, fddOpType op);
88  T reduce( void * funcP, fddOpType op);
89  public:
90  // -------------- Constructors --------------- //
91 
93  fdd(fastContext &c) : fddCore<T>(c){
94  this->id = c.createFDD(this, typeid(T).hash_code());
95  }
96 
98  fdd(fastContext &c, size_t s, const std::vector<size_t> & dataAlloc) : fddCore<T>(c, s, dataAlloc){
99  this->id = c.createFDD(this, typeid(T).hash_code(), dataAlloc);
100  }
101 
103  fdd(fastContext &c, size_t s) : fdd(c, s, c.getAllocation(s)) { }
104 
106  fdd(fastContext &c, T * data, size_t size) : fdd(c, size){
107  //c.parallelize(fddBase::id, data, size);
108  assign(data, size);
109  }
110 
112  fdd(fastContext &c, std::vector<T> &dataV) : fdd(c, dataV.data(), dataV.size()){ }
113 
115  fdd(fastContext &c, const char * fileName) ;
116 
118  void assign(std::vector<T> & data){
119  assign(data.data(), data.size());
120  }
121 
123  void assign(T * data, size_t size){
124  fddCore<T>::context->parallelize(fddBase::id, data, size);
125  }
126 
127 
130  ~fdd(){ }
131 
132  // --------------- FDD Builtin functions ------------- //
136  std::vector<T> collect( ){
137  std::vector<T> data(this->size);
138  this->context->collectFDD(data, this);
139  return data;
140  }
141  /*void * _collect( ) override{
142  return fddCore<T>::context->collectFDD(this);
143  }*/
144 
145 
151  this->cached = true;
152  return this;
153  }
154 
155  // -------------- FDD Functions --------------- //
156 
157  // TODO add update
158 
161 
163  template <typename U>
164  fdd<U> * map( mapFunctionP<T,U> funcP ){
165  return fddCore<T>::template map<U>((void*) funcP, OP_Map);
166  }
168  template <typename U>
169  fdd<U> * map( PmapFunctionP<T,U> funcP ){
170  return fddCore<T>::template map<U>((void*) funcP, OP_Map);
171  }
173  template <typename L, typename U>
174  indexedFdd<L,U> * map( ImapFunctionP<T,L,U> funcP ){
175  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_Map);
176  }
178  template <typename L, typename U>
179  indexedFdd<L,U> * map( IPmapFunctionP<T,L,U> funcP ){
180  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_Map);
181  }
182 
185  template <typename U>
186  fdd<U> * bulkMap( bulkMapFunctionP<T,U> funcP ){
187  return fddCore<T>::template map<U>((void*) funcP, OP_BulkMap);
188  }
191  template <typename U>
192  fdd<U> * bulkMap( PbulkMapFunctionP<T,U> funcP ){
193  return fddCore<T>::template map<U>((void*) funcP, OP_BulkMap);
194  }
197  template <typename L, typename U>
198  indexedFdd<L,U> * bulkMap( IbulkMapFunctionP<T,L,U> funcP ){
199  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkMap);
200  }
203  template <typename L, typename U>
204  indexedFdd<L,U> * bulkMap( IPbulkMapFunctionP<T,L,U> funcP ){
205  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkMap);
206  }
208 
209 
212 
214  template <typename U>
215  fdd<U> * flatMap( flatMapFunctionP<T,U> funcP ){
216  return fddCore<T>::template map<U>((void*) funcP, OP_FlatMap);
217  }
219  template <typename U>
220  fdd<U> * flatMap( PflatMapFunctionP<T,U> funcP ){
221  return fddCore<T>::template map<U>((void*) funcP, OP_FlatMap);
222  }
224  template <typename L, typename U>
225  indexedFdd<L,U> * flatMap( IflatMapFunctionP<T,L,U> funcP ){
226  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_FlatMap);
227  }
228  template <typename L, typename U>
230  indexedFdd<L,U> * flatMap( IPflatMapFunctionP<T,L,U> funcP ){
231  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_FlatMap);
232  }
233 
234 
237  template <typename U>
238  fdd<U> * bulkFlatMap( bulkFlatMapFunctionP<T,U> funcP ){
239  return fddCore<T>::template map<U>((void*) funcP, OP_BulkFlatMap);
240  }
243  template <typename U>
244  fdd<U> * bulkFlatMap( PbulkFlatMapFunctionP<T,U> funcP ){
245  return fddCore<T>::template map<U>((void*) funcP, OP_BulkFlatMap);
246  }
249  template <typename L, typename U>
250  indexedFdd<L,U> * bulkFlatMap( IbulkFlatMapFunctionP<T,L,U> funcP ){
251  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkFlatMap);
252  }
255  template <typename L, typename U>
256  indexedFdd<L,U> * bulkFlatMap( IPbulkFlatMapFunctionP<T,L,U> funcP ){
257  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkFlatMap);
258  }
260 
263 
265  T reduce( reduceFunctionP<T> funcP ){
266  return reduce((void*) funcP, OP_Reduce);
267  }
271  T bulkReduce( bulkReduceFunctionP<T> funcP ){
272  return reduce((void*) funcP, OP_BulkReduce);
273  }
275 
276 
277  };
278 
279  template <class T>
280  class fdd<T *> : public fddCore<T>{
281  private:
282  std::vector <T> finishPReduces(T ** partResult, size_t * partrSize, int funcId, fddOpType op);
283  std::vector <T> reduceP(void * funcP, fddOpType op);
284  public:
285  // -------------- Constructors --------------- //
286 
287  // Create a empty fdd
288  fdd(fastContext &c) : fddCore<T>(c){
289  this->id = c.createPFDD(this, typeid(T).hash_code());
290  }
291 
292  // Create a empty fdd with a pre allocated size
293  fdd(fastContext &c, size_t s, const std::vector<size_t> & dataAlloc) : fddCore<T>(c, s, dataAlloc){
294  this->id = c.createPFDD(this, typeid(T).hash_code(), dataAlloc);
295  }
296  fdd(fastContext &c, size_t s) :fdd(c, s, c.getAllocation(s)) { }
297 
298  // Create a fdd from a array in memory
299  fdd(fastContext &c, T * data[], size_t dataSizes[], size_t size) : fdd(c, size){
300  c.parallelize(fddBase::id, data, dataSizes, size);
301  }
302 
303  ~fdd(){ }
304 
305 
306  // -------------- FDD Functions Parameter Specification --------------- //
307  // These need to be specialized because they can return a pointer or not
308 
309  // Run a Map
310  template <typename U>
311  fdd<U> * map( mapPFunctionP<T,U> funcP ){
312  return fddCore<T>::template map<U>((void*) funcP, OP_Map);
313  }
314  template <typename U>
315  fdd<U> * map( PmapPFunctionP<T,U> funcP ){
316  return fddCore<T>::template map<U>((void*) funcP, OP_Map);
317  }
318  template <typename L, typename U>
319  indexedFdd<L,U> * map( ImapPFunctionP<T,L,U> funcP ){
320  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_Map);
321  }
322  template <typename L, typename U>
323  indexedFdd<L,U> * map( IPmapPFunctionP<T,L,U> funcP ){
324  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_Map);
325  }
326 
327 
328  template <typename U>
329  fdd<U> * bulkMap( bulkMapPFunctionP<T,U> funcP ){
330  return fddCore<T>::template map<U>((void*) funcP, OP_BulkMap);
331  }
332  template <typename U>
333  fdd<U> * bulkMap( PbulkMapPFunctionP<T,U> funcP ){
334  return fddCore<T>::template map<U>((void*) funcP, OP_BulkMap);
335  }
336  template <typename L, typename U>
337  indexedFdd<L,U> * bulkMap( IbulkMapPFunctionP<T,L,U> funcP ){
338  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkMap);
339  }
340  template <typename L, typename U>
341  indexedFdd<L,U> * bulkMap( IPbulkMapPFunctionP<T,L,U> funcP ){
342  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkMap);
343  }
344 
345 
346  template <typename U>
347  fdd<U> * flatMap( flatMapPFunctionP<T,U> funcP){
348  return fddCore<T>::template map<U>((void*) funcP, OP_FlatMap);
349  }
350  template <typename U>
351  fdd<U> * flatMap( PflatMapPFunctionP<T,U> funcP){
352  return fddCore<T>::template map<U>((void*) funcP, OP_FlatMap);
353  }
354  template <typename L, typename U>
355  indexedFdd<L,U> * flatMap( IflatMapPFunctionP<T,L,U> funcP){
356  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_FlatMap);
357  }
358  template <typename L, typename U>
359  indexedFdd<L,U> * flatMap( IPflatMapPFunctionP<T,L,U> funcP){
360  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_FlatMap);
361  }
362 
363 
364  template <typename U>
365  fdd<U> * bulkFlatMap( bulkFlatMapPFunctionP<T,U> funcP){
366  return fddCore<T>::template map<U>((void*) funcP, OP_BulkFlatMap);
367  }
368  template <typename U>
369  fdd<U> * bulkFlatMap( PbulkFlatMapPFunctionP<T,U> funcP){
370  return fddCore<T>::template map<U>((void*) funcP, OP_BulkFlatMap);
371  }
372  template <typename L, typename U>
373  indexedFdd<L,U> * bulkFlatMap( IbulkFlatMapPFunctionP<T,L,U> funcP){
374  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkFlatMap);
375  }
376  template <typename L, typename U>
377  indexedFdd<L,U> * bulkFlatMap( IPbulkFlatMapPFunctionP<T,L,U> funcP){
378  return fddCore<T>::template mapI<L,U>((void*) funcP, OP_BulkFlatMap);
379  }
380 
381  // Run a Reduce
382  inline std::vector<T> reduce(PreducePFunctionP<T> funcP ){
383  return reduceP((void*) funcP, OP_Reduce);
384  }
385  inline std::vector<T> bulkReduce(PbulkReducePFunctionP<T> funcP ){
386  return reduceP((void*) funcP, OP_BulkReduce);
387  }
388 
389  // --------------- FDD Builtin functions ------------- //
390  // Collect a FDD
391  std::vector<std::pair<T*, size_t>> collect( ) {
392  std::vector<std::pair<T*, size_t>> data(this->size);
393  this->context->collectFDD(data, this);
394  return data;
395  }
396  /*void * _collect( ) override{
397  return fddCore<T>::context->collectFDD(this);
398  }*/
399  fdd<T*> * cache(){
400  this->cached = true;
401  return this;
402  }
403 
404  };
405 
406  template <typename T>
408  cached = false;
409  context = &c;
410  }
411 
412  template <typename T>
413  fddCore<T>::fddCore(fastContext &c, size_t s, const std::vector<size_t> & dataAlloc) : fddCore(c){
414  this->size = s;
415  this->dataAlloc = dataAlloc;
416  }
417 
418 
419  template <typename T>
420  fddBase * fddCore<T>::_map( void * funcP, fddOpType op, fddBase * newFdd){
421  unsigned long int tid, sid;
422  //std::cerr << " Map ";
423  context->setInternal(newFdd->getId(), true);
424 
425  unsigned long int newFddId = newFdd->getId();
426 
427  // Decode function pointer
428  int funcId = context->findFunc(funcP);
429  //std::cerr << " " << funcId << ".\n";
430 
431  // Send task
432  auto start = system_clock::now();
433  context->enqueueTask(op, id, newFddId, funcId, this->size);
434 
435 
436  // Receive results
437  auto result = context->recvTaskResult(tid, sid, start);
438 
439  if ( (op & 0xff) & (OP_FlatMap | OP_BulkFlatMap) ) {
440  size_t newSize = 0;
441  for (int i = 1; i < context->numProcs(); ++i){
442  if (result[i].second > 0) newSize += * (size_t *) result[i].first;
443  }
444 
445  newFdd->setSize(newSize);
446  }
447 
448  if (!cached){
449  this->discard();
450  }
451 
452  //std::cerr << "\n";
453  return newFdd;
454  }
455 
456  template <typename T>
457  template <typename U>
458  fdd<U> * fddCore<T>::map( void * funcP, fddOpType op){
459  fddBase * newFdd ;
460 
461  if ( (op & 0xFF ) & (OP_FlatMap | OP_BulkFlatMap) ){
462  newFdd = new fdd<U>(*context);
463  }else{
464  if (dataAlloc.empty()) dataAlloc = context->getAllocation(size);
465  newFdd = new fdd<U>(*context, size, dataAlloc);
466  }
467 
468  return (fdd<U> *) _map(funcP, op, newFdd);
469  }
470 
471  template <typename T>
472  void fddCore<T>::writeToFile(std::string & path, std::string & sufix){
473  context->writeToFile(id, path, sufix);
474  }
475 
476  template <typename T>
477  template <typename L, typename U>
478  indexedFdd<L,U> * fddCore<T>::mapI( void * funcP, fddOpType op){
479  fddBase * newFdd ;
480 
481  if ( (op & 0xFF ) & (OP_FlatMap | OP_BulkFlatMap) ){
482  newFdd = new indexedFdd<L,U>(*context);
483  }else{
484  if (dataAlloc.empty()) dataAlloc = context->getAllocation(size);
485  newFdd = new indexedFdd<L,U>(*context, size, dataAlloc);
486  }
487 
488  return (indexedFdd<L,U> *) _map(funcP, op, newFdd);
489  }
490 
491  template <typename T>
492  T fdd<T>::finishReduces(char ** partResult, size_t * pSize, int funcId, fddOpType op){
493  fastCommBuffer buffer(0);
494  T result;
495 
496  if (op == OP_Reduce){
497  reduceFunctionP<T> reduceFunc = (reduceFunctionP<T>) this->context->funcTable[funcId];
498 
499  // Get the real object behind the buffer
500  buffer.setBuffer(partResult[0], pSize[0]);
501  buffer >> result;
502 
503  for (int i = 1; i < (this->context->numProcs() - 1); ++i){
504  T pr;
505 
506  //std::cerr << " Reduce Result Size:" << pSize[i] << "\n";
507  if (pSize[i] == 0) std::cerr << "UNEXPECTED ERROR!!!!";
508 
509  buffer.setBuffer(partResult[i], pSize[i]);
510  buffer >> pr;
511 
512  result = reduceFunc(result, pr);
513  }
514  }else{
515  bulkReduceFunctionP<T> bulkReduceFunc = (bulkReduceFunctionP<T>) this->context->funcTable[funcId];
516  T * vals = new T[this->context->numProcs() - 1];
517 
518  //#pragma omp parallel for
519  for (int i = 1; i < (this->context->numProcs() - 1); ++i){
520  fastCommBuffer buffer(0);
521 
522  buffer.setBuffer(partResult[i], pSize[i]);
523  buffer >> vals[i];
524  }
525 
526  result = bulkReduceFunc(vals, this->context->numProcs() - 1);
527  delete [] vals;
528  // TODO do bulkreduce
529  }
530  return result;
531  }
532 
533  template <typename T>
534  T fdd<T>::reduce( void * funcP, fddOpType op){
535  //std::cerr << " Reduce ";
536  //T fddCore<T>::template reduce( int funcId, fddOpType op){
537  T result;
538  unsigned long int tid, sid;
539  int funcId = this->context->findFunc(funcP);
540  //std::cerr << " " << funcId << ".\n";
541  char ** partResult = new char*[this->context->numProcs() - 1];
542  size_t * rSize = new size_t[this->context->numProcs() - 1];
543 
544  // Send task
545  //unsigned long int reduceTaskId =
546  auto start = system_clock::now();
547  this->context->enqueueTask(op, this->id, 0, funcId, this->size);
548 
549  // Receive results
550  auto resultV = this->context->recvTaskResult(tid, sid, start);
551 
552  for (int i = 0; i < (this->context->numProcs() - 1); ++i){
553  partResult[i] = (char*) resultV[i + 1].first;
554  rSize[i] = resultV[i + 1].second;
555  }
556 
557  // Finish applying reduces
558  result = finishReduces(partResult, rSize, funcId, op);
559 
560  delete [] partResult;
561  delete [] rSize;
562 
563  if (!this->cached)
564  this->discard();
565 
566  //std::cerr << "\n";
567  return result;
568  }
569 
570  template <typename T>
571  std::vector<T> fdd<T*>::finishPReduces(T ** partResult, size_t * partrSize, int funcId, fddOpType op){
572  T * result;
573  size_t rSize;
574 
575  if (op == OP_Reduce){
576  T * pResult;
577  size_t prSize;
578 
579  PreducePFunctionP<T> reduceFunc = ( PreducePFunctionP<T> ) this->context->funcTable[funcId];
580 
581  result = partResult[0];
582  rSize = partrSize[0];
583 
584  // Do the rest of the reduces
585  for (int i = 1; i < (this->context->numProcs() - 1); ++i){
586  pResult = result;
587  prSize = rSize;
588  std::pair<T*,size_t> r = reduceFunc(pResult, prSize, partResult[i], partrSize[i]);
589  result = r.first;
590  rSize = r.second;
591  }
592 
593  }else{
594  PbulkReducePFunctionP<T> bulkReduceFunc = (PbulkReducePFunctionP<T>) this->context->funcTable[funcId];
595  std::pair<T*,size_t> r = bulkReduceFunc(partResult, partrSize, this->context->numProcs() - 1);
596  result = r.first;
597  rSize = r.second;
598  }
599 
600  std::vector<T> vResult(rSize);
601  vResult.assign(result, result + rSize);
602 
603  return vResult;
604  }
605 
606  template <typename T>
607  std::vector <T> fdd<T*>::reduceP(void * funcP, fddOpType op){
608  //std::cerr << " Reduce";
609  //T fddCore<T>::template reduce( int funcId, fddOpType op){
610  // Decode function pointer
611  int funcId = this->context->findFunc(funcP);
612  T ** partResult = new T*[this->context->numProcs() -1];
613  size_t * partrSize = new size_t[this->context->numProcs() - 1];
614  unsigned long int tid, sid;
615  //std::cerr << " " << funcId << ".\n";
616 
617  // Send task
618  //unsigned long int reduceTaskId =
619  auto start = system_clock::now();
620  this->context->enqueueTask(op, this->id, 0, funcId, this->size);
621 
622  // Receive results
623  auto resultV = this->context->recvTaskResult(tid, sid, start);
624 
625  for (int i = 0; i < (this->context->numProcs() - 1); ++i){
626  partResult[i] = (T*) resultV[i + 1].first;
627  partrSize[i] = resultV[i + 1].second /= sizeof(T);
628  }
629 
630 
631  // Finish applying reduces
632  std::vector<T> vResult = finishPReduces(partResult, partrSize, funcId, op);
633 
634  delete [] partResult;
635  delete [] partrSize;
636 
637  if (!this->cached)
638  this->discard();
639 
640  return vResult;
641  }
642 
643 
644  template <typename T>
645  fdd<T>::fdd(fastContext &c, const char * fileName) {
646  fddCore<T>::context = &c;
647  this->id = c.readFDD(this, fileName);
648 
649  // Recover FDD information (size, ? etc )
650  this->context->getFDDInfo(this->size, this->dataAlloc);
651  }
652 
653 
654 }
655 
656 #endif
fdd< U > * bulkFlatMap(PbulkFlatMapFunctionP< T, U > funcP)
creates a fdd<U *>
Definition: fdd.h:244
fdd< U > * flatMap(PflatMapFunctionP< T, U > funcP)
creates a fdd<U *>
Definition: fdd.h:220
unsigned int fddOpType
Dataset operation type.
Definition: definitions.h:41
fdd(fastContext &c, T *data, size_t size)
Create a fdd from a array in memory.
Definition: fdd.h:106
indexedFdd< L, U > * map(IPmapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U*>
Definition: fdd.h:179
indexedFdd< L, U > * bulkFlatMap(IbulkFlatMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U>
Definition: fdd.h:250
void writeToFile(std::string &path, std::string &sufix)
Writes FDD content to file.
Definition: fdd.h:472
T bulkReduce(bulkReduceFunctionP< T > funcP)
summarizes a fdd<T> into a single value of type T using a bulk function T F(T,T)
Definition: fdd.h:271
~fdd()
Class Destructor. WARNING: It will deallocate ditributted memory.
Definition: fdd.h:130
void setKeyMap(void *keyMap UNUSED)
(UNUSED)
Definition: fdd.h:70
core class that implements simple operations.
Definition: fdd.h:26
indexedFdd< L, U > * bulkFlatMap(IPbulkFlatMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U*>
Definition: fdd.h:256
int getId()
Returns the identification number of the dataset.
Definition: fddBase.h:27
bool isGroupedByKey()
(UNUSED)
Definition: fdd.h:72
fdd(fastContext &c, std::vector< T > &dataV)
Create a fdd from a vector in memory.
Definition: fdd.h:112
void discard()
deallocates previusly cached fdd
Definition: fdd.h:54
std::vector< T > collect()
Brings the distributted data from a FDD to the driver memory.
Definition: fdd.h:136
void setGroupedByKey(bool gbk UNUSED)
(UNUSED)
Definition: fdd.h:74
fdd< U > * bulkFlatMap(bulkFlatMapFunctionP< T, U > funcP)
creates a fdd<U>
Definition: fdd.h:238
Framework context class.
Definition: fastContext.h:66
void assign(T *data, size_t size)
Assign a fdd content from a array.
Definition: fdd.h:123
T reduce(reduceFunctionP< T > funcP)
summarizes a fdd<T> into a single value of type T
Definition: fdd.h:265
fdd< U > * map(mapFunctionP< T, U > funcP)
creates a fdd<U>
Definition: fdd.h:164
indexedFdd< L, U > * flatMap(IPflatMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U*>
Definition: fdd.h:230
fdd(fastContext &c)
Create a empty fdd.
Definition: fdd.h:93
indexedFdd< L, U > * bulkMap(IbulkMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U>
Definition: fdd.h:198
fdd(fastContext &c, size_t s)
Create a empty fdd with a pre allocated size.
Definition: fdd.h:103
fdd(fastContext &c, size_t s, const std::vector< size_t > &dataAlloc)
Create a empty fdd with a pre allocated size.
Definition: fdd.h:98
void assign(std::vector< T > &data)
Assign a fdd content from a vector.
Definition: fdd.h:118
fdd< U > * bulkMap(bulkMapFunctionP< T, U > funcP)
creates a fdd<U>
Definition: fdd.h:186
Fast Distributted Dataset(FDD) is like a cluster distributted Array. This class is the user side impl...
Definition: fastContext.h:24
indexedFdd< L, U > * flatMap(IflatMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U>
Definition: fdd.h:225
libfaster main namespace
Definition: _workerFdd.h:11
fdd< U > * flatMap(flatMapFunctionP< T, U > funcP)
creates a fdd<U>
Definition: fdd.h:215
fdd< U > * map(PmapFunctionP< T, U > funcP)
creates a fdd<U *>
Definition: fdd.h:169
indexedFdd< L, U > * map(ImapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U>
Definition: fdd.h:174
fdd< U > * bulkMap(PbulkMapFunctionP< T, U > funcP)
creates a fdd<U *>
Definition: fdd.h:192
void * getKeyMap()
(UNUSED)
Definition: fdd.h:68
fdd< T > * cache()
Prevents automatic memory deallocation from hapenning.
Definition: fdd.h:150
indexedFdd< L, U > * bulkMap(IPbulkMapFunctionP< T, L, U > funcP)
creates a indexedFdd<L,U*>
Definition: fdd.h:204