|
DPsim
|
#include <ThreadScheduler.h>
Public Member Functions | |
| ThreadScheduler (Int threads, String outMeasurementFile, Bool useConditionVariable) | |
| virtual | ~ThreadScheduler () |
| void | step (Real time, Int timeStepCount) |
| Performs a single simulation step. | |
| virtual void | stop () |
| Called on simulation stop to reliably clean up e.g. running helper threads. | |
Public Member Functions inherited from DPsim::Scheduler | |
| 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. | |
| void | resolveDeps (CPS::Task::List &tasks, Edges &inEdges, Edges &outEdges) |
| TaskTime | getAveragedMeasurement (CPS::Task::Ptr task) |
Protected Member Functions | |
| void | finishSchedule (const Edges &inEdges) |
| void | scheduleTask (int thread, CPS::Task::Ptr task) |
Protected Member Functions inherited from DPsim::Scheduler | |
| 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) |
Protected Attributes | |
| Int | mNumThreads |
Protected Attributes inherited from DPsim::Scheduler | |
| CPS::Task::Ptr | mRoot |
| CPS::Logger::Level | mLogLevel |
| Log level. | |
| CPS::Logger::Log | mSLog |
| Logger. | |
Additional Inherited Members | |
Public Types inherited from DPsim::Scheduler | |
| 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. | |
Static Public Attributes inherited from DPsim::Scheduler | |
| static CPS::AttributeBase::Ptr | external |
Static Protected Member Functions inherited from DPsim::Scheduler | |
| static void | levelSchedule (const CPS::Task::List &tasks, const Edges &inEdges, const Edges &outEdges, std::vector< CPS::Task::List > &levels) |
Definition at line 17 of file ThreadScheduler.h.
| ThreadScheduler::ThreadScheduler | ( | Int | threads, |
| String | outMeasurementFile, | ||
| Bool | useConditionVariable ) |
Definition at line 16 of file ThreadScheduler.cpp.
|
virtual |
Definition at line 26 of file ThreadScheduler.cpp.
|
protected |
Definition at line 35 of file ThreadScheduler.cpp.
|
protected |
Definition at line 31 of file ThreadScheduler.cpp.
Performs a single simulation step.
Implements DPsim::Scheduler.
Definition at line 67 of file ThreadScheduler.cpp.
|
virtual |
Called on simulation stop to reliably clean up e.g. running helper threads.
Reimplemented from DPsim::Scheduler.
Definition at line 81 of file ThreadScheduler.cpp.
|
protected |
Definition at line 30 of file ThreadScheduler.h.