Smarts::IterateScheduler< SerialAsync > Class Template Reference

Implements a asynchronous scheduler for a data driven execution. More...

#include <SerialAsync.h>

List of all members.

Public Types

typedef DataObject< SerialAsyncDataObject_t
typedef Iterate< SerialAsyncIterate_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 >


Detailed Description

template<>
class Smarts::IterateScheduler< 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.


Member Typedef Documentation

typedef DataObject<SerialAsync> Smarts::IterateScheduler< SerialAsync >::DataObject_t

typedef Iterate<SerialAsync> Smarts::IterateScheduler< SerialAsync >::Iterate_t


Constructor & Destructor Documentation

Smarts::IterateScheduler< SerialAsync >::IterateScheduler (  )  [inline]

Smarts::IterateScheduler< SerialAsync >::~IterateScheduler (  )  [inline]


Member Function Documentation

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]


Friends And Related Function Documentation

friend class DataObject< SerialAsync > [friend]

friend class Iterate< SerialAsync > [friend]


The documentation for this class was generated from the following file:

Generated on Wed Mar 16 06:22:48 2011 for FreePOOMA by  doxygen 1.5.9