A computational task in a Workflow. More...

#include <WorkflowTask.h>

Public Types

enum  State {
  NOT_READY, READY, PENDING, COMPLETED,
  UNKNOWN
}
 Task states. More...
 
enum  TaskType { COMPUTE, AUXILIARY, TRANSFER }
 Task types.
 

Public Member Functions

void addInputFile (WorkflowFile *file)
 Add an input file to the task. More...
 
void addOutputFile (WorkflowFile *file)
 Add an output file to the task. More...
 
void addSrcDest (WorkflowFile *, const std::string &, const std::string &)
 Set a pair of src and dest hosts for transfers (it is only meaningful for WorkflowTask::TaskType::TRANSFER tasks) More...
 
std::string getClusterID () const
 Get the cluster Id for the task. More...
 
double getComputationEndDate ()
 Get the task's most recent computation end date. More...
 
double getComputationStartDate ()
 Get the tasks's most recent computation start date. More...
 
double getEndDate ()
 Get the task's most recent end date. More...
 
std::stack< WorkflowTaskExecution > getExecutionHistory ()
 Get the execution history of this task. More...
 
std::string getExecutionHost ()
 Returns the name of the host on which the task has executed, or "" if the task has not been (successfully) executed yet. More...
 
unsigned int getFailureCount ()
 Get the number of times a task has failed. More...
 
double getFailureDate ()
 Get the task's most recent failure date. More...
 
std::map< WorkflowFile
*, std::pair< std::string,
std::string > > 
getFileTransfers () const
 Get a map of src and dst hosts for file transfers (only available for WorkflowTask::TaskType::TRANSFER_IN or WorkflowTask::TaskType::TRANSFER_OUT tasks) More...
 
double getFlops () const
 Get the number of flops of the task. More...
 
std::string getID () const
 Get the id of the task. More...
 
std::set< WorkflowFile * > getInputFiles ()
 Get the set of input WorkflowFile objects for the task. More...
 
WorkflowJobgetJob () const
 Get the task's containing job. More...
 
unsigned long getMaxNumCores () const
 Get the maximum number of cores that the task can use. More...
 
double getMemoryRequirement () const
 Get the memory requirement of the task. More...
 
unsigned long getMinNumCores () const
 Get the minimum number of cores required for running the task. More...
 
int getNumberOfChildren () const
 Get the number of children of a task. More...
 
int getNumberOfParents () const
 Get the number of parents of a task. More...
 
std::set< WorkflowFile * > getOutputFiles ()
 Get the set of output WorkflowFile objects for the task. More...
 
double getParallelEfficiency () const
 Get the parallel efficiency of the task. More...
 
long getPriority () const
 Get the task priority. By default, priority is 0. More...
 
double getReadInputEndDate ()
 Get the task's most recent read input end date. More...
 
double getReadInputStartDate ()
 Get the task's most recent read input start date. More...
 
double getStartDate ()
 Get the task's most recent start date. More...
 
WorkflowTask::State getState () const
 Get the state of the task. More...
 
TaskType getTaskType () const
 Get the workflow task type. More...
 
double getTerminationDate ()
 Get the tasks's most recent termination date (when it was explicitely requested to be terminated by the WMS) More...
 
unsigned long getTopLevel ()
 Returns the task's top level (max number of hops on a reverse path up to an entry task. Entry tasks have a top-leve of 0) More...
 
WorkflowgetWorkflow () const
 Get the workflow that contains the task. More...
 
double getWriteOutputEndDate ()
 Get the task's most recent write output end date. More...
 
double getWriteOutputStartDate ()
 Get the task's most recent write output start date. More...
 
void setClusterID (std::string)
 Set the cluster id for the task. More...
 
void setPriority (long)
 Set the task priority. More...
 
void setTaskType (TaskType)
 Set the task type. More...
 

Static Public Member Functions

static std::string stateToString (WorkflowTask::State state)
 Convert task state to a string (useful for output, debugging, logging, etc.) More...
 

Detailed Description

A computational task in a Workflow.

Member Enumeration Documentation

Task states.

Enumerator
NOT_READY 

Not ready (parents have not completed)

READY 

Ready (parents have completed)

PENDING 

Pending (has been submitted to a compute service)

COMPLETED 

Completed (successfully completed)

UNKNOWN 

Some Unknown state (should not happen)

Member Function Documentation

void wrench::WorkflowTask::addInputFile ( WorkflowFile file)

Add an input file to the task.

Parameters
filethe file
void wrench::WorkflowTask::addOutputFile ( WorkflowFile file)

Add an output file to the task.

Parameters
filethe file
void wrench::WorkflowTask::addSrcDest ( WorkflowFile workflow_file,
const std::string &  src,
const std::string &  dst 
)

Set a pair of src and dest hosts for transfers (it is only meaningful for WorkflowTask::TaskType::TRANSFER tasks)

Parameters
workflow_filea pointer to a file to be transferred
srcsource hostname
dstdestination hostname
std::string wrench::WorkflowTask::getClusterID ( ) const

Get the cluster Id for the task.

Returns
a cluster id, or an empty string
double wrench::WorkflowTask::getComputationEndDate ( )

Get the task's most recent computation end date.

Returns
the date when the computation portion of a task ended (-1 if computation has not ended yet or if no execution history exists for this task yet)
double wrench::WorkflowTask::getComputationStartDate ( )

Get the tasks's most recent computation start date.

Returns
the date when the computation portion of a task started (-1 if computation has not started yet or if no execution history exists for this task yet)
double wrench::WorkflowTask::getEndDate ( )

Get the task's most recent end date.

Returns
a end date (-1 if task has not completed yet or if no execution history exists for this task yet)
std::stack< WorkflowTask::WorkflowTaskExecution > wrench::WorkflowTask::getExecutionHistory ( )

Get the execution history of this task.

Returns
a stack of WorkflowTaskExecution objects, one for each attempted execution of the task
std::string wrench::WorkflowTask::getExecutionHost ( )

Returns the name of the host on which the task has executed, or "" if the task has not been (successfully) executed yet.

Returns
hostname
unsigned int wrench::WorkflowTask::getFailureCount ( )

Get the number of times a task has failed.

Returns
a failure count
double wrench::WorkflowTask::getFailureDate ( )

Get the task's most recent failure date.

Returns
the date when the task failed (-1 if it didn't fail or if no execution history exists for this task yet)
std::map< WorkflowFile *, std::pair< std::string, std::string > > wrench::WorkflowTask::getFileTransfers ( ) const

Get a map of src and dst hosts for file transfers (only available for WorkflowTask::TaskType::TRANSFER_IN or WorkflowTask::TaskType::TRANSFER_OUT tasks)

Returns
transfer src and dst pair
double wrench::WorkflowTask::getFlops ( ) const

Get the number of flops of the task.

Returns
a number of flops
std::string wrench::WorkflowTask::getID ( ) const

Get the id of the task.

Returns
an id as a string
std::set< WorkflowFile * > wrench::WorkflowTask::getInputFiles ( )

Get the set of input WorkflowFile objects for the task.

Returns
a set workflow files
WorkflowJob * wrench::WorkflowTask::getJob ( ) const

Get the task's containing job.

Returns
job: the job
unsigned long wrench::WorkflowTask::getMaxNumCores ( ) const

Get the maximum number of cores that the task can use.

Returns
a number of cores
double wrench::WorkflowTask::getMemoryRequirement ( ) const

Get the memory requirement of the task.

Returns
a memory requirement (in bytes)
unsigned long wrench::WorkflowTask::getMinNumCores ( ) const

Get the minimum number of cores required for running the task.

Returns
a number of cores
int wrench::WorkflowTask::getNumberOfChildren ( ) const

Get the number of children of a task.

Returns
a number of children
int wrench::WorkflowTask::getNumberOfParents ( ) const

Get the number of parents of a task.

Returns
a number of parents
std::set< WorkflowFile * > wrench::WorkflowTask::getOutputFiles ( )

Get the set of output WorkflowFile objects for the task.

Returns
a set of workflow files
double wrench::WorkflowTask::getParallelEfficiency ( ) const

Get the parallel efficiency of the task.

Returns
a parallel efficiency (number between 0.0 and 1.0)
long wrench::WorkflowTask::getPriority ( ) const

Get the task priority. By default, priority is 0.

Returns
the task priority
double wrench::WorkflowTask::getReadInputEndDate ( )

Get the task's most recent read input end date.

Returns
the date when the read input portion of the task has completed (-1 if it has not begun or if no execution history exists for this task yet)
double wrench::WorkflowTask::getReadInputStartDate ( )

Get the task's most recent read input start date.

Returns
the date when the read input portion of the task has begun (-1 if it has not yet begun or if no execution history exists for this task yet)
double wrench::WorkflowTask::getStartDate ( )

Get the task's most recent start date.

Returns
a start date (-1 if task has not started yet)
WorkflowTask::State wrench::WorkflowTask::getState ( ) const

Get the state of the task.

Returns
a task state
WorkflowTask::TaskType wrench::WorkflowTask::getTaskType ( ) const

Get the workflow task type.

Returns
a workflow task type
double wrench::WorkflowTask::getTerminationDate ( )

Get the tasks's most recent termination date (when it was explicitely requested to be terminated by the WMS)

Returns
the date when the task was terminated (-1 if it wasn't terminated or if not execution history exists for this task yet)
unsigned long wrench::WorkflowTask::getTopLevel ( )

Returns the task's top level (max number of hops on a reverse path up to an entry task. Entry tasks have a top-leve of 0)

Returns
Workflow * wrench::WorkflowTask::getWorkflow ( ) const

Get the workflow that contains the task.

Returns
a workflow
double wrench::WorkflowTask::getWriteOutputEndDate ( )

Get the task's most recent write output end date.

Returns
the date when the write output portion of a task has completed (-1 if it has not completed yet or if no execution history exists for this task yet)
double wrench::WorkflowTask::getWriteOutputStartDate ( )

Get the task's most recent write output start date.

Returns
the date when the write output portion of a task has begun (-1 if it has not yet started or if no execution history exists for this task yet)
void wrench::WorkflowTask::setClusterID ( std::string  id)

Set the cluster id for the task.

Parameters
idcluster id the task belongs to
void wrench::WorkflowTask::setPriority ( long  priority)

Set the task priority.

Parameters
prioritytask priority
void wrench::WorkflowTask::setTaskType ( TaskType  task_type)

Set the task type.

Parameters
task_typetask type
std::string wrench::WorkflowTask::stateToString ( WorkflowTask::State  state)
static

Convert task state to a string (useful for output, debugging, logging, etc.)

Get a task internal state as a string.

Parameters
statetask state
Returns
a string
Parameters
statethe internal state
Returns
an internal state as a string

The documentation for this class was generated from the following files:
  • /home/wrench/wrench/include/wrench/workflow/WorkflowTask.h
  • /home/wrench/wrench/src/wrench/workflow/WorkflowTask.cpp