WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
StandardJob.h
1 
11 #ifndef WRENCH_STANDARDJOB_H
12 #define WRENCH_STANDARDJOB_H
13 
14 
15 #include <map>
16 #include <set>
17 #include <vector>
18 
19 #include "WorkflowJob.h"
20 
21 #include "wrench/services/storage/storage_helpers/FileLocation.h"
22 
23 namespace wrench {
24 
25  /***********************/
27  /***********************/
28 
29  class WorkflowFile;
30 
31  class WorkflowTask;
32 
37  class StandardJob : public WorkflowJob {
38 
39  public:
41  enum State {
43  NOT_SUBMITTED,
45  PENDING,
47  RUNNING,
49  COMPLETED,
51  FAILED,
53  TERMINATED
54  };
55 
56  std::vector<WorkflowTask *> getTasks();
57 
58  unsigned long getMinimumRequiredNumCores();
59 
60  unsigned long getMinimumRequiredMemory();
61 
62  unsigned long getNumCompletedTasks();
63 
64  unsigned long getNumTasks();
65 
66  StandardJob::State getState();
67 
68  std::map<WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> getFileLocations();
69 
70  unsigned long getPriority();
71 
72 
74  std::vector<WorkflowTask *> tasks;
75 
77  double total_flops;
79  unsigned long num_completed_tasks;
80 
82  std::map<WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> file_locations;
83 
85  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> pre_file_copies;
87  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> post_file_copies;
89  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> cleanup_file_deletions;
90 
91  /***********************/
93  /***********************/
94 
95  /***********************/
97  /***********************/
98 
99  double getPreJobOverheadInSeconds();
100  void setPreJobOverheadInSeconds(double overhead);
101  double getPostJobOverheadInSeconds();
102  void setPostJobOverheadInSeconds(double overhead);
103 
104 
105  private:
106 
107  friend class StandardJobExecutor;
108  friend class BareMetalComputeService;
109  void incrementNumCompletedTasks();
110 
111  friend class JobManager;
112 
113  StandardJob(Workflow *workflow,
114  std::vector<WorkflowTask *> tasks, std::map<WorkflowFile *, std::vector<std::shared_ptr<FileLocation>>> &file_locations,
115  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation>>> &pre_file_copies,
116  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation>>> &post_file_copies,
117  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> &cleanup_file_deletions);
118 
119  State state;
120  double pre_overhead = 0.0;
121  double post_overhead = 0.0;
122 
123  };
124 
125  /***********************/
127  /***********************/
128 
129 };
130 
131 #endif //WRENCH_MULTITASKJOB_H
wrench
Definition: Alarm.cpp:20