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 {
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 
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 
100  void setPreJobOverheadInSeconds(double overhead);
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 
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::StandardJob::tasks
std::vector< WorkflowTask * > tasks
The job's computational tasks.
Definition: StandardJob.h:74
wrench::StandardJob::cleanup_file_deletions
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:89
wrench::StandardJob::pre_file_copies
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:85
wrench::StandardJob::getMinimumRequiredMemory
unsigned long getMinimumRequiredMemory()
Returns the minimum RAM capacity required to run the job (i.e., at least one task in the job cannot r...
Definition: StandardJob.cpp:93
wrench::StandardJob::NOT_SUBMITTED
@ NOT_SUBMITTED
Not submitted yet.
Definition: StandardJob.h:43
wrench::StandardJob::getNumCompletedTasks
unsigned long getNumCompletedTasks()
Get the number of completed tasks in the job.
Definition: StandardJob.cpp:123
wrench::StandardJob::num_completed_tasks
unsigned long num_completed_tasks
The number of computational tasks that have completed.
Definition: StandardJob.h:79
wrench::JobManager
A helper daemon (co-located with and explicitly started by a WMS), which is used to handle all job ex...
Definition: JobManager.h:48
wrench::StandardJob::file_locations
std::map< WorkflowFile *, std::vector< std::shared_ptr< FileLocation > > > file_locations
The file locations that tasks should read/write files from/to. Each file is given a list of locations...
Definition: StandardJob.h:82
wrench::StandardJob::TERMINATED
@ TERMINATED
Terminated by submitter.
Definition: StandardJob.h:53
wrench::StandardJob::setPostJobOverheadInSeconds
void setPostJobOverheadInSeconds(double overhead)
sets the job's post-overhead
Definition: StandardJob.cpp:196
wrench::StandardJob::COMPLETED
@ COMPLETED
Completed successfully.
Definition: StandardJob.h:49
wrench::StandardJob::getMinimumRequiredNumCores
unsigned long getMinimumRequiredNumCores()
Returns the minimum number of cores required to run the job (i.e., at least one task in the job canno...
Definition: StandardJob.cpp:80
wrench::StandardJob::getNumTasks
unsigned long getNumTasks()
Get the number of tasks in the job.
Definition: StandardJob.cpp:107
wrench::StandardJob::getPriority
unsigned long getPriority()
Get the workflow priority value (the maximum priority from all tasks)
Definition: StandardJob.cpp:150
wrench::StandardJob
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
wrench::BareMetalComputeService
A compute service that manages a set of multi-core compute hosts and provides access to their resourc...
Definition: BareMetalComputeService.h:48
wrench::StandardJob::post_file_copies
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:87
wrench
Definition: Alarm.cpp:20
wrench::StandardJob::FAILED
@ FAILED
Failed.
Definition: StandardJob.h:51
wrench::Workflow
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
wrench::StandardJob::setPreJobOverheadInSeconds
void setPreJobOverheadInSeconds(double overhead)
sets the job's pre-overhead
Definition: StandardJob.cpp:188
wrench::StandardJob::getPostJobOverheadInSeconds
double getPostJobOverheadInSeconds()
get the job's post-overhead
Definition: StandardJob.cpp:180
wrench::StandardJobExecutor
A service that knows how to execute a standard job on a multi-node multi-core platform....
Definition: StandardJobExecutor.h:45
wrench::StandardJob::RUNNING
@ RUNNING
Running.
Definition: StandardJob.h:47
wrench::StandardJob::getTasks
std::vector< WorkflowTask * > getTasks()
Get the workflow tasks in the job.
Definition: StandardJob.cpp:132
wrench::WorkflowJob::workflow
Workflow * workflow
The workflow this job belong to.
Definition: WorkflowJob.h:92
wrench::WorkflowJob
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
wrench::StandardJob::getFileLocations
std::map< WorkflowFile *, std::vector< std::shared_ptr< FileLocation > > > getFileLocations()
Get the file location map for the job.
Definition: StandardJob.cpp:141
wrench::StandardJob::total_flops
double total_flops
The job's total computational cost (in flops)
Definition: StandardJob.h:77
wrench::StandardJob::getState
StandardJob::State getState()
Get the state of the standard job.
Definition: StandardJob.cpp:164
wrench::StandardJob::getPreJobOverheadInSeconds
double getPreJobOverheadInSeconds()
get the job's pre-overhead
Definition: StandardJob.cpp:172
wrench::StandardJob::State
State
Standad job states.
Definition: StandardJob.h:41
wrench::StandardJob::PENDING
@ PENDING
Submitted but not running yet.
Definition: StandardJob.h:45
wrench::WorkflowFile
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26