FreePOOMA
2.4.1
|
Implements a asynchronous scheduler for a data driven execution. More...
#include <SerialAsync.h>
Public Types | |
typedef DataObject< SerialAsync > | DataObject_t |
typedef Iterate< SerialAsync > | Iterate_t |
Public Member Functions | |
IterateScheduler () | |
~IterateScheduler () | |
void | setConcurrency (int) |
void | beginGeneration () |
Tells the scheduler that the parser thread is starting a new data-parallel statement. | |
void | endGeneration () |
Tells the scheduler that no more Iterates will be handed off for the data parallel statement that was begun with a beginGeneration(). | |
bool | inGeneration () const |
Wether we are inside a generation and may not safely block. | |
int | generation () const |
What the current generation is. | |
void | blockingEvaluate () |
The parser thread calls this method to evaluate the generated graph until all the nodes in the dependence graph has been executed by the scheduler. | |
void | handOff (Iterate< SerialAsync > *it) |
The parser thread calls this method to ask the scheduler to run the given Iterate when the dependence on that Iterate has been satisfied. | |
void | releaseIterates () |
Friends | |
class | DataObject< SerialAsync > |
class | Iterate< SerialAsync > |
Implements a asynchronous scheduler for a data driven execution.
Specializes a IterateScheduler.
The SerialAsync IterateScheduler, Iterate and DataObject implement a SMARTS scheduler that does dataflow without threads. What that means is that when you hand iterates to the IterateScheduler it stores them up until you call IterateScheduler::blockingEvaluate(), at which point it evaluates iterates until the queue is empty.
typedef DataObject<SerialAsync> Smarts::IterateScheduler< SerialAsync >::DataObject_t |
typedef Iterate<SerialAsync> Smarts::IterateScheduler< SerialAsync >::Iterate_t |
Smarts::IterateScheduler< SerialAsync >::IterateScheduler | ( | ) | [inline] |
Smarts::IterateScheduler< SerialAsync >::~IterateScheduler | ( | ) | [inline] |
void Smarts::IterateScheduler< SerialAsync >::setConcurrency | ( | int | ) | [inline] |
void Smarts::IterateScheduler< SerialAsync >::beginGeneration | ( | ) | [inline] |
Tells the scheduler that the parser thread is starting a new data-parallel statement.
Any Iterate that is handed off to the scheduler between beginGeneration() and endGeneration() belongs to the same data-paralllel statement and therefore has the same generation number. Nested invocations are handled as being part of the outermost generation.
void Smarts::IterateScheduler< SerialAsync >::endGeneration | ( | ) | [inline] |
Tells the scheduler that no more Iterates will be handed off for the data parallel statement that was begun with a beginGeneration().
References PAssert, and Smarts::SystemContext::runSomething().
bool Smarts::IterateScheduler< SerialAsync >::inGeneration | ( | ) | const [inline] |
Wether we are inside a generation and may not safely block.
int Smarts::IterateScheduler< SerialAsync >::generation | ( | ) | const [inline] |
What the current generation is.
void Smarts::IterateScheduler< SerialAsync >::blockingEvaluate | ( | ) | [inline] |
The parser thread calls this method to evaluate the generated graph until all the nodes in the dependence graph has been executed by the scheduler.
That is to say, the scheduler executes all the Iterates that has been handed off to it by the parser thread.
References Smarts::SystemContext::runSomething(), and Smarts::SystemContext::workReady().
void Smarts::IterateScheduler< SerialAsync >::handOff | ( | Iterate< SerialAsync > * | it | ) | [inline] |
The parser thread calls this method to ask the scheduler to run the given Iterate when the dependence on that Iterate has been satisfied.
References Smarts::Iterate< SerialAsync >::generation(), and Smarts::Iterate< SerialAsync >::notify().
void Smarts::IterateScheduler< SerialAsync >::releaseIterates | ( | ) | [inline] |
friend class DataObject< SerialAsync > [friend] |
friend class Iterate< SerialAsync > [friend] |