WRENCH
1.11
Cyberinfrastructure Simulation Workbench
|
Overview | Installation | Getting Started | WRENCH 101 | WRENCH 102 |
A computational task in a Workflow. More...
#include <WorkflowTask.h>
Classes | |
struct | WorkflowTaskExecution |
A data structure that keeps track of a task's execution event times. More... | |
Public Types | |
enum | InternalState { TASK_NOT_READY, TASK_READY, TASK_RUNNING, TASK_COMPLETED, TASK_FAILED } |
Task state enum. | |
enum | State { NOT_READY, READY, PENDING, COMPLETED, UNKNOWN } |
Task states. More... | |
Public Member Functions | |
void | addInputFile (std::shared_ptr< DataFile >file) |
Add an input file to the task. More... | |
void | addOutputFile (std::shared_ptr< DataFile >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< std::shared_ptr< WorkflowTask > > | getChildren () |
Get the children of a task. More... | |
std::string | getClusterID () const |
Get the cluster Id for the task. More... | |
std::string | getColor () const |
Get the task's color ("" if none) More... | |
double | getComputationEndDate () const |
Get the task's most recent computation end date. More... | |
double | getComputationStartDate () const |
Get the tasks's most recent computation start date. More... | |
double | getEndDate () const |
Get the task's most recent end date. More... | |
std::stack< WorkflowTaskExecution > | getExecutionHistory () const |
Get the execution history of this task. More... | |
std::string | getExecutionHost () const |
Returns the name of the host on which the task has most recently been executed, or "" if the task has never been executed yet. Could be a virtual hostname. More... | |
unsigned int | getFailureCount () |
Get the number of times a task has failed. More... | |
double | getFailureDate () const |
Get the task's most recent failure date. More... | |
double | getFlops () const |
Get the number of flops of the task. More... | |
const std::string & | getID () const |
Get the id of the task. More... | |
std::vector< std::shared_ptr< DataFile > > | getInputFiles () const |
Get the list of input DataFile objects for the task. More... | |
WorkflowTask::InternalState | getInternalState () const |
Get the state of the task (as known to the "internal" layer) More... | |
Job * | getJob () 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_manager_service requirement of the task. More... | |
unsigned long | getMinNumCores () const |
Get the minimum number of cores required for running the task. More... | |
unsigned long | getNumberOfChildren () |
Get the number of children of a task. More... | |
unsigned long | getNumberOfParents () |
Get the number of parents of a task. More... | |
unsigned long | getNumCoresAllocated () const |
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< std::shared_ptr< DataFile > > | getOutputFiles () const |
Get the list of output DataFile objects for the task. More... | |
std::shared_ptr< ParallelModel > | getParallelModel () const |
Get the task's parallel model. More... | |
std::vector< std::shared_ptr< WorkflowTask > > | getParents () |
Get the parents of a task. More... | |
std::string | getPhysicalExecutionHost () const |
Returns the name of the PHYSICAL host on which the task has most recently been executed, or "" if the task has never been executed yet. More... | |
unsigned long | getPriority () const |
Get the task priority. By default, priority is 0. More... | |
double | getReadInputEndDate () const |
Get the task's most recent read input end date. More... | |
double | getReadInputStartDate () const |
Get the task's most recent read input start date. More... | |
std::shared_ptr< WorkflowTask > | getSharedPtr () |
double | getStartDate () const |
Get the task's most recent start date. More... | |
WorkflowTask::State | getState () const |
Get the state of the task. More... | |
std::string | getStateAsString () const |
Get the state of the task as a string. More... | |
double | getTerminationDate () const |
Get the tasks's most recent termination date (when it was explicitly requested to be terminated by the execution controller) More... | |
unsigned long | getTopLevel () const |
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... | |
std::shared_ptr< Workflow > | getWorkflow () const |
Get the workflow that contains the task. More... | |
double | getWriteOutputEndDate () const |
Get the task's most recent write output end date. More... | |
double | getWriteOutputStartDate () const |
Get the task's most recent write output start date. More... | |
void | incrementFailureCount () |
Increment the failure count of a task. | |
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 | setComputationEndDate (double date) |
Set the date when the computation portion of a WorkflowTask has ended. More... | |
void | setComputationStartDate (double date) |
Set the date when the computation portion of a WorkflowTask has begun. More... | |
void | setEndDate (double date) |
Set the task's end date. More... | |
void | setExecutionHost (std::string hostname) |
Sets the host on which this task is running.If the hostname is a VM name, then the corresponding physical host name will be set! More... | |
void | setFailureDate (double date) |
Set the date when the task has failed. More... | |
void | setInternalState (WorkflowTask::InternalState) |
Set the internal state of the task. More... | |
void | setJob (Job *job) |
Set the task's containing job. More... | |
void | setNumCoresAllocated (unsigned long num_cores) |
Sets the number of cores allocated for this task. More... | |
void | setParallelModel (std::shared_ptr< ParallelModel > model) |
Set the task's parallel model. More... | |
void | setPriority (long) |
Set the task priority. More... | |
void | setReadInputEndDate (double date) |
Set the date when the read input portion of a WorkflowTask has completed. More... | |
void | setReadInputStartDate (double date) |
Set the date when the read input portion of a WorkflowTask has begun. More... | |
void | setStartDate (double date) |
Set the task's start date (which pushing a new execution history!) More... | |
void | setState (WorkflowTask::State) |
Set the visible state of the task. More... | |
void | setTerminationDate (double date) |
Set the date when the task was terminated. More... | |
void | setWriteOutputEndDate (double date) |
Set the date when the write output portion of a WorkflowTask has completed. More... | |
void | setWriteOutputStartDate (double date) |
Set the date when the write output portion of a WorkflowTask has begun. More... | |
void | updateReadiness () |
Update task readiness. | |
void | updateStartDate (double date) |
Update the task's start date. More... | |
unsigned long | updateTopLevel () |
Update the task's top level (looking only at the parents, and updating children) More... | |
Static Public Member Functions | |
static std::string | stateToString (WorkflowTask::InternalState state) |
Get a task internal state as a string. More... | |
static std::string | stateToString (WorkflowTask::State state) |
Convert task state to a string (useful for output, debugging, logging, etc.) More... | |
A computational task in a Workflow.
void wrench::WorkflowTask::addInputFile | ( | std::shared_ptr< DataFile > | file | ) |
Add an input file to the task.
file | the file |
std::invalid_argument |
void wrench::WorkflowTask::addOutputFile | ( | std::shared_ptr< DataFile > | file | ) |
Add an output file to the task.
file | the file |
double wrench::WorkflowTask::getAverageCPU | ( | ) | const |
Get the task average CPU usage.
unsigned long wrench::WorkflowTask::getBytesRead | ( | ) | const |
Get the number of bytes read by the task.
unsigned long wrench::WorkflowTask::getBytesWritten | ( | ) | const |
Get the number of bytes written by the task.
std::vector< std::shared_ptr< WorkflowTask > > wrench::WorkflowTask::getChildren | ( | ) |
Get the children of a task.
std::string wrench::WorkflowTask::getClusterID | ( | ) | const |
Get the cluster Id for the task.
std::string wrench::WorkflowTask::getColor | ( | ) | const |
Get the task's color ("" if none)
double wrench::WorkflowTask::getComputationEndDate | ( | ) | const |
Get the task's most recent computation end date.
double wrench::WorkflowTask::getComputationStartDate | ( | ) | const |
Get the tasks's most recent computation start date.
double wrench::WorkflowTask::getEndDate | ( | ) | const |
Get the task's most recent end date.
std::stack< WorkflowTask::WorkflowTaskExecution > wrench::WorkflowTask::getExecutionHistory | ( | ) | const |
Get the execution history of this task.
std::string wrench::WorkflowTask::getExecutionHost | ( | ) | const |
Returns the name of the host on which the task has most recently been executed, or "" if the task has never been executed yet. Could be a virtual hostname.
unsigned int wrench::WorkflowTask::getFailureCount | ( | ) |
Get the number of times a task has failed.
double wrench::WorkflowTask::getFailureDate | ( | ) | const |
Get the task's most recent failure date.
double wrench::WorkflowTask::getFlops | ( | ) | const |
Get the number of flops of the task.
const std::string & wrench::WorkflowTask::getID | ( | ) | const |
Get the id of the task.
std::vector< std::shared_ptr< DataFile > > wrench::WorkflowTask::getInputFiles | ( | ) | const |
Get the list of input DataFile objects for the task.
WorkflowTask::InternalState wrench::WorkflowTask::getInternalState | ( | ) | const |
Get the state of the task (as known to the "internal" layer)
Job * wrench::WorkflowTask::getJob | ( | ) | const |
Get the task's containing job.
unsigned long wrench::WorkflowTask::getMaxNumCores | ( | ) | const |
Get the maximum number of cores that the task can use.
double wrench::WorkflowTask::getMemoryRequirement | ( | ) | const |
Get the memory_manager_service requirement of the task.
unsigned long wrench::WorkflowTask::getMinNumCores | ( | ) | const |
Get the minimum number of cores required for running the task.
unsigned long wrench::WorkflowTask::getNumberOfChildren | ( | ) |
Get the number of children of a task.
unsigned long wrench::WorkflowTask::getNumberOfParents | ( | ) |
Get the number of parents of a task.
unsigned long wrench::WorkflowTask::getNumCoresAllocated | ( | ) | const |
Returns the number of cores allocated for this task's most recent execution or 0 if an execution attempt was never made.
std::vector< std::shared_ptr< DataFile > > wrench::WorkflowTask::getOutputFiles | ( | ) | const |
Get the list of output DataFile objects for the task.
std::shared_ptr< ParallelModel > wrench::WorkflowTask::getParallelModel | ( | ) | const |
Get the task's parallel model.
std::vector< std::shared_ptr< WorkflowTask > > wrench::WorkflowTask::getParents | ( | ) |
Get the parents of a task.
std::string wrench::WorkflowTask::getPhysicalExecutionHost | ( | ) | const |
Returns the name of the PHYSICAL host on which the task has most recently been executed, or "" if the task has never been executed yet.
unsigned long wrench::WorkflowTask::getPriority | ( | ) | const |
Get the task priority. By default, priority is 0.
double wrench::WorkflowTask::getReadInputEndDate | ( | ) | const |
Get the task's most recent read input end date.
double wrench::WorkflowTask::getReadInputStartDate | ( | ) | const |
Get the task's most recent read input start date.
double wrench::WorkflowTask::getStartDate | ( | ) | const |
Get the task's most recent start date.
WorkflowTask::State wrench::WorkflowTask::getState | ( | ) | const |
Get the state of the task.
std::string wrench::WorkflowTask::getStateAsString | ( | ) | const |
Get the state of the task as a string.
double wrench::WorkflowTask::getTerminationDate | ( | ) | const |
Get the tasks's most recent termination date (when it was explicitly requested to be terminated by the execution controller)
unsigned long wrench::WorkflowTask::getTopLevel | ( | ) | const |
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)
std::shared_ptr< Workflow > wrench::WorkflowTask::getWorkflow | ( | ) | const |
Get the workflow that contains the task.
double wrench::WorkflowTask::getWriteOutputEndDate | ( | ) | const |
Get the task's most recent write output end date.
double wrench::WorkflowTask::getWriteOutputStartDate | ( | ) | const |
Get the task's most recent write output start date.
void wrench::WorkflowTask::setAverageCPU | ( | double | average_cpu | ) |
Set the task average CPU usage.
average_cpu | task average CPU usage |
void wrench::WorkflowTask::setBytesRead | ( | unsigned long | bytes_read | ) |
Set the number of bytes read by the task.
bytes_read | number of bytes read by the task in KB |
void wrench::WorkflowTask::setBytesWritten | ( | unsigned long | bytes_written | ) |
Set the number of bytes written by the task.
bytes_written | number of bytes written by the task in KB |
void wrench::WorkflowTask::setClusterID | ( | std::string | id | ) |
Set the cluster id for the task.
id | cluster id the task belongs to |
void wrench::WorkflowTask::setColor | ( | std::string | color | ) |
Set the task's color.
color | A color string in "#rrggbb" format |
void wrench::WorkflowTask::setComputationEndDate | ( | double | date | ) |
Set the date when the computation portion of a WorkflowTask has ended.
date | the date when the computation portion of the WorkflowTask has ended |
std::runtime_error |
void wrench::WorkflowTask::setComputationStartDate | ( | double | date | ) |
Set the date when the computation portion of a WorkflowTask has begun.
date | the date when the computation portion of the WorkflowTask has begun |
std::runtime_error |
void wrench::WorkflowTask::setEndDate | ( | double | date | ) |
Set the task's end date.
date | the end date |
std::runtime_error |
void wrench::WorkflowTask::setExecutionHost | ( | std::string | hostname | ) |
Sets the host on which this task is running.If the hostname is a VM name, then the corresponding physical host name will be set!
hostname | the host name |
The conversion below has been removed as it makes more sense to keep the virtual and the physical separate
void wrench::WorkflowTask::setFailureDate | ( | double | date | ) |
Set the date when the task has failed.
date | the date when the task has failed |
void wrench::WorkflowTask::setInternalState | ( | WorkflowTask::InternalState | state | ) |
Set the internal state of the task.
state | the task's internal state |
void wrench::WorkflowTask::setJob | ( | Job * | job | ) |
Set the task's containing job.
job | the job |
void wrench::WorkflowTask::setNumCoresAllocated | ( | unsigned long | num_cores | ) |
Sets the number of cores allocated for this task.
num_cores | the number of cores allocated to this task |
void wrench::WorkflowTask::setParallelModel | ( | std::shared_ptr< ParallelModel > | model | ) |
Set the task's parallel model.
model | a parallel model |
void wrench::WorkflowTask::setPriority | ( | long | priority | ) |
Set the task priority.
priority | task priority |
void wrench::WorkflowTask::setReadInputEndDate | ( | double | date | ) |
Set the date when the read input portion of a WorkflowTask has completed.
date | the date when the read input portion of a WorkflowTask has completed |
std::runtime_error |
void wrench::WorkflowTask::setReadInputStartDate | ( | double | date | ) |
Set the date when the read input portion of a WorkflowTask has begun.
date | the date when the read input portion of a WorkflowTask has begun |
std::runtime_error |
void wrench::WorkflowTask::setStartDate | ( | double | date | ) |
Set the task's start date (which pushing a new execution history!)
date | the start date |
void wrench::WorkflowTask::setState | ( | WorkflowTask::State | state | ) |
Set the visible state of the task.
state | the task state |
void wrench::WorkflowTask::setTerminationDate | ( | double | date | ) |
Set the date when the task was terminated.
date | the date when the task was terminated |
void wrench::WorkflowTask::setWriteOutputEndDate | ( | double | date | ) |
Set the date when the write output portion of a WorkflowTask has completed.
date | the date when the write output portion of a task has completed |
std::runtime_error |
void wrench::WorkflowTask::setWriteOutputStartDate | ( | double | date | ) |
Set the date when the write output portion of a WorkflowTask has begun.
date | the date when the write output portion of a task has begun |
std::runtime_error |
|
static |
Get a task internal state as a string.
internal_state | the internal state |
|
static |
Convert task state to a string (useful for output, debugging, logging, etc.)
state | task state |
void wrench::WorkflowTask::updateStartDate | ( | double | date | ) |
Update the task's start date.
date | the start date |
unsigned long wrench::WorkflowTask::updateTopLevel | ( | ) |
Update the task's top level (looking only at the parents, and updating children)