wrench::Workflow Class Reference

A workflow that an be executed by a WMS. More...

#include <Workflow.h>

Public Member Functions

 Workflow ()
 Constructor.
 
WorkflowTaskaddTask (std::string, double flops, int min_num_cores=1, int max_num_cores=1, double parallel_efficiency=1.0)
 Create and add a new computational task to the workflow. More...
 
void removeTask (WorkflowTask *task)
 Remove a task from the workflow. WARNING: this method de-allocated memory for the task, making any pointer to the task invalid. More...
 
WorkflowTaskgetWorkflowTaskByID (const std::string)
 Find a WorkflowTask object based on its ID. More...
 
WorkflowFileaddFile (const std::string, double)
 Add a new file to the workflow. More...
 
WorkflowFilegetFileById (const std::string id)
 Retrieve a file by its id. More...
 
WorkflowFilegetWorkflowFileByID (const std::string)
 Find a WorkflowFile object based on its ID. More...
 
void addControlDependency (WorkflowTask *, WorkflowTask *)
 Create a control dependency between two workflow tasks. Will not do anything if there is already a path between the two tasks. More...
 
void loadFromDAX (const std::string &filename)
 Create a workflow based on a DAX file. More...
 
unsigned long getNumberOfTasks ()
 Get the number of tasks in the workflow. More...
 
void exportToEPS (std::string)
 Output the workflow's dependency graph to EPS. More...
 
std::set< WorkflowFile * > getInputFiles ()
 Retrieve the set of input files for a workflow (i.e., those files that are input to some tasks but output from none) More...
 

Detailed Description

A workflow that an be executed by a WMS.

Member Function Documentation

◆ addControlDependency()

void wrench::Workflow::addControlDependency ( WorkflowTask src,
WorkflowTask dst 
)

Create a control dependency between two workflow tasks. Will not do anything if there is already a path between the two tasks.

Parameters
srcthe parent task
dstthe child task
Exceptions
std::invalid_argument

◆ addFile()

WorkflowFile * wrench::Workflow::addFile ( const std::string  id,
double  size 
)

Add a new file to the workflow.

Parameters
ida unique string id
sizea file size in bytes
Returns
the WorkflowFile instance
Exceptions
std::invalid_argument

◆ addTask()

WorkflowTask * wrench::Workflow::addTask ( std::string  id,
double  flops,
int  min_num_cores = 1,
int  max_num_cores = 1,
double  parallel_efficiency = 1.0 
)

Create and add a new computational task to the workflow.

Parameters
ida unique string id
flopsnumber of flops
min_num_coresthe minimum number of cores required to run the task
max_num_coresthe maximum number of cores that can be used by the task (0 meanx infinity)
parallel_efficiencythe multi-core parallel efficiency
Returns
the WorkflowTask instance
Exceptions
std::invalid_argument

◆ exportToEPS()

void wrench::Workflow::exportToEPS ( std::string  eps_filename)

Output the workflow's dependency graph to EPS.

Parameters
eps_filenamea filename to which the EPS content is saved

◆ getFileById()

WorkflowFile * wrench::Workflow::getFileById ( const std::string  id)

Retrieve a file by its id.

Parameters
idthe file id
Returns
the file, or nullptr if not found

◆ getInputFiles()

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

Retrieve the set of input files for a workflow (i.e., those files that are input to some tasks but output from none)

Returns
a std::set of files

◆ getNumberOfTasks()

unsigned long wrench::Workflow::getNumberOfTasks ( )

Get the number of tasks in the workflow.

Returns
the number of tasks

◆ getWorkflowFileByID()

WorkflowFile * wrench::Workflow::getWorkflowFileByID ( const std::string  id)

Find a WorkflowFile object based on its ID.

Parameters
ida string id
Returns
the WorkflowFile instance, or nullptr if not found
Exceptions
std::invalid_argument

◆ getWorkflowTaskByID()

WorkflowTask * wrench::Workflow::getWorkflowTaskByID ( const std::string  id)

Find a WorkflowTask object based on its ID.

Parameters
ida string id
Returns
a workflow task
Exceptions
std::invalid_argument

◆ loadFromDAX()

void wrench::Workflow::loadFromDAX ( const std::string &  filename)

Create a workflow based on a DAX file.

Parameters
filenamethe path to the DAX file
Exceptions
std::invalid_argument

◆ removeTask()

void wrench::Workflow::removeTask ( WorkflowTask task)

Remove a task from the workflow. WARNING: this method de-allocated memory for the task, making any pointer to the task invalid.

Parameters
taska task
Exceptions
std::invalid_argument

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