FreePOOMA  2.4.1
Public Types | Public Member Functions | Protected Attributes | Friends
Smarts::Iterate< SerialAsync > Class Template Reference

Iterate<SerialAsync> is used to implement the SerialAsync scheduling policy. More...

#include <SerialAsync.h>

Inheritance diagram for Smarts::Iterate< SerialAsync >:
Inheritance graph
[legend]
Collaboration diagram for Smarts::Iterate< SerialAsync >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef DataObject< SerialAsyncDataObject_t
typedef IterateScheduler
< SerialAsync
IterateScheduler_t

Public Member Functions

 Iterate (IterateScheduler< SerialAsync > &s, int affinity=-1)
 The Constructor for this class takes the IterateScheduler and a CPU affinity.
virtual ~Iterate ()
 The dtor is virtual because the subclasses will need to add to it.
virtual void run ()=0
 The run method does the core work of the Iterate.
void notify ()
 Notify is used to indicate to the Iterate that one of the data objects it had requested has been granted.
int notifications () const
 How many notifications remain?
void addNotification ()
int & generation ()
int & togo ()
int affinity () const
 There is no such thing in serial.
int hintAffinity () const
void affinity (int)
void hintAffinity (int)

Protected Attributes

IterateScheduler< SerialAsync > & scheduler_m
 What scheduler are we working with?
int notifications_m
 How many notifications should we receive before we can run?
int generation_m
 Which generation we were issued in.
int togo_m
 How many times we need to go past a "did something" to be ready for destruction?

Friends

class IterateScheduler< SerialAsync >
class DataObject< SerialAsync >

Detailed Description

template<>
class Smarts::Iterate< SerialAsync >

Iterate<SerialAsync> is used to implement the SerialAsync scheduling policy.

An Iterate is a non-blocking unit of concurrency that is used to describe a chunk of work. It inherits from the Runnable class and as all subclasses of Runnable, the user specializes the run() method to specify the operation. Iterate<SerialAsync> is a further specialization of the Iterate class to use the SerialAsync Scheduling algorithm to generate the data dependency graph for a data-driven execution.


Member Typedef Documentation

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

Constructor & Destructor Documentation

Smarts::Iterate< SerialAsync >::Iterate ( IterateScheduler< SerialAsync > &  s,
int  affinity = -1 
) [inline]

The Constructor for this class takes the IterateScheduler and a CPU affinity.

CPU affinity has a default value of -1 which means it may run on any CPU available.

virtual Smarts::Iterate< SerialAsync >::~Iterate ( ) [inline, virtual]

The dtor is virtual because the subclasses will need to add to it.


Member Function Documentation

virtual void Smarts::Iterate< SerialAsync >::run ( ) [pure virtual]

The run method does the core work of the Iterate.

It is supplied by the subclass.

Reimplemented from Smarts::Runnable.

int Smarts::Iterate< SerialAsync >::affinity ( ) const [inline]

There is no such thing in serial.

int Smarts::Iterate< SerialAsync >::hintAffinity ( ) const [inline]
void Smarts::Iterate< SerialAsync >::affinity ( int  ) [inline]
void Smarts::Iterate< SerialAsync >::hintAffinity ( int  ) [inline]
void Smarts::Iterate< SerialAsync >::notify ( ) [inline]

Notify is used to indicate to the Iterate that one of the data objects it had requested has been granted.

To do this, we dec a dependence counter which, if equal to 0, the Iterate is ready for execution.

References Smarts::add().

Referenced by Smarts::IterateScheduler< SerialAsync >::handOff(), and Smarts::DataObject< SerialAsync >::request().

int Smarts::Iterate< SerialAsync >::notifications ( ) const [inline]

How many notifications remain?

void Smarts::Iterate< SerialAsync >::addNotification ( ) [inline]
int& Smarts::Iterate< SerialAsync >::generation ( ) [inline]
int& Smarts::Iterate< SerialAsync >::togo ( ) [inline]

Friends And Related Function Documentation

friend class IterateScheduler< SerialAsync > [friend]
friend class DataObject< SerialAsync > [friend]

Member Data Documentation

IterateScheduler<SerialAsync>& Smarts::Iterate< SerialAsync >::scheduler_m [protected]

What scheduler are we working with?

int Smarts::Iterate< SerialAsync >::notifications_m [protected]

How many notifications should we receive before we can run?

Referenced by Smarts::DataObject< SerialAsync >::request().

int Smarts::Iterate< SerialAsync >::generation_m [protected]

Which generation we were issued in.

int Smarts::Iterate< SerialAsync >::togo_m [protected]

How many times we need to go past a "did something" to be ready for destruction?


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