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...
 
double getAverageCPU () const
 Get the task average CPU usage. More...
 
unsigned long getBytesRead () const
 Get the amount of bytes read by the task. More...
 
unsigned long getBytesWritten () const
 Set the amount of bytes written by the task. 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 most recently been executed, or "" if the task has never been 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...
 
unsigned long getNumCoresAllocated ()
 Returns the number of cores allocated for this task's most recent execution or 0 if an execution attempt was never made. 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 explicitly 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-level 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 setAverageCPU (double)
 Set the task average CPU usage. More...
 
void setBytesRead (unsigned long)
 Set the amount of bytes read by the task. More...
 
void setBytesWritten (unsigned long)
 Set the amount of bytes written by the task. 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

◆ State

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

◆ addInputFile()

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

Add an input file to the task.

Parameters
filethe file

◆ addOutputFile()

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

Add an output file to the task.

Parameters
filethe file

◆ addSrcDest()

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

◆ getAverageCPU()

double wrench::WorkflowTask::getAverageCPU ( ) const

Get the task average CPU usage.

Returns
the task average CPU usage

◆ getBytesRead()

unsigned long wrench::WorkflowTask::getBytesRead ( ) const

Get the amount of bytes read by the task.

Returns
bytes read by the task in KB

◆ getBytesWritten()

unsigned long wrench::WorkflowTask::getBytesWritten ( ) const

Set the amount of bytes written by the task.

Returns
bytes written by the task in KB

◆ getClusterID()

std::string wrench::WorkflowTask::getClusterID ( ) const

Get the cluster Id for the task.

Returns
a cluster id, or an empty string

◆ getComputationEndDate()

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)

◆ getComputationStartDate()

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)

◆ getEndDate()

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)

◆ getExecutionHistory()

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

◆ getExecutionHost()

std::string wrench::WorkflowTask::getExecutionHost ( )

Returns the name of the host on which the task has most recently been executed, or "" if the task has never been executed yet.

Returns
hostname

◆ getFailureCount()

unsigned int wrench::WorkflowTask::getFailureCount ( )

Get the number of times a task has failed.

Returns
a failure count

◆ getFailureDate()

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)

◆ getFileTransfers()

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

◆ getFlops()

double wrench::WorkflowTask::getFlops ( ) const

Get the number of flops of the task.

Returns
a number of flops

◆ getID()

std::string wrench::WorkflowTask::getID ( ) const

Get the id of the task.

Returns
an id as a string

◆ getInputFiles()

std::set< WorkflowFile * > wrench::WorkflowTask::getInputFiles ( )

Get the set of input WorkflowFile objects for the task.

Returns
a set workflow files

◆ getJob()

WorkflowJob * wrench::WorkflowTask::getJob ( ) const

Get the task's containing job.

Returns
job: the job

◆ getMaxNumCores()

unsigned long wrench::WorkflowTask::getMaxNumCores ( ) const

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

Returns
a number of cores

◆ getMemoryRequirement()

double wrench::WorkflowTask::getMemoryRequirement ( ) const

Get the memory requirement of the task.

Returns
a memory requirement (in bytes)

◆ getMinNumCores()

unsigned long wrench::WorkflowTask::getMinNumCores ( ) const

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

Returns
a number of cores

◆ getNumberOfChildren()

int wrench::WorkflowTask::getNumberOfChildren ( ) const

Get the number of children of a task.

Returns
a number of children

◆ getNumberOfParents()

int wrench::WorkflowTask::getNumberOfParents ( ) const

Get the number of parents of a task.

Returns
a number of parents

◆ getNumCoresAllocated()

unsigned long wrench::WorkflowTask::getNumCoresAllocated ( )

Returns the number of cores allocated for this task's most recent execution or 0 if an execution attempt was never made.

Returns
number of cores

◆ getOutputFiles()

std::set< WorkflowFile * > wrench::WorkflowTask::getOutputFiles ( )

Get the set of output WorkflowFile objects for the task.

Returns
a set of workflow files

◆ getParallelEfficiency()

double wrench::WorkflowTask::getParallelEfficiency ( ) const

Get the parallel efficiency of the task.

Returns
a parallel efficiency (number between 0.0 and 1.0)

◆ getPriority()

long wrench::WorkflowTask::getPriority ( ) const

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

Returns
the task priority

◆ getReadInputEndDate()

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)

◆ getReadInputStartDate()

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)

◆ getStartDate()

double wrench::WorkflowTask::getStartDate ( )

Get the task's most recent start date.

Returns
a start date (-1 if task has not started yet)

◆ getState()

WorkflowTask::State wrench::WorkflowTask::getState ( ) const

Get the state of the task.

Returns
a task state

◆ getTaskType()

WorkflowTask::TaskType wrench::WorkflowTask::getTaskType ( ) const

Get the workflow task type.

Returns
a workflow task type

◆ getTerminationDate()

double wrench::WorkflowTask::getTerminationDate ( )

Get the tasks's most recent termination date (when it was explicitly 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)

◆ getTopLevel()

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-level of 0)

Returns

◆ getWorkflow()

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

Get the workflow that contains the task.

Returns
a workflow

◆ getWriteOutputEndDate()

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)

◆ getWriteOutputStartDate()

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)

◆ setAverageCPU()

void wrench::WorkflowTask::setAverageCPU ( double  average_cpu)

Set the task average CPU usage.

Parameters
average_cputask average CPU usage

◆ setBytesRead()

void wrench::WorkflowTask::setBytesRead ( unsigned long  bytes_read)

Set the amount of bytes read by the task.

Parameters
bytes_readbytes read by the task in KB

◆ setBytesWritten()

void wrench::WorkflowTask::setBytesWritten ( unsigned long  bytes_written)

Set the amount of bytes written by the task.

Parameters
bytes_readbytes read by the task in KB

◆ setClusterID()

void wrench::WorkflowTask::setClusterID ( std::string  id)

Set the cluster id for the task.

Parameters
idcluster id the task belongs to

◆ setPriority()

void wrench::WorkflowTask::setPriority ( long  priority)

Set the task priority.

Parameters
prioritytask priority

◆ setTaskType()

void wrench::WorkflowTask::setTaskType ( TaskType  task_type)

Set the task type.

Parameters
task_typetask type

◆ stateToString()

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:
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/include/wrench/workflow/WorkflowTask.h
  • /Users/rafsilva/Documents/isi/workspace/wrench/wrench/src/wrench/workflow/WorkflowTask.cpp