Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

schedAction.h 1.66 KB
Newer Older
1 2
#ifndef SCHEDACTION_H
#define SCHEDACTION_H
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
3

4 5 6
#include <fstream>
#include <vector>
#include "instance.h"
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
7

8 9
#define SCHEDACTION_NONE -5

10 11 12
class SchedAction {
public: 
  virtual void onSchedule(int task, int worker, double startTime, double endTime) { }
13
  virtual int chooseTask(int wType, double now) {return SCHEDACTION_NONE; }
14 15 16 17 18 19 20 21 22
  virtual void onTaskPush(int task) { }
};


class ActionSequence : public SchedAction {
  std::vector<SchedAction*> actions;
 public: 
  ActionSequence() {}
  void add(SchedAction *a); 
EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
23
  void remove(SchedAction* a); 
24 25
  void onSchedule(int i, int w, double s, double f); 
  void onTaskPush(int t); 
26
  int chooseTask(int wType, double now); 
27 28 29
};

class ExportToFile : public SchedAction {
30
  std::ofstream output;
31
  Instance* instance; 
32
  std::string name; 
33
public: 
34
  ExportToFile(std::string filename, Instance* ins, bool header = false, std::string name =""); 
35
  void onSchedule(int i, int w, double s, double f); 
36
  void changeName(std::string newName); 
37 38 39
  ~ExportToFile(); 
};

EYRAUD-DUBOIS Lionel's avatar
EYRAUD-DUBOIS Lionel committed
40 41 42 43 44 45 46 47 48 49 50 51
class UtilAnalysis : public SchedAction {
  Instance* ins; 
  std::vector<std::vector<int> > repartition; 
  std::ofstream output; 
 public: 
  UtilAnalysis(Instance* _ins, std::string saveFile);
  ~UtilAnalysis();
  void onSchedule(int i, int w, double s, double f); 
  std::vector<std::vector<int> > getRepartition(); 
  void reset();
  void write(std::string prefix); 
};
52

53 54 55 56 57 58 59 60 61 62 63 64
class InternalShare : public SchedAction {
  std::string shareName; 
  Instance* instance; 
  std::vector<double> allocation; 
  std::vector<double> startTimes; 
  
 public: 
  InternalShare(std::string shareName, Instance* ins); 
  void onSchedule(int i, int w, double s, double f); 
  void finish(); 
};

65 66

#endif