10 #ifndef WRENCH_WORKFLOW_H
11 #define WRENCH_WORKFLOW_H
16 #include "wrench/workflow/execution_events/WorkflowExecutionEvent.h"
17 #include "WorkflowFile.h"
18 #include "WorkflowTask.h"
19 #include "DagOfTasks.h"
21 #include <boost/graph/adjacency_list.hpp>
39 unsigned long min_num_cores,
40 unsigned long max_num_cores,
41 double parallel_efficiency,
42 double memory_requirement);
54 static double getSumFlops(
const std::vector<WorkflowTask *> tasks);
67 std::vector<WorkflowFile *>
getFiles()
const;
68 std::map<std::string, WorkflowFile *>
getFileMap()
const;
74 std::vector<WorkflowTask *>
getTasks();
75 std::map<std::string, WorkflowTask *>
getTaskMap();
126 typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, Vertex> DAG;
127 typedef boost::graph_traits<DAG>::vertex_descriptor vertex_t;
131 std::map<std::string, std::unique_ptr<WorkflowTask>> tasks;
132 std::map<std::string, std::unique_ptr<WorkflowFile>> files;
135 std::string callback_mailbox;
141 #endif //WRENCH_WORKFLOW_H
std::map< std::string, std::vector< WorkflowTask * > > getReadyClusters()
Get a map of clusters composed of ready tasks.
Definition: Workflow.cpp:345
std::map< std::string, WorkflowTask * > getTaskMap()
Get the list of all tasks in the workflow.
Definition: Workflow.cpp:394
An internal class that uses the Boost Graph Library to implement a DAG of WorkflowTask objects.
Definition: DagOfTasks.h:40
void removeControlDependency(WorkflowTask *src, WorkflowTask *dest)
Remove a control dependency between tasks (does nothing if none)
Definition: Workflow.cpp:200
WorkflowFile * addFile(std::string, double)
Add a new file to the workflow.
Definition: Workflow.cpp:244
std::vector< WorkflowFile * > getFiles() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:433
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 task...
Definition: Workflow.cpp:563
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 pa...
Definition: Workflow.cpp:175
std::vector< WorkflowTask * > getTaskChildren(const WorkflowTask *task)
Get the list of children for a task.
Definition: Workflow.cpp:448
std::vector< WorkflowTask * > getTasksInTopLevelRange(unsigned long min, unsigned long max)
Returns all tasks with top-levels in a range.
Definition: Workflow.cpp:610
std::shared_ptr< WorkflowExecutionEvent > waitForNextExecutionEvent()
Wait for the next workflow execution event.
Definition: Workflow.cpp:502
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.
Definition: Workflow.cpp:625
bool pathExists(const WorkflowTask *src, const WorkflowTask *dst)
Determine whether one source is an ancestor of a destination task.
Definition: Workflow.cpp:308
The compute service base class.
Definition: ComputeService.h:35
long getTaskNumberOfParents(const WorkflowTask *task)
Get the number of parents for a task.
Definition: Workflow.cpp:490
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 ...
Definition: Workflow.cpp:547
std::map< std::string, WorkflowTask * > getExitTaskMap() const
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
Definition: Workflow.cpp:659
void exportToEPS(std::string)
Output the workflow's dependency graph to EPS.
Definition: Workflow.cpp:287
WorkflowFile * getFileByID(const std::string &id)
Find a WorkflowFile based on its ID.
Definition: Workflow.cpp:273
void removeTask(WorkflowTask *task)
Remove a task from the workflow. WARNING: this method de-allocated memory for the task,...
Definition: Workflow.cpp:114
A workflow (to be executed by a WMS)
Definition: Workflow.h:33
std::vector< WorkflowTask * > getTaskParents(const WorkflowTask *task)
Get the list of parents for a task.
Definition: Workflow.cpp:476
std::string getCallbackMailbox()
Get the mailbox name associated to this workflow.
Definition: Workflow.cpp:521
A computational task in a Workflow.
Definition: WorkflowTask.h:27
bool isDone()
Returns whether all tasks are complete.
Definition: Workflow.cpp:379
WorkflowTask * addTask(std::string, double flops, unsigned long min_num_cores, unsigned long max_num_cores, double parallel_efficiency, double memory_requirement)
Create and add a new computational task to the workflow.
Definition: Workflow.cpp:40
static double getSumFlops(const std::vector< WorkflowTask * > tasks)
Get the total number of flops for a list of tasks.
Definition: Workflow.cpp:596
double getCompletionDate()
Returns the workflow's completion date.
Definition: Workflow.cpp:711
long getTaskNumberOfChildren(const WorkflowTask *task)
Get the number of children for a task.
Definition: Workflow.cpp:462
unsigned long getNumberOfTasks()
Get the number of tasks in the workflow.
Definition: Workflow.cpp:296
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:45
void removeFile(WorkflowFile *file)
Remove a file from the workflow. WARNING: this method de-allocated memory for the file,...
Definition: Workflow.cpp:89
std::vector< WorkflowFile * > getOutputFiles() const
Retrieve a list of the output files of the workflow (i.e., those files that are output from some task...
Definition: Workflow.cpp:579
Workflow()
Constructor.
Definition: Workflow.cpp:315
std::vector< WorkflowTask * > getExitTasks() const
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
Definition: Workflow.cpp:676
unsigned long getNumLevels()
Returns the number of levels in the workflow.
Definition: Workflow.cpp:693
std::map< std::string, WorkflowFile * > getFileMap() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:420
WorkflowTask * getTaskByID(const std::string &id)
Find a WorkflowTask based on its ID.
Definition: Workflow.cpp:158
std::vector< WorkflowTask * > getReadyTasks()
Get a vector of ready tasks.
Definition: Workflow.cpp:325
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::vector< WorkflowTask * > getEntryTasks() const
Get the list of exit tasks of the workflow, i.e., those tasks that don't have parents.
Definition: Workflow.cpp:642
std::vector< WorkflowTask * > getTasks()
Get the list of all tasks in the workflow.
Definition: Workflow.cpp:407
A workflow management system (WMS)
Definition: WMS.h:42
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 ...
Definition: Workflow.cpp:531