libfaster API Documentation  Development Version
Super fast distributted computing
fastScheduler.h
1 #ifndef LIBFASTER_FASTSCHEDULER_H
2 #define LIBFASTER_FASTSCHEDULER_H
3 
4 #include <vector>
5 #include <tuple>
6 #include <unordered_map>
7 #include <memory>
8 
9 #include "definitions.h"
10 #include "misc.h"
11 
12 namespace faster{
13  class fastTask;
14 
16  private:
17  unsigned int numProcs;
18  unsigned long int numTasks;
19  std::vector<fastTask *> taskList;
20  std::vector<double> currentWeights;
21  std::vector<std::string> * funcName;
22  bool _dataMigrationNeeded;
23 
24  size_t infoPos;
25 
26  void updateWeights();
27  std::shared_ptr<std::vector<double>> getNewAllocation();
28  void resetProcessWeights();
29  public:
30  fastScheduler(unsigned int numProcs, std::vector<std::string> * funcName);
31  ~fastScheduler();
32 
33  fastTask * enqueueTask(fddOpType opT, unsigned long int idSrc, unsigned long int idRes, int funcId, size_t size, std::vector< std::tuple<void*, size_t, int> > & globalTable);
34  fastTask * enqueueTask(fddOpType opT, unsigned long int id, size_t size, std::vector< std::tuple<void*, size_t, int> > & globalTable);
35 
36  void taskProgress(unsigned long int id, unsigned long int pid, size_t time, procstat & stat);
37  void taskFinished(unsigned long int id, size_t time);
38 
39  void setCalibration(std::vector<size_t> time);
40 
41  void printProcstats(fastTask * task);
42  void printTaskInfo();
43  void printTaskInfo(size_t task);
44  void printHeader();
45  void updateTaskInfo();
46 
47  bool dataMigrationNeeded();
48  std::vector<std::deque< std::pair<int,long int> >> getDataMigrationInfo();
49  std::vector<size_t> getAllocation(size_t size);
50  void setAllocation(std::vector<size_t> & alloc, size_t size);
51 
52  };
53 
54 }
55 
56 #endif
unsigned int fddOpType
Dataset operation type.
Definition: definitions.h:41
libfaster main namespace
Definition: _workerFdd.h:11