#include <Scheduler.h>
Inheritance diagram for DREAM::FixedPriorityScheduler:
Public Member Functions | |
FixedPriorityScheduler (const std::string &id, DREAM::System *system_ptr, uint CPUs=1) | |
Constructor. | |
virtual | ~FixedPriorityScheduler () |
Destructor. | |
virtual uint | CPUs () const |
Returns the number of CPUs managed by the FixedPriorityScheduler. | |
virtual bool | highestpriority (const DREAM::Node *node_ptr) const |
Returns true if the Task is deployed on the highest priority Thread. | |
virtual bool | lowestpriority (const DREAM::Node *node_ptr) const |
Returns true if the Task is deployed on the lowest priority Thread. | |
virtual bool | nonpreemptive () const |
Returns true if the Scheduler is non-preemptive (has only 1 thread). | |
virtual void | schedule (bool deterministic) throw (DREAM::Exception) |
Schedules a Node for execution. | |
virtual void | simulate (bool verbose, bool deterministic=false) |
Starts deterministic simulation. |
This class is the implementation of the static priority-based Scheduler in the DRE Semantic Domain.
Definition at line 460 of file Scheduler.h.
DREAM::FixedPriorityScheduler::FixedPriorityScheduler | ( | const std::string & | id, | |
DREAM::System * | system_ptr, | |||
uint | CPUs = 1 | |||
) |
DREAM::FixedPriorityScheduler::~FixedPriorityScheduler | ( | ) | [virtual] |
uint DREAM::FixedPriorityScheduler::CPUs | ( | ) | const [inline, virtual] |
Returns the number of CPUs managed by the FixedPriorityScheduler.
Reimplemented from DREAM::Scheduler.
Definition at line 624 of file Scheduler.cpp.
References DREAM::Scheduler::CPUs_.
bool DREAM::FixedPriorityScheduler::highestpriority | ( | const DREAM::Node * | node_ptr | ) | const [virtual] |
Returns true if the Task is deployed on the highest priority Thread.
Reimplemented from DREAM::Scheduler.
Definition at line 629 of file Scheduler.cpp.
References DREAM::Node::priority().
bool DREAM::FixedPriorityScheduler::lowestpriority | ( | const DREAM::Node * | node_ptr | ) | const [virtual] |
Returns true if the Task is deployed on the lowest priority Thread.
Reimplemented from DREAM::Scheduler.
Definition at line 645 of file Scheduler.cpp.
References DREAM::Node::priority().
bool DREAM::FixedPriorityScheduler::nonpreemptive | ( | ) | const [virtual] |
Returns true if the Scheduler is non-preemptive (has only 1 thread).
Reimplemented from DREAM::Scheduler.
Definition at line 661 of file Scheduler.cpp.
void DREAM::FixedPriorityScheduler::schedule | ( | bool | deterministic | ) | throw (DREAM::Exception) [virtual] |
Schedules a Node for execution.
This function will choose the highest subpriority Node in the highest priority frame and schedule it for execution by calling Node::execute (). Multiple Tasks will be scheduled from multi-threaded Lanes on a multiprocessor platform.
deterministic | specifies whether randomness is allowed. |
Reimplemented from DREAM::Scheduler.
Definition at line 669 of file Scheduler.cpp.
References DREAM::Thread::availablethreads(), DREAM::AVLTree< key_type, item_type >::begin(), DREAM::Task::execute(), DREAM::NodeList::find(), DREAM::System::find_current(), DREAM::Thread::get_exec_map(), DREAM::Thread::get_recent_avltree(), DREAM::Node::id(), DREAM::AVLTree< key_type, item_type >::insert(), maxuint, Option::race_condition_, DREAM::random(), DREAM::Thread::recent(), DREAM::Thread::scheduler(), DREAM::AVLTree< key_type, item_type >::size(), DREAM::Task::subpriority(), DREAM::Node::subpriority(), DREAM::Scheduler::system(), DREAM::Thread::trace(), DREAM::Thread::usethread(), and Option::verbose1_.
void DREAM::FixedPriorityScheduler::simulate | ( | bool | verbose, | |
bool | deterministic = false | |||
) | [virtual] |
Starts deterministic simulation.
This simulation will simulate a deterministic trace of the system.
Reimplemented from DREAM::Scheduler.
Definition at line 817 of file Scheduler.cpp.
References Option::simulation_time_.