|
DPsim
|
#include <Scheduler.h>
Classes | |
| class | Root |
Public Types | |
| typedef std::unordered_map< CPS::Task::Ptr, std::deque< CPS::Task::Ptr > > | Edges |
| typedef std::chrono::steady_clock::duration | TaskTime |
| Time measurement for the task execution. | |
Public Member Functions | |
| Scheduler (CPS::Logger::Level logLevel=CPS::Logger::Level::off) | |
| virtual | ~Scheduler () |
| virtual void | createSchedule (const CPS::Task::List &tasks, const Edges &inEdges, const Edges &outEdges)=0 |
| Creates the schedule for the given dependency graph. | |
| virtual void | step (Real time, Int timeStepCount)=0 |
| Performs a single simulation step. | |
| virtual void | stop () |
| Called on simulation stop to reliably clean up e.g. running helper threads. | |
| void | resolveDeps (CPS::Task::List &tasks, Edges &inEdges, Edges &outEdges) |
| TaskTime | getAveragedMeasurement (CPS::Task::Ptr task) |
Static Public Attributes | |
| static CPS::AttributeBase::Ptr | external |
Protected Member Functions | |
| void | topologicalSort (const CPS::Task::List &tasks, const Edges &inEdges, const Edges &outEdges, CPS::Task::List &sortedTasks) |
| Simple topological sort, filtering out tasks that do not need to be executed. | |
| void | initMeasurements (const CPS::Task::List &tasks) |
| void | updateMeasurement (CPS::Task *task, TaskTime time) |
| void | writeMeasurements (CPS::String filename) |
| Write measurement data to file. | |
| void | readMeasurements (CPS::String filename, std::unordered_map< CPS::String, TaskTime::rep > &measurements) |
| Read measurement data from file to use it for the scheduling. | |
| TaskTime | getAveragedMeasurement (CPS::Task *task) |
Static Protected Member Functions | |
| static void | levelSchedule (const CPS::Task::List &tasks, const Edges &inEdges, const Edges &outEdges, std::vector< CPS::Task::List > &levels) |
Protected Attributes | |
| CPS::Task::Ptr | mRoot |
| CPS::Logger::Level | mLogLevel |
| Log level. | |
| CPS::Logger::Log | mSLog |
| Logger. | |
Definition at line 27 of file Scheduler.h.
| typedef std::unordered_map<CPS::Task::Ptr, std::deque<CPS::Task::Ptr> > DPsim::Scheduler::Edges |
Edges describe the dependency from the first task to a list of other tasks or the other way around.
Definition at line 31 of file Scheduler.h.
| typedef std::chrono::steady_clock::duration DPsim::Scheduler::TaskTime |
Time measurement for the task execution.
Definition at line 33 of file Scheduler.h.
|
inline |
Definition at line 36 of file Scheduler.h.
|
inlinevirtual |
Definition at line 43 of file Scheduler.h.
|
pure virtual |
Creates the schedule for the given dependency graph.
Implemented in DPsim::OpenMPLevelScheduler, DPsim::SequentialScheduler, DPsim::ThreadLevelScheduler, and DPsim::ThreadListScheduler.
|
protected |
Definition at line 65 of file Scheduler.cpp.
|
inline |
Definition at line 65 of file Scheduler.h.
|
protected |
Definition at line 21 of file Scheduler.cpp.
|
staticprotected |
Separate topologically sorted list of tasks into levels which can be executed in parallel
Definition at line 190 of file Scheduler.cpp.
|
protected |
Read measurement data from file to use it for the scheduling.
Definition at line 45 of file Scheduler.cpp.
| void Scheduler::resolveDeps | ( | CPS::Task::List & | tasks, |
| Edges & | inEdges, | ||
| Edges & | outEdges ) |
Helper function that resolves the task-attribute dependencies to task-task dependencies and inserts a root task
CHECK: Having external be the nullptr can lead to segfaults rather quickly. Maybe make it a special kind of attribute
Definition at line 78 of file Scheduler.cpp.
Performs a single simulation step.
Implemented in DPsim::OpenMPLevelScheduler, DPsim::SequentialScheduler, and DPsim::ThreadScheduler.
|
inlinevirtual |
Called on simulation stop to reliably clean up e.g. running helper threads.
Reimplemented in DPsim::OpenMPLevelScheduler, DPsim::SequentialScheduler, and DPsim::ThreadScheduler.
Definition at line 53 of file Scheduler.h.
|
protected |
Simple topological sort, filtering out tasks that do not need to be executed.
Definition at line 120 of file Scheduler.cpp.
Not thread-safe for multiple calls with same task, but should only be called once for each task in each step anyway
Definition at line 28 of file Scheduler.cpp.
|
protected |
Write measurement data to file.
Definition at line 32 of file Scheduler.cpp.
|
static |
Definition at line 63 of file Scheduler.h.
|
protected |
Log level.
Definition at line 104 of file Scheduler.h.
|
protected |
Definition at line 102 of file Scheduler.h.
|
protected |
Definition at line 106 of file Scheduler.h.