WRENCH
1.10
Cyberinfrastructure Simulation Workbench
|
Overview | Installation | Getting Started | WRENCH 101 | WRENCH 102 |
A workflow (to be executed by a WMS) More...
#include <Workflow.h>
Public Member Functions | |
Workflow () | |
Constructor. | |
void | addControlDependency (WorkflowTask *src, WorkflowTask *dest, bool redundant_dependencies=false) |
Create a control dependency between two workflow tasks. Will not do anything if there is already a path between the two tasks. More... | |
WorkflowFile * | addFile (std::string, double) |
Add a new file to the workflow. More... | |
WorkflowTask * | addTask (std::string, double flops, unsigned long min_num_cores, unsigned long max_num_cores, double memory_requirement) |
Create and add a new computational task to the workflow. More... | |
void | exportToEPS (std::string) |
Output the workflow's dependency graph to EPS. More... | |
double | getCompletionDate () |
Returns the workflow's completion date. More... | |
std::map< std::string, WorkflowTask * > | getEntryTaskMap () const |
Get the list of exit tasks of the workflow, i.e., those tasks that don't have parents. More... | |
std::vector< WorkflowTask * > | getEntryTasks () const |
Get the list of exit tasks of the workflow, i.e., those tasks that don't have parents. More... | |
std::map< std::string, WorkflowTask * > | getExitTaskMap () const |
Get the exit tasks of the workflow, i.e., those tasks that don't have children. More... | |
std::vector< WorkflowTask * > | getExitTasks () const |
Get the exit tasks of the workflow, i.e., those tasks that don't have children. More... | |
WorkflowFile * | getFileByID (const std::string &id) |
Find a WorkflowFile based on its ID. More... | |
std::map< std::string, WorkflowFile * > | getFileMap () const |
Get the list of all files in the workflow. More... | |
std::vector< WorkflowFile * > | getFiles () const |
Get the list of all files in the workflow. More... | |
std::map< std::string, WorkflowFile * > | getInputFileMap () const |
Retrieve the list of the input files of the workflow (i.e., those files that are input to some tasks but output from none) More... | |
std::vector< WorkflowFile * > | getInputFiles () const |
Retrieve the list of the input files of the workflow (i.e., those files that are input to some tasks but output from none) More... | |
unsigned long | getNumberOfTasks () |
Get the number of tasks in the workflow. More... | |
unsigned long | getNumLevels () |
Returns the number of levels in the workflow. More... | |
std::map< std::string, WorkflowFile * > | getOutputFileMap () const |
Retrieve a list of the output files of the workflow (i.e., those files that are output from some tasks but input to none) More... | |
std::vector< WorkflowFile * > | getOutputFiles () const |
Retrieve a list of the output files of the workflow (i.e., those files that are output from some tasks but input to none) More... | |
std::map< std::string, std::vector< WorkflowTask * > > | getReadyClusters () |
Get a map of clusters composed of ready tasks. More... | |
std::vector< WorkflowTask * > | getReadyTasks () |
Get a vector of ready tasks. More... | |
WorkflowTask * | getTaskByID (const std::string &id) |
Find a WorkflowTask based on its ID. More... | |
std::vector< WorkflowTask * > | getTaskChildren (const WorkflowTask *task) |
Get the list of children for a task. More... | |
std::map< std::string, WorkflowTask * > | getTaskMap () |
Get the list of all tasks in the workflow. More... | |
long | getTaskNumberOfChildren (const WorkflowTask *task) |
Get the number of children for a task. More... | |
long | getTaskNumberOfParents (const WorkflowTask *task) |
Get the number of parents for a task. More... | |
std::vector< WorkflowTask * > | getTaskParents (const WorkflowTask *task) |
Get the list of parents for a task. More... | |
std::vector< WorkflowTask * > | getTasks () |
Get the list of all tasks in the workflow. More... | |
std::vector< WorkflowTask * > | getTasksInTopLevelRange (unsigned long min, unsigned long max) |
Returns all tasks with top-levels in a range. More... | |
bool | isDone () |
Returns whether all tasks are complete. More... | |
bool | pathExists (const WorkflowTask *src, const WorkflowTask *dst) |
Determine whether one source is an ancestor of a destination task. More... | |
void | removeControlDependency (WorkflowTask *src, WorkflowTask *dest) |
Remove a control dependency between tasks (does nothing if none) More... | |
void | removeFile (WorkflowFile *file) |
Remove a file from the workflow. WARNING: this method de-allocated memory_manager_service for the file, making any pointer to the file invalid. More... | |
void | removeTask (WorkflowTask *task) |
Remove a task from the workflow. WARNING: this method de-allocated memory_manager_service for the task, making any pointer to the task invalid. More... | |
Static Public Member Functions | |
static double | getSumFlops (const std::vector< WorkflowTask * > tasks) |
Get the total number of flops for a list of tasks. More... | |
A workflow (to be executed by a WMS)
void wrench::Workflow::addControlDependency | ( | WorkflowTask * | src, |
WorkflowTask * | dst, | ||
bool | redundant_dependencies = false |
||
) |
Create a control dependency between two workflow tasks. Will not do anything if there is already a path between the two tasks.
src | the parent task |
dst | the child task |
redundant_dependencies | whether DAG redundant dependencies should be kept in the graph |
std::invalid_argument |
WorkflowFile * wrench::Workflow::addFile | ( | std::string | id, |
double | size | ||
) |
Add a new file to the workflow.
id | a unique string id |
size | a file size in bytes |
std::invalid_argument |
WorkflowTask * wrench::Workflow::addTask | ( | std::string | id, |
double | flops, | ||
unsigned long | min_num_cores, | ||
unsigned long | max_num_cores, | ||
double | memory_requirement | ||
) |
Create and add a new computational task to the workflow.
id | a unique string id |
flops | number of flops |
min_num_cores | the minimum number of cores required to run the task |
max_num_cores | the maximum number of cores that can be used by the task (use INT_MAX for infinity) |
memory_requirement | memory_manager_service requirement (in bytes) |
std::invalid_argument |
void wrench::Workflow::exportToEPS | ( | std::string | eps_filename | ) |
Output the workflow's dependency graph to EPS.
eps_filename | a filename to which the EPS content is saved |
double wrench::Workflow::getCompletionDate | ( | ) |
Returns the workflow's completion date.
std::map< std::string, WorkflowTask * > wrench::Workflow::getEntryTaskMap | ( | ) | const |
Get the list of exit tasks of the workflow, i.e., those tasks that don't have parents.
std::vector< WorkflowTask * > wrench::Workflow::getEntryTasks | ( | ) | const |
Get the list of exit tasks of the workflow, i.e., those tasks that don't have parents.
std::map< std::string, WorkflowTask * > wrench::Workflow::getExitTaskMap | ( | ) | const |
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
std::vector< WorkflowTask * > wrench::Workflow::getExitTasks | ( | ) | const |
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
WorkflowFile * wrench::Workflow::getFileByID | ( | const std::string & | id | ) |
Find a WorkflowFile based on its ID.
id | a string id |
std::invalid_argument |
std::map< std::string, WorkflowFile * > wrench::Workflow::getFileMap | ( | ) | const |
Get the list of all files in the workflow.
std::vector< WorkflowFile * > wrench::Workflow::getFiles | ( | ) | const |
Get the list of all files in the workflow.
std::map< std::string, WorkflowFile * > wrench::Workflow::getInputFileMap | ( | ) | const |
Retrieve the list of the input files of the workflow (i.e., those files that are input to some tasks but output from none)
std::vector< WorkflowFile * > wrench::Workflow::getInputFiles | ( | ) | const |
Retrieve the list of the input files of the workflow (i.e., those files that are input to some tasks but output from none)
unsigned long wrench::Workflow::getNumberOfTasks | ( | ) |
Get the number of tasks in the workflow.
unsigned long wrench::Workflow::getNumLevels | ( | ) |
Returns the number of levels in the workflow.
std::map< std::string, WorkflowFile * > wrench::Workflow::getOutputFileMap | ( | ) | const |
Retrieve a list of the output files of the workflow (i.e., those files that are output from some tasks but input to none)
std::vector< WorkflowFile * > wrench::Workflow::getOutputFiles | ( | ) | const |
Retrieve a list of the output files of the workflow (i.e., those files that are output from some tasks but input to none)
std::map< std::string, std::vector< WorkflowTask * > > wrench::Workflow::getReadyClusters | ( | ) |
Get a map of clusters composed of ready tasks.
std::vector< WorkflowTask * > wrench::Workflow::getReadyTasks | ( | ) |
Get a vector of ready tasks.
|
static |
Get the total number of flops for a list of tasks.
tasks | a vector of tasks |
WorkflowTask * wrench::Workflow::getTaskByID | ( | const std::string & | id | ) |
Find a WorkflowTask based on its ID.
id | a string id |
std::invalid_argument |
std::vector< WorkflowTask * > wrench::Workflow::getTaskChildren | ( | const WorkflowTask * | task | ) |
Get the list of children for a task.
task | a workflow task |
std::map< std::string, WorkflowTask * > wrench::Workflow::getTaskMap | ( | ) |
Get the list of all tasks in the workflow.
long wrench::Workflow::getTaskNumberOfChildren | ( | const WorkflowTask * | task | ) |
Get the number of children for a task.
task | a workflow task |
long wrench::Workflow::getTaskNumberOfParents | ( | const WorkflowTask * | task | ) |
Get the number of parents for a task.
task | a workflow task |
std::vector< WorkflowTask * > wrench::Workflow::getTaskParents | ( | const WorkflowTask * | task | ) |
Get the list of parents for a task.
task | a workflow task |
std::vector< WorkflowTask * > wrench::Workflow::getTasks | ( | ) |
Get the list of all tasks in the workflow.
std::vector< WorkflowTask * > wrench::Workflow::getTasksInTopLevelRange | ( | unsigned long | min, |
unsigned long | max | ||
) |
Returns all tasks with top-levels in a range.
min | the low end of the range (inclusive) |
max | the high end of the range (inclusive) |
bool wrench::Workflow::isDone | ( | ) |
Returns whether all tasks are complete.
bool wrench::Workflow::pathExists | ( | const WorkflowTask * | src, |
const WorkflowTask * | dst | ||
) |
Determine whether one source is an ancestor of a destination task.
src | the source task |
dst | the destination task |
void wrench::Workflow::removeControlDependency | ( | WorkflowTask * | src, |
WorkflowTask * | dst | ||
) |
Remove a control dependency between tasks (does nothing if none)
src | the source task |
dst | the destination task |
void wrench::Workflow::removeFile | ( | WorkflowFile * | file | ) |
Remove a file from the workflow. WARNING: this method de-allocated memory_manager_service for the file, making any pointer to the file invalid.
file | a file |
std::invalid_argument |
void wrench::Workflow::removeTask | ( | WorkflowTask * | task | ) |
Remove a task from the workflow. WARNING: this method de-allocated memory_manager_service for the task, making any pointer to the task invalid.
task | a task |
std::invalid_argument |