StandardJob.h
1 
11 #ifndef WRENCH_MULTITASKJOB_H
12 #define WRENCH_MULTITASKJOB_H
13 
14 
15 #include <map>
16 #include <set>
17 #include <vector>
18 
19 #include "WorkflowJob.h"
20 
21 #include "wrench/services/storage/StorageService.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 {
54  };
55 
56  std::vector<WorkflowTask *> getTasks();
57 
58  unsigned long getMinimumRequiredNumCores();
59 
60  unsigned long getNumCompletedTasks();
61 
62  unsigned long getNumTasks();
63 
65 
66  std::map<WorkflowFile *, std::shared_ptr<FileLocation>> getFileLocations();
67 
68  unsigned long getPriority();
69 
71  std::vector<WorkflowTask *> tasks;
72 
74  double total_flops;
76  unsigned long num_completed_tasks;
77 
79  std::map<WorkflowFile *, std::shared_ptr<FileLocation>> file_locations;
80 
82  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> pre_file_copies;
84  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> post_file_copies;
86  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> 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 *, std::shared_ptr<FileLocation> > &file_locations,
99  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> &pre_file_copies,
100  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >> &post_file_copies,
101  std::vector<std::tuple<WorkflowFile *, std::shared_ptr<FileLocation> >> &cleanup_file_deletions);
102 
103  State state;
104 
105  };
106 
107  /***********************/
109  /***********************/
110 
111 };
112 
113 #endif //WRENCH_MULTITASKJOB_H
std::vector< WorkflowTask * > tasks
The job's computational tasks.
Definition: StandardJob.h:71
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation > > > cleanup_file_deletions
The ordered file deletion operations to perform at the end.
Definition: StandardJob.h:86
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > pre_file_copies
The ordered file copy operations to perform before computational tasks.
Definition: StandardJob.h:82
@ NOT_SUBMITTED
Not submitted yet.
Definition: StandardJob.h:43
unsigned long getNumCompletedTasks()
Get the number of completed tasks in the job.
Definition: StandardJob.cpp:111
unsigned long num_completed_tasks
The number of computational tasks that have completed.
Definition: StandardJob.h:76
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:40
@ TERMINATED
Terminated by submitter.
Definition: StandardJob.h:53
@ COMPLETED
Completed successfully.
Definition: StandardJob.h:49
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 getNumTasks()
Get the number of tasks in the job.
Definition: StandardJob.cpp:95
unsigned long getPriority()
Get the workflow priority value (the maximum priority from all tasks)
Definition: StandardJob.cpp:138
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:37
A compute service that manages a set of multi-core compute hosts and provides access to their resourc...
Definition: BareMetalComputeService.h:48
std::vector< std::tuple< WorkflowFile *, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > post_file_copies
The ordered file copy operations to perform after computational tasks.
Definition: StandardJob.h:84
Definition: Alarm.cpp:20
@ FAILED
Failed.
Definition: StandardJob.h:51
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
std::map< WorkflowFile *, std::shared_ptr< FileLocation > > getFileLocations()
Get the file location map for the job.
Definition: StandardJob.cpp:129
std::map< WorkflowFile *, std::shared_ptr< FileLocation > > file_locations
The file locations that tasks should read/write files from/to.
Definition: StandardJob.h:79
@ RUNNING
Running.
Definition: StandardJob.h:47
std::vector< WorkflowTask * > getTasks()
Get the workflow tasks in the job.
Definition: StandardJob.cpp:120
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
double total_flops
The job's total computational cost (in flops)
Definition: StandardJob.h:74
StandardJob::State getState()
Get the state of the standard job.
Definition: StandardJob.cpp:152
State
Standad job states.
Definition: StandardJob.h:41
@ PENDING
Submitted but not running yet.
Definition: StandardJob.h:45
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26