10 #ifndef WRENCH_WORKFLOWTASK_H
11 #define WRENCH_WORKFLOWTASK_H
17 #include "wrench/workflow/job/WorkflowJob.h"
18 #include "wrench/workflow/WorkflowFile.h"
20 #include <boost/graph/adjacency_list.hpp>
30 std::string
getID()
const;
48 std::vector<WorkflowTask *>
getParents()
const;
129 struct WorkflowTaskExecution;
248 std::string cluster_id;
251 double average_cpu = -1;
252 unsigned long bytes_read = -1;
253 unsigned long bytes_written = -1;
254 unsigned long min_num_cores;
255 unsigned long max_num_cores;
256 double parallel_efficiency;
257 double memory_requirement;
258 unsigned long priority = 0;
259 unsigned long toplevel;
260 unsigned int failure_count = 0;
261 std::string execution_host;
263 State upcoming_visible_state;
268 std::map<std::string, WorkflowFile *> output_files;
269 std::map<std::string, WorkflowFile *> input_files;
274 unsigned long min_num_cores,
275 unsigned long max_num_cores,
276 double parallel_efficiency,
277 double memory_requirement);
282 std::stack<WorkflowTaskExecution> execution_history;
288 #endif //WRENCH_WORKFLOWTASK_H
@ PENDING
Pending (has been submitted to a compute service)
Definition: WorkflowTask.h:68
void setUpcomingState(WorkflowTask::State)
Set the upcoming visible state of the task.
Definition: WorkflowTask.cpp:346
@ READY
Ready (parents have completed)
Definition: WorkflowTask.h:66
double getComputationEndDate()
Get the task's most recent computation end date.
Definition: WorkflowTask.cpp:668
An internal class that uses the Boost Graph Library to implement a DAG of WorkflowTask objects.
Definition: DagOfTasks.h:40
std::string execution_host
Task's execution host.
Definition: WorkflowTask.h:227
void incrementFailureCount()
Increment the failure count of a task.
Definition: WorkflowTask.cpp:610
double write_output_end
Task's write output end time.
Definition: WorkflowTask.h:218
@ UNKNOWN
Some Unknown state (should not happen)
Definition: WorkflowTask.h:72
WorkflowTask::State getState() const
Get the state of the task.
Definition: WorkflowTask.cpp:205
std::string getID() const
Get the id of the task.
Definition: WorkflowTask.cpp:115
State
Task states.
Definition: WorkflowTask.h:62
unsigned long updateTopLevel()
Update the task's top level (looking only at the parents, and updating children)
Definition: WorkflowTask.cpp:724
void setComputationEndDate(double date)
Set the date when the computation portion of a WorkflowTask has ended.
Definition: WorkflowTask.cpp:492
double getAverageCPU() const
Get the task average CPU usage.
Definition: WorkflowTask.cpp:404
void setClusterID(std::string)
Set the cluster id for the task.
Definition: WorkflowTask.cpp:380
void setExecutionHost(std::string hostname)
Sets the host on which this task is running.
Definition: WorkflowTask.cpp:772
double read_input_end
Task's read input end time.
Definition: WorkflowTask.h:210
std::vector< WorkflowTask * > getChildren() const
Get the children of a task.
Definition: WorkflowTask.cpp:178
WorkflowTask::InternalState getInternalState() const
Get the state of the task (as known to the "internal" layer)
Definition: WorkflowTask.cpp:223
void setTerminationDate(double date)
Set the date when the task was terminated.
Definition: WorkflowTask.cpp:580
std::vector< WorkflowFile * > getOutputFiles()
Get the list of output WorkflowFile objects for the task.
Definition: WorkflowTask.cpp:631
void addInputFile(WorkflowFile *file)
Add an input file to the task.
Definition: WorkflowTask.cpp:55
void setNumCoresAllocated(unsigned long num_cores)
Sets the number of cores allocated for this task.
Definition: WorkflowTask.cpp:785
double write_output_start
Task's write output start time.
Definition: WorkflowTask.h:216
void setComputationStartDate(double date)
Set the date when the computation portion of a WorkflowTask has begun.
Definition: WorkflowTask.cpp:477
unsigned long getMaxNumCores() const
Get the maximum number of cores that the task can use.
Definition: WorkflowTask.cpp:142
double task_end
Task's end time.
Definition: WorkflowTask.h:220
unsigned long getNumberOfChildren() const
Get the number of children of a task.
Definition: WorkflowTask.cpp:169
std::string getColor()
Get the task's color ("" if none)
Definition: WorkflowTask.cpp:798
double read_input_start
Task's read input start time.
Definition: WorkflowTask.h:208
void setBytesWritten(unsigned long)
Set the number of bytes written by the task.
Definition: WorkflowTask.cpp:444
void setReadInputEndDate(double date)
Set the date when the read input portion of a WorkflowTask has completed.
Definition: WorkflowTask.cpp:522
double getParallelEfficiency() const
Get the parallel efficiency of the task.
Definition: WorkflowTask.cpp:151
void setFailureDate(double date)
Set the date when the task has failed.
Definition: WorkflowTask.cpp:566
double getWriteOutputStartDate()
Get the task's most recent write output start date.
Definition: WorkflowTask.cpp:692
double getStartDate()
Get the task's most recent start date.
Definition: WorkflowTask.cpp:644
A workflow (to be executed by a WMS)
Definition: Workflow.h:33
@ COMPLETED
Completed (successfully completed)
Definition: WorkflowTask.h:70
static std::string stateToString(WorkflowTask::State state)
Convert task state to a string (useful for output, debugging, logging, etc.)
Definition: WorkflowTask.cpp:232
double getTerminationDate()
Get the tasks's most recent termination date (when it was explicitly requested to be terminated by th...
Definition: WorkflowTask.cpp:716
void setPriority(long)
Set the task priority.
Definition: WorkflowTask.cpp:396
unsigned long num_cores_allocated
Task's number of allocated cores.
Definition: WorkflowTask.h:229
unsigned long getMinNumCores() const
Get the minimum number of cores required for running the task.
Definition: WorkflowTask.cpp:133
unsigned long getBytesWritten() const
Get the number of bytes written by the task.
Definition: WorkflowTask.cpp:436
double task_failed
Task's failed time.
Definition: WorkflowTask.h:222
unsigned long getNumCoresAllocated()
Returns the number of cores allocated for this task's most recent execution or 0 if an execution atte...
Definition: WorkflowTask.cpp:764
Workflow * getWorkflow() const
Get the workflow that contains the task.
Definition: WorkflowTask.cpp:277
void setState(WorkflowTask::State)
Set the visible state of the task.
Definition: WorkflowTask.cpp:296
double computation_end
Task's computation end time.
Definition: WorkflowTask.h:214
double getWriteOutputEndDate()
Get the task's most recent write output end date.
Definition: WorkflowTask.cpp:700
A computational task in a Workflow.
Definition: WorkflowTask.h:27
double getEndDate()
Get the task's most recent end date.
Definition: WorkflowTask.cpp:652
double computation_start
Task's computation start time.
Definition: WorkflowTask.h:212
unsigned int getFailureCount()
Get the number of times a task has failed.
Definition: WorkflowTask.cpp:603
double getMemoryRequirement() const
Get the memory requirement of the task.
Definition: WorkflowTask.cpp:160
A data structure that keeps track of a task's execution event times.
Definition: WorkflowTask.h:204
WorkflowTask::State getUpcomingState() const
Get the state of the task.
Definition: WorkflowTask.cpp:214
Abstraction of a job used for executing tasks in a Workflow.
Definition: WorkflowJob.h:34
void setBytesRead(unsigned long)
Set the number of bytes read by the task.
Definition: WorkflowTask.cpp:428
double getFailureDate()
Get the task's most recent failure date.
Definition: WorkflowTask.cpp:708
std::string getExecutionHost()
Returns the name of the host on which the task has most recently been executed, or "" if the task has...
Definition: WorkflowTask.cpp:756
void setStartDate(double date)
Set the task's start date.
Definition: WorkflowTask.cpp:453
WorkflowTaskExecution(double task_start)
Constructor.
Definition: WorkflowTask.h:236
void setJob(WorkflowJob *job)
Set the task's containing job.
Definition: WorkflowTask.cpp:355
unsigned long getPriority() const
Get the task priority. By default, priority is 0.
Definition: WorkflowTask.cpp:388
unsigned long getTopLevel()
Returns the task's top level (max number of hops on a reverse path up to an entry task....
Definition: WorkflowTask.cpp:747
std::string getClusterID() const
Get the cluster Id for the task.
Definition: WorkflowTask.cpp:371
unsigned long getBytesRead() const
Get the number of bytes read by the task.
Definition: WorkflowTask.cpp:420
InternalState
Task state enum.
Definition: WorkflowTask.h:151
@ NOT_READY
Not ready (parents have not completed)
Definition: WorkflowTask.h:64
double getComputationStartDate()
Get the tasks's most recent computation start date.
Definition: WorkflowTask.cpp:660
void setEndDate(double date)
Set the task's end date.
Definition: WorkflowTask.cpp:463
void setWriteOutputEndDate(double date)
Set the date when the write output portion of a WorkflowTask has completed.
Definition: WorkflowTask.cpp:552
std::stack< WorkflowTaskExecution > getExecutionHistory()
Get the execution history of this task.
Definition: WorkflowTask.cpp:594
void setInternalState(WorkflowTask::InternalState)
Set the internal state of the task.
Definition: WorkflowTask.cpp:286
double getReadInputStartDate()
Get the task's most recent read input start date.
Definition: WorkflowTask.cpp:676
std::vector< WorkflowTask * > getParents() const
Get the parents of a task.
Definition: WorkflowTask.cpp:196
void setReadInputStartDate(double date)
Set the date when the read input portion of a WorkflowTask has begun.
Definition: WorkflowTask.cpp:507
void setAverageCPU(double)
Set the task average CPU usage.
Definition: WorkflowTask.cpp:412
void addOutputFile(WorkflowFile *file)
Add an output file to the task.
Definition: WorkflowTask.cpp:85
WorkflowJob * getJob() const
Get the task's containing job.
Definition: WorkflowTask.cpp:363
double task_start
Task's start time.
Definition: WorkflowTask.h:206
unsigned long getNumberOfParents() const
Get the number of parents of a task.
Definition: WorkflowTask.cpp:187
void setWriteOutputStartDate(double date)
Set the date when the write output portion of a WorkflowTask has begun.
Definition: WorkflowTask.cpp:537
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
double getFlops() const
Get the number of flops of the task.
Definition: WorkflowTask.cpp:124
void setColor(std::string)
Set the task's color.
Definition: WorkflowTask.cpp:806
std::vector< WorkflowFile * > getInputFiles()
Get the list of input WorkflowFile objects for the task.
Definition: WorkflowTask.cpp:618
double getReadInputEndDate()
Get the task's most recent read input end date.
Definition: WorkflowTask.cpp:684
double task_terminated
Task's terminated time.
Definition: WorkflowTask.h:224