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