11 #ifndef WRENCH_STANDARDJOB_H
12 #define WRENCH_STANDARDJOB_H
18 #include <wrench/workflow/Workflow.h>
19 #include <wrench/workflow/WorkflowTask.h>
20 #include <wrench/data_file/DataFile.h>
24 #include "wrench/services/storage/storage_helpers/FileLocation.h"
40 class StandardJob :
public Job,
public std::enable_shared_from_this<StandardJob> {
60 std::vector<std::shared_ptr<WorkflowTask>>
getTasks();
74 std::map<std::shared_ptr<DataFile>, std::vector<std::shared_ptr<FileLocation>>>
getFileLocations();
78 std::vector<std::shared_ptr<WorkflowTask>>
tasks;
84 std::map<std::shared_ptr<DataFile>, std::vector<std::shared_ptr<FileLocation>>>
file_locations;
87 std::vector<std::tuple<std::shared_ptr<DataFile>, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >>
pre_file_copies;
89 std::vector<std::tuple<std::shared_ptr<DataFile>, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation> >>
post_file_copies;
97 std::shared_ptr<StandardJob>
getSharedPtr() {
return this->shared_from_this(); }
120 std::vector<std::shared_ptr<WorkflowTask>>
tasks, std::map<std::shared_ptr<DataFile>, std::vector<std::shared_ptr<FileLocation>>> &
file_locations,
121 std::vector<std::tuple<std::shared_ptr<DataFile>, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation>>> &
pre_file_copies,
122 std::vector<std::tuple<std::shared_ptr<DataFile>, std::shared_ptr<FileLocation> , std::shared_ptr<FileLocation>>> &
post_file_copies,
123 std::vector<std::tuple<std::shared_ptr<DataFile>, std::shared_ptr<FileLocation> >> &
cleanup_file_deletions);
125 void createUnderlyingCompoundJob(
const std::shared_ptr<ComputeService>& compute_service);
126 void processCompoundJobOutcome(std::map<std::shared_ptr<WorkflowTask>,
WorkflowTask::State> &state_changes,
127 std::set<std::shared_ptr<WorkflowTask>> &failure_count_increments,
128 std::shared_ptr<FailureCause> &job_failure_cause,
130 void applyTaskUpdates(std::map<std::shared_ptr<WorkflowTask>,
WorkflowTask::State> &state_changes,
131 std::set<std::shared_ptr<WorkflowTask>> &failure_count_increments);
133 void analyzeActions(std::vector<std::shared_ptr<Action>> actions,
134 bool *at_least_one_failed,
135 bool *at_least_one_killed,
136 std::shared_ptr<FailureCause> *failure_cause,
137 double *earliest_start_date,
138 double *latest_end_date,
139 double *earliest_failure_date);
143 double pre_overhead = 0.0;
144 double post_overhead = 0.0;
146 std::shared_ptr<CompoundJob> compound_job;
147 std::shared_ptr<Action> pre_overhead_action =
nullptr;
148 std::shared_ptr<Action> post_overhead_action =
nullptr;
149 std::vector<std::shared_ptr<Action>> pre_file_copy_actions;
150 std::map<std::shared_ptr<WorkflowTask>, std::vector<std::shared_ptr<Action>>> task_file_read_actions;
151 std::map<std::shared_ptr<WorkflowTask>, std::shared_ptr<Action>> task_compute_actions;
152 std::map<std::shared_ptr<WorkflowTask>, std::vector<std::shared_ptr<Action>>> task_file_write_actions;
153 std::vector<std::shared_ptr<Action>> post_file_copy_actions;
154 std::vector<std::shared_ptr<Action>> cleanup_actions;
155 std::shared_ptr<Action> scratch_cleanup =
nullptr;
164 #endif //WRENCH_MULTITASKJOB_H
std::map< std::shared_ptr< DataFile >, std::vector< std::shared_ptr< FileLocation > > > getFileLocations()
Get the file location map for the job.
Definition: StandardJob.cpp:143
State
Task states.
Definition: WorkflowTask.h:72
Abstraction of a job used for executing tasks in a Workflow.
Definition: Job.h:34
@ NOT_SUBMITTED
Not submitted yet.
Definition: StandardJob.h:47
unsigned long getNumTasks() const
Get the number of tasks in the job.
Definition: StandardJob.cpp:110
unsigned long getMinimumRequiredNumCores() const
Returns the minimum number of cores required to run the job (i.e., at least one task in the job canno...
Definition: StandardJob.cpp:83
A helper daemon (co-located with and explicitly started by an execution controller),...
Definition: JobManager.h:56
bool usesScratch()
Determines whether the job's spec uses scratch space.
Definition: StandardJob.cpp:851
@ TERMINATED
Terminated by submitter.
Definition: StandardJob.h:57
void setPostJobOverheadInSeconds(double overhead)
sets the job's post-overhead
Definition: StandardJob.cpp:183
std::vector< std::tuple< std::shared_ptr< DataFile >, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > post_file_copies
The ordered file copy operations to perform after computational tasks.
Definition: StandardJob.h:89
@ COMPLETED
Completed successfully.
Definition: StandardJob.h:53
std::map< std::shared_ptr< DataFile >, 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:84
A standard (i.e., non-pilot) workflow job that can be submitted to a ComputeService by a WMS (via a J...
Definition: StandardJob.h:40
std::vector< std::shared_ptr< WorkflowTask > > getTasks()
Get the workflow tasks in the job.
Definition: StandardJob.cpp:134
Definition: Action.cpp:28
@ FAILED
Failed.
Definition: StandardJob.h:55
void setPreJobOverheadInSeconds(double overhead)
sets the job's pre-overhead
Definition: StandardJob.cpp:175
std::shared_ptr< JobManager > job_manager
The Job Manager in charge of this job.
Definition: Job.h:86
A class to represent the various execution events that are relevant to the execution of a workflow.
Definition: ExecutionEvent.h:26
std::vector< std::tuple< std::shared_ptr< DataFile >, std::shared_ptr< FileLocation > > > cleanup_file_deletions
The ordered file deletion operations to perform at the end.
Definition: StandardJob.h:91
double getPostJobOverheadInSeconds()
get the job's post-overhead
Definition: StandardJob.cpp:167
@ RUNNING
Running.
Definition: StandardJob.h:51
unsigned long getNumCompletedTasks() const
Get the number of completed tasks in the job.
Definition: StandardJob.cpp:119
std::shared_ptr< StandardJob > getSharedPtr()
Get the shared pointer for this object.
Definition: StandardJob.h:97
double total_flops
The job's total computational cost (in flops)
Definition: StandardJob.h:81
std::vector< std::tuple< std::shared_ptr< DataFile >, std::shared_ptr< FileLocation >, std::shared_ptr< FileLocation > > > pre_file_copies
The ordered file copy operations to perform before computational tasks.
Definition: StandardJob.h:87
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:48
StandardJob::State getState()
Get the state of the standard job.
Definition: StandardJob.cpp:151
double getPreJobOverheadInSeconds()
get the job's pre-overhead
Definition: StandardJob.cpp:159
State
Standard job states.
Definition: StandardJob.h:45
@ PENDING
Submitted but not running yet.
Definition: StandardJob.h:49
std::vector< std::shared_ptr< WorkflowTask > > tasks
The job's computational tasks.
Definition: StandardJob.h:78
unsigned long getMinimumRequiredMemory() const
Returns the minimum RAM capacity required to run the job (i.e., at least one task in the job cannot r...
Definition: StandardJob.cpp:96