A computational task in a Workflow. More...

#include <WorkflowTask.h>

Public Types

enum  State {
  NOT_READY, READY, PENDING, COMPLETED,
  UNKNOWN
}
 Task states. More...
 

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...
 
double getAverageCPU () const
 Get the task average CPU usage. More...
 
unsigned long getBytesRead () const
 Get the number of bytes read by the task. More...
 
unsigned long getBytesWritten () const
 Get the number of bytes written by the task. More...
 
std::vector< WorkflowTask * > getChildren () const
 Get the children of a task. More...
 
std::string getClusterID () const
 Get the cluster Id for the task. More...
 
std::string getColor ()
 Get the task's color ("" if none) 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...
 
double getFlops () const
 Get the number of flops of the task. More...
 
std::string getID () const
 Get the id of the task. More...
 
std::vector< WorkflowFile * > getInputFiles ()
 Get the list 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...
 
unsigned long getNumberOfChildren () const
 Get the number of children of a task. More...
 
unsigned long 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::vector< WorkflowFile * > getOutputFiles ()
 Get the list of output WorkflowFile objects for the task. More...
 
double getParallelEfficiency () const
 Get the parallel efficiency of the task. More...
 
std::vector< WorkflowTask * > getParents () const
 Get the parents of a task. More...
 
unsigned 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...
 
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 number of bytes read by the task. More...
 
void setBytesWritten (unsigned long)
 Set the number of bytes written by the task. More...
 
void setClusterID (std::string)
 Set the cluster id for the task. More...
 
void setColor (std::string)
 Set the task's color. More...
 
void setPriority (long)
 Set the task priority. 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
Exceptions
std::invalid_argument

◆ addOutputFile()

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

Add an output file to the task.

Parameters
filethe file

◆ 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 number of bytes read by the task.

Returns
number of bytes read by the task in KB

◆ getBytesWritten()

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

Get the number of bytes written by the task.

Returns
number of bytes written by the task in KB

◆ getChildren()

std::vector< WorkflowTask * > wrench::WorkflowTask::getChildren ( ) const

Get the children of a task.

Returns
a list of workflow tasks

◆ getClusterID()

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

Get the cluster Id for the task.

Returns
a cluster id, or an empty string

◆ getColor()

std::string wrench::WorkflowTask::getColor ( )

Get the task's color ("" if none)

Returns
A color string in "#rrggbb" format

◆ 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)

◆ 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::vector< WorkflowFile * > wrench::WorkflowTask::getInputFiles ( )

Get the list of input WorkflowFile objects for the task.

Returns
a list 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()

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

Get the number of children of a task.

Returns
a number of children

◆ getNumberOfParents()

unsigned long 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::vector< WorkflowFile * > wrench::WorkflowTask::getOutputFiles ( )

Get the list of output WorkflowFile objects for the task.

Returns
a list 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)

◆ getParents()

std::vector< WorkflowTask * > wrench::WorkflowTask::getParents ( ) const

Get the parents of a task.

Returns
a list of workflow tasks

◆ getPriority()

unsigned 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

◆ 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 number of bytes read by the task.

Parameters
bytes_readnumber of bytes read by the task in KB

◆ setBytesWritten()

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

Set the number of bytes written by the task.

Parameters
bytes_writtennumber of bytes written 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

◆ setColor()

void wrench::WorkflowTask::setColor ( std::string  color)

Set the task's color.

Parameters
colorA color string in "#rrggbb" format

◆ setPriority()

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

Set the task priority.

Parameters
prioritytask priority

◆ 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: