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>
22 #include <wrench/workflow/parallel_model/ParallelModel.h>
40 unsigned long min_num_cores,
41 unsigned long max_num_cores,
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();
95 std::vector<WorkflowTask *> getTasksInTopLevelRange(
unsigned long min,
unsigned long max);
97 std::vector<WorkflowTask *> getReadyTasks();
99 std::map<std::string, std::vector<WorkflowTask *>> getReadyClusters();
109 std::shared_ptr<WorkflowExecutionEvent> waitForNextExecutionEvent();
110 std::shared_ptr<WorkflowExecutionEvent> waitForNextExecutionEvent(
double timeout);
112 std::string getCallbackMailbox();
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, WorkflowTask * > getTaskMap()
Get the list of all tasks in the workflow.
Definition: Workflow.cpp:384
void removeControlDependency(WorkflowTask *src, WorkflowTask *dest)
Remove a control dependency between tasks (does nothing if none)
Definition: Workflow.cpp:190
WorkflowFile * addFile(std::string, double)
Add a new file to the workflow.
Definition: Workflow.cpp:234
std::vector< WorkflowFile * > getFiles() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:423
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:553
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:165
std::vector< WorkflowTask * > getTaskChildren(const WorkflowTask *task)
Get the list of children for a task.
Definition: Workflow.cpp:438
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:615
bool pathExists(const WorkflowTask *src, const WorkflowTask *dst)
Determine whether one source is an ancestor of a destination task.
Definition: Workflow.cpp:298
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:480
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:537
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.
Definition: Workflow.cpp:40
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:649
void exportToEPS(std::string)
Output the workflow's dependency graph to EPS.
Definition: Workflow.cpp:277
WorkflowFile * getFileByID(const std::string &id)
Find a WorkflowFile based on its ID.
Definition: Workflow.cpp:263
void removeTask(WorkflowTask *task)
Remove a task from the workflow. WARNING: this method de-allocated memory for the task,...
Definition: Workflow.cpp:104
A workflow (to be executed by a WMS)
Definition: Workflow.h:34
std::vector< WorkflowTask * > getTaskParents(const WorkflowTask *task)
Get the list of parents for a task.
Definition: Workflow.cpp:466
A computational task in a Workflow.
Definition: WorkflowTask.h:31
bool isDone()
Returns whether all tasks are complete.
Definition: Workflow.cpp:369
static double getSumFlops(const std::vector< WorkflowTask * > tasks)
Get the total number of flops for a list of tasks.
Definition: Workflow.cpp:586
double getCompletionDate()
Returns the workflow's completion date.
Definition: Workflow.cpp:701
long getTaskNumberOfChildren(const WorkflowTask *task)
Get the number of children for a task.
Definition: Workflow.cpp:452
unsigned long getNumberOfTasks()
Get the number of tasks in the workflow.
Definition: Workflow.cpp:286
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:46
void removeFile(WorkflowFile *file)
Remove a file from the workflow. WARNING: this method de-allocated memory for the file,...
Definition: Workflow.cpp:79
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:569
Workflow()
Constructor.
Definition: Workflow.cpp:305
std::vector< WorkflowTask * > getExitTasks() const
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
Definition: Workflow.cpp:666
unsigned long getNumLevels()
Returns the number of levels in the workflow.
Definition: Workflow.cpp:683
std::map< std::string, WorkflowFile * > getFileMap() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:410
WorkflowTask * getTaskByID(const std::string &id)
Find a WorkflowTask based on its ID.
Definition: Workflow.cpp:148
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:632
std::vector< WorkflowTask * > getTasks()
Get the list of all tasks in the workflow.
Definition: Workflow.cpp:397
A workflow management system (WMS)
Definition: WMS.h:43
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:521