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 #include "wrench/services/storage/StorageService.h"
23 
24 namespace wrench {
25 
26  /***********************/
28  /***********************/
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 *, std::shared_ptr<FileLocation>> getFileLocations();
68 
69  unsigned long getPriority();
70 
72  std::vector<WorkflowTask *> tasks;
74  double total_flops;
76  unsigned long num_completed_tasks;
78  std::map<WorkflowFile *, std::shared_ptr<FileLocation>> file_locations;
80  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> pre_file_copies;
81 
83  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> post_file_copies;
85  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> cleanup_file_deletions;
86 
87  private:
88 
89  friend class StandardJobExecutor;
90  friend class BareMetalComputeService;
91 
92  void incrementNumCompletedTasks();
93 
94  friend class JobManager;
95 
97  std::vector<WorkflowTask *> tasks, std::map<WorkflowFile *, std::shared_ptr<FileLocation> > &file_locations,
98  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> &pre_file_copies,
99  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> &post_file_copies,
100  std::set<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> &cleanup_file_deletions);
101 
102  State state;
103 
104  };
105 
106  /***********************/
108  /***********************/
109 
110 };
111 
112 #endif //WRENCH_MULTITASKJOB_H
StandardJob::State getState()
Get the state of the standard job.
Definition: StandardJob.cpp:152
unsigned long getNumCompletedTasks()
Get the number of completed tasks in the job.
Definition: StandardJob.cpp:111
Submitted but not running yet.
Definition: StandardJob.h:46
State
Standad job states.
Definition: StandardJob.h:42
std::set< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation > > > cleanup_file_deletions
The file deletion operations to perform at the end.
Definition: StandardJob.h:85
A service that knows how to execute a standard job on a multi-node multi-core platform. Note that when killed in the middle of computing, this service will set (internal) running tasks&#39; states to FAILED, and likely the calling service will want to make failed tasks READY and NOT_READY again to "unwind" the failed executions and resubmit tasks for execution. Also, this service does not increment task failure counts, as it does not know if the kill() was an actual failure (i.e., some timeout) or a feature (i.e., a WMS changing its mind)
Definition: StandardJobExecutor.h:45
std::map< WorkflowFile *, std::shared_ptr< FileLocation > > getFileLocations()
Get the file location map for the job.
Definition: StandardJob.cpp:129
std::set< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > post_file_copies
The file copy operations to perform after computational tasks.
Definition: StandardJob.h:83
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
std::vector< WorkflowTask * > getTasks()
Get the workflow tasks in the job.
Definition: StandardJob.cpp:120
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
A workflow (to be executed by a WMS)
Definition: Workflow.h:30
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:90
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:95
Terminated by submitter.
Definition: StandardJob.h:54
std::set< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > pre_file_copies
The file copy operations to perform before computational tasks.
Definition: StandardJob.h:80
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:80
unsigned long getPriority()
Get the workflow priority value (the maximum priority from all tasks)
Definition: StandardJob.cpp:138
Failed.
Definition: StandardJob.h:52
Completed successfully.
Definition: StandardJob.h:50
std::map< WorkflowFile *, std::shared_ptr< FileLocation > > file_locations
The file locations that tasks should read/write files from/to.
Definition: StandardJob.h:78
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
Running.
Definition: StandardJob.h:48
double total_flops
The job&#39;s total computational cost (in flops)
Definition: StandardJob.h:74
A compute service that manages a set of multi-core compute hosts and provides access to their resourc...
Definition: BareMetalComputeService.h:48
std::vector< WorkflowTask * > tasks
The job&#39;s computational tasks.
Definition: StandardJob.h:72
unsigned long num_completed_tasks
The number of computational tasks that have completed.
Definition: StandardJob.h:76
Definition: Alarm.cpp:19