DPsim
Loading...
Searching...
No Matches
OpenMPLevelScheduler.h
Go to the documentation of this file.
1/* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2 * EONERC, RWTH Aachen University
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 *********************************************************************************/
8
9#pragma once
10
11#include <dpsim/Scheduler.h>
12
13#include <vector>
14
15namespace DPsim {
17public:
18 OpenMPLevelScheduler(Int threads = -1, String outMeasurementFile = String());
19 void createSchedule(const CPS::Task::List &tasks, const Edges &inEdges,
20 const Edges &outEdges);
21 void step(Real time, Int timeStepCount);
22 void stop();
23
24private:
25 Int mNumThreads;
26 String mOutMeasurementFile;
27 std::vector<CPS::Task::List> mLevels;
28};
29}; // namespace DPsim
std::vector< Ptr > List
Definition Task.h:28
void step(Real time, Int timeStepCount)
Performs a single simulation step.
void stop()
Called on simulation stop to reliably clean up e.g. running helper threads.
void createSchedule(const CPS::Task::List &tasks, const Edges &inEdges, const Edges &outEdges)
Creates the schedule for the given dependency graph.
OpenMPLevelScheduler(Int threads=-1, String outMeasurementFile=String())
Scheduler(CPS::Logger::Level logLevel=CPS::Logger::Level::off)
Definition Scheduler.h:36
std::unordered_map< CPS::Task::Ptr, std::deque< CPS::Task::Ptr > > Edges
Definition Scheduler.h:31
CPS::Real Real
Definition Definitions.h:18
CPS::String String
Definition Definitions.h:20
CPS::Int Int
Definition Definitions.h:22