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:385
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:235
std::vector< WorkflowFile * > getFiles() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:424
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:554
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:439
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:616
bool pathExists(const WorkflowTask *src, const WorkflowTask *dst)
Determine whether one source is an ancestor of a destination task.
Definition: Workflow.cpp:299
The compute service base class.
Definition: ComputeService.h:33
long getTaskNumberOfParents(const WorkflowTask *task)
Get the number of parents for a task.
Definition: Workflow.cpp:481
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:538
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:650
void exportToEPS(std::string)
Output the workflow's dependency graph to EPS.
Definition: Workflow.cpp:278
WorkflowFile * getFileByID(const std::string &id)
Find a WorkflowFile based on its ID.
Definition: Workflow.cpp:264
void removeTask(WorkflowTask *task)
Remove a task from the workflow. WARNING: this method de-allocated memory_manager_service for the tas...
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:467
A computational task in a Workflow.
Definition: WorkflowTask.h:31
bool isDone()
Returns whether all tasks are complete.
Definition: Workflow.cpp:370
static double getSumFlops(const std::vector< WorkflowTask * > tasks)
Get the total number of flops for a list of tasks.
Definition: Workflow.cpp:587
double getCompletionDate()
Returns the workflow's completion date.
Definition: Workflow.cpp:702
long getTaskNumberOfChildren(const WorkflowTask *task)
Get the number of children for a task.
Definition: Workflow.cpp:453
unsigned long getNumberOfTasks()
Get the number of tasks in the workflow.
Definition: Workflow.cpp:287
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_manager_service for the fil...
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:570
Workflow()
Constructor.
Definition: Workflow.cpp:306
std::vector< WorkflowTask * > getExitTasks() const
Get the exit tasks of the workflow, i.e., those tasks that don't have children.
Definition: Workflow.cpp:667
unsigned long getNumLevels()
Returns the number of levels in the workflow.
Definition: Workflow.cpp:684
std::map< std::string, WorkflowFile * > getFileMap() const
Get the list of all files in the workflow.
Definition: Workflow.cpp:411
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:633
std::vector< WorkflowTask * > getTasks()
Get the list of all tasks in the workflow.
Definition: Workflow.cpp:398
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:522