StandardJob.h
1 
11 #ifndef WRENCH_MULTITASKJOB_H
12 #define WRENCH_MULTITASKJOB_H
13 
14 
15 #include <vector>
16 #include <map>
17 #include <set>
18 #include <vector>
19 
20 #include "WorkflowJob.h"
21 
22 namespace wrench {
23 
24  /***********************/
26  /***********************/
27 
28  class StorageService;
29 
30  class WorkflowFile;
31 
32  class WorkflowTask;
33 
38  class StandardJob : public WorkflowJob {
39 
40  public:
42  enum State {
55  };
56 
57  std::vector<WorkflowTask *> getTasks();
58 
59  unsigned long getMinimumRequiredNumCores();
60 
61  unsigned long getNumCompletedTasks();
62 
63  unsigned long getNumTasks();
64 
66 
67  std::map<WorkflowFile *, StorageService *> getFileLocations();
68 
69  // Tasks to run
70 
71 
73  std::vector<WorkflowTask *> tasks;
75  double total_flops;
77  unsigned long num_completed_tasks;
79  std::map<WorkflowFile *, StorageService *> file_locations;
81  std::set<std::tuple<WorkflowFile *, StorageService *, StorageService *>> pre_file_copies;
82 
84  std::set<std::tuple<WorkflowFile *, StorageService *, StorageService *>> post_file_copies;
86  std::set<std::tuple<WorkflowFile *, StorageService *>> cleanup_file_deletions;
87 
88  private:
89 
90  friend class StandardJobExecutor;
91  friend class BareMetalComputeService;
92 
93  void incrementNumCompletedTasks();
94 
95  friend class JobManager;
96 
97  StandardJob(Workflow *workflow,
98  std::vector<WorkflowTask *> tasks, std::map<WorkflowFile *, StorageService *> &file_locations,
99  std::set<std::tuple<WorkflowFile *, StorageService *, StorageService *>> &pre_file_copies,
100  std::set<std::tuple<WorkflowFile *, StorageService *, StorageService *>> &post_file_copies,
101  std::set<std::tuple<WorkflowFile *, StorageService *>> &cleanup_file_deletions);
102 
103  State state;
104 
105  };
106 
107  /***********************/
109  /***********************/
110 
111 };
112 
113 #endif //WRENCH_MULTITASKJOB_H
std::set< std::tuple< WorkflowFile *, StorageService *, StorageService * > > pre_file_copies
The file copy operations to perform before computational tasks.
Definition: StandardJob.h:81
StandardJob::State getState()
Get the state of the standard job.
Definition: StandardJob.cpp:138
unsigned long getNumCompletedTasks()
Get the number of completed tasks in the job.
Definition: StandardJob.cpp:112
Submitted but not running yet.
Definition: StandardJob.h:46
State
Standad job states.
Definition: StandardJob.h:42
std::set< std::tuple< WorkflowFile *, StorageService *, StorageService * > > post_file_copies
The file copy operations to perform after computational tasks.
Definition: StandardJob.h:84
std::map< WorkflowFile *, StorageService * > getFileLocations()
Get the file location map for the job.
Definition: StandardJob.cpp:130
std::map< WorkflowFile *, StorageService * > file_locations
The file locations that tasks should read/write files from/to.
Definition: StandardJob.h:79
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:31
std::vector< WorkflowTask * > getTasks()
Get the workflow tasks in the job.
Definition: StandardJob.cpp:121
A workflow (to be executed by a WMS)
Definition: Workflow.h:30
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:38
unsigned long getNumTasks()
Get the number of tasks in the job.
Definition: StandardJob.cpp:96
Terminated by submitter.
Definition: StandardJob.h:54
unsigned long getMinimumRequiredNumCores()
Returns the minimum number of cores required, over all tasks in the job (i.e., at least one task in t...
Definition: StandardJob.cpp:81
Failed.
Definition: StandardJob.h:52
Completed successfully.
Definition: StandardJob.h:50
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:40
Not submitted yet.
Definition: StandardJob.h:44
std::set< std::tuple< WorkflowFile *, StorageService * > > cleanup_file_deletions
The file deletion operations to perform at the end.
Definition: StandardJob.h:86
Running.
Definition: StandardJob.h:48
double total_flops
The job&#39;s total computational cost (in flops)
Definition: StandardJob.h:75
A compute service that manages a set of multi-core compute hosts and provides access to their resourc...
Definition: BareMetalComputeService.h:44
std::vector< WorkflowTask * > tasks
The job&#39;s computational tasks.
Definition: StandardJob.h:73
unsigned long num_completed_tasks
The number of computational tasks that have completed.
Definition: StandardJob.h:77
Definition: TerminalOutput.cpp:15