PPL Logo

RouterStrategy Class Reference
[Strategies for use in converse]

Class that calls Krishnan's routers from the new Comlib. More...

#include <dummyconversestrategy.h>

Inheritance diagram for RouterStrategy:

Inheritance graph
[legend]
Collaboration diagram for RouterStrategy:

Collaboration graph
[legend]

Public Member Functions

 RouterStrategy ()
 RouterStrategy (CkMigrateMessage *m)
void insertMessage (MessageHolder *msg)
 Receive a message from the upper layer and buffer it in the msgQ until doneInserting is called.
void doneInserting ()
 Called after all messages have been deposited in this processor.
virtual void pup (PUP::er &p)
 Each strategy must define his own Pup interface.
 PUPable_decl (RouterStrategy)
 RouterStrategy (int stratid, int handle, int nsrc, int *srclist, int ndest=0, int *destlist=0)
 Constructor.
 RouterStrategy (CkMigrateMessage *m)
void setupRouter ()
 ~RouterStrategy ()
RoutergetRouter ()
comIDgetComID ()
virtual void insertMessage (MessageHolder *msg)
 Called for each message.
virtual void doneInserting ()
 Called after all messages have been deposited in this processor.
virtual void handleMessage (void *m)
 This function is not used since the Router uses its own handlers.
virtual void deliver (char *, int)
 This method can be used to deliver a message through the correct class.
void bracketedUpdatePeKnowledge (int *count)
 Update the router accordingly to the new information.
virtual void notifyDone ()
 Called when a subsystem scheme (like in bracketed EachToMany) terminates the requested routing operation.
intgetProcMap ()
virtual void pup (PUP::er &p)
 Each strategy must define his own Pup interface.
 PUPable_decl (RouterStrategy)

Protected Member Functions

 RouterStrategy (int stratid)
 Used only by subclasses to initialize partially.
char isAllToAll ()

Protected Attributes

int routerIDsaved
 Type of subsystem specified for the strategy, routerID can become USE_DIRECT if no objects are local, but then it can become again what required.

Private Member Functions

void setReverseMap ()

Private Attributes

Routerrouter
CkQ< MessageHolder * > msgQ
CkQ< char * > recvQ
CkQ< char * > procQ
CkQ< DummyMsg * > dummyQ
comID id
intpelist
 A list of all the processors involved in the operation, used when sending direcly without routing.
int npes
 Size of pelist.
intsrcPelist
 A sublist of pelist containing only processors which are source.
int nsrcPes
 Size of srcPelist.
intdestPelist
 A sublist of pelist containing only processors which are destination.
int ndestPes
 size of destPelist
intprocMap
 A list of size CkNumPes() which associate each processor number with the position it occupies in pelist (basically procMap[i]=pelist.indexOf(i)).
intbcast_pemap
 A simple array of size npes, where bcast_pemap[i]=i.
int myPe
 Position occupied by this processor in the list of processors currently involved in this operation.
int routerID
 Type of Router used by the strategy as subsystem.
int doneHandle
int doneFlag
int bufferedDoneInserting
intnewKnowledge
 The processor list used to update the knowledge of the strategy is stored here if when it is delivered there is still an operation in execution.
int newKnowledgeSize
 Size of newKnowledge when it is in use.
intnewKnowledgeSrc
 Similar to newKnowledge only for the source list.
int newKnowledgeSrcSize
 Size of newKnowledgeSrc when it is in use.
intnewKnowledgeDest
 Similar to newKnowledge only for the destination list.
int newKnowledgeDestSize
 Size of newKnowledgeDest when it is in use.

Detailed Description

Class that calls Krishnan's routers from the new Comlib.

Developed to be called from Converse and from Charm through inheritance by high level strategies.

Strategy optimizes all-to-all communication. It combines messages and sends them along virtual topologies 2d mesh, 3d mesh and hypercube routers.

For large messages send them directly.

Sameer Kumar 05/14/04

Definition at line 15 of file dummyconversestrategy.h.


Constructor & Destructor Documentation

RouterStrategy::RouterStrategy (  ) 

RouterStrategy::RouterStrategy ( CkMigrateMessage m  )  [inline]

Definition at line 18 of file dummyconversestrategy.h.

RouterStrategy::RouterStrategy ( CkMigrateMessage m  )  [inline]

Definition at line 113 of file routerstrategy.h.

References Converse::CkMyPe(), and ComlibPrintf().


Member Function Documentation

RouterStrategy::PUPable_decl ( RouterStrategy   ) 

char RouterStrategy::isAllToAll (  )  [inline, protected]

Definition at line 101 of file routerstrategy.h.

Referenced by EachToManyMulticastStrategy::deliver().

Router* RouterStrategy::getRouter (  )  [inline]

Definition at line 120 of file routerstrategy.h.

References router.

Referenced by routerDummyMsg(), routerProcManyCombinedMsg(), and routerRecvManyCombinedMsg().

comID& RouterStrategy::getComID (  )  [inline]

Definition at line 121 of file routerstrategy.h.

References id.

Referenced by routerProcManyCombinedMsg(), and routerRecvManyCombinedMsg().

virtual void RouterStrategy::insertMessage ( MessageHolder msg  )  [virtual]

Called for each message.

Implements Strategy.

Reimplemented in EachToManyMulticastStrategy.

virtual void RouterStrategy::doneInserting ( void   )  [virtual]

Called after all messages have been deposited in this processor.

This corresponds to a call to ComlibEnd(cinst), where cinst is the ComlibInstanceHandle returned when registering the Strategy with Comlib. In higher levels this may need many ComlibEnd calls before invoking doneInserting.

Reimplemented from Strategy.

virtual void RouterStrategy::handleMessage ( void *  m  )  [inline, virtual]

This function is not used since the Router uses its own handlers.

Implements Strategy.

Reimplemented in EachToManyMulticastStrategy.

Definition at line 129 of file routerstrategy.h.

References CmiAbort().

int* RouterStrategy::getProcMap (  )  [inline]

Definition at line 143 of file routerstrategy.h.

References procMap.

virtual void RouterStrategy::pup ( PUP::er p  )  [virtual]

Each strategy must define his own Pup interface.

Reimplemented from Strategy.

Reimplemented in EachToManyMulticastStrategy.

RouterStrategy::PUPable_decl ( RouterStrategy   ) 


Field Documentation

Definition at line 36 of file routerstrategy.h.

Referenced by doneInserting(), and insertMessage().

CkQ<char *> RouterStrategy::recvQ [private]

Definition at line 37 of file routerstrategy.h.

CkQ<char *> RouterStrategy::procQ [private]

Definition at line 37 of file routerstrategy.h.

Definition at line 38 of file routerstrategy.h.

Definition at line 40 of file routerstrategy.h.

Referenced by getComID(), and pup().

A list of all the processors involved in the operation, used when sending direcly without routing.

This array is shared with the router.

Definition at line 43 of file routerstrategy.h.

Referenced by pup(), RouterStrategy(), setReverseMap(), setupRouter(), and ~RouterStrategy().

Size of pelist.

Definition at line 45 of file routerstrategy.h.

Referenced by insertMessage(), pup(), setReverseMap(), and setupRouter().

A sublist of pelist containing only processors which are source.

Definition at line 47 of file routerstrategy.h.

Referenced by pup(), setupRouter(), and ~RouterStrategy().

Size of srcPelist.

Definition at line 49 of file routerstrategy.h.

Referenced by pup(), and setupRouter().

A sublist of pelist containing only processors which are destination.

Definition at line 51 of file routerstrategy.h.

Referenced by insertMessage(), pup(), setupRouter(), and ~RouterStrategy().

size of destPelist

Definition at line 53 of file routerstrategy.h.

Referenced by insertMessage(), pup(), and setupRouter().

A list of size CkNumPes() which associate each processor number with the position it occupies in pelist (basically procMap[i]=pelist.indexOf(i)).

Definition at line 57 of file routerstrategy.h.

Referenced by getProcMap(), insertMessage(), pup(), RouterStrategy(), setReverseMap(), and ~RouterStrategy().

A simple array of size npes, where bcast_pemap[i]=i.

Definition at line 59 of file routerstrategy.h.

Referenced by insertMessage(), pup(), RouterStrategy(), setupRouter(), and ~RouterStrategy().

Position occupied by this processor in the list of processors currently involved in this operation.

Definition at line 62 of file routerstrategy.h.

Referenced by doneInserting(), setReverseMap(), and setupRouter().

Type of Router used by the strategy as subsystem.

Definition at line 64 of file routerstrategy.h.

Referenced by doneInserting(), insertMessage(), and setupRouter().

Definition at line 66 of file routerstrategy.h.

Referenced by notifyDone(), pup(), and RouterStrategy().

Definition at line 70 of file routerstrategy.h.

Referenced by doneInserting(), notifyDone(), pup(), and RouterStrategy().

The processor list used to update the knowledge of the strategy is stored here if when it is delivered there is still an operation in execution.

In this case we have to wait for it to finish, and then proceed to update the Router.

Definition at line 76 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), notifyDone(), pup(), RouterStrategy(), and setupRouter().

Size of newKnowledge when it is in use.

Definition at line 78 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), pup(), RouterStrategy(), and setupRouter().

Similar to newKnowledge only for the source list.

Definition at line 80 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), pup(), RouterStrategy(), and setupRouter().

Size of newKnowledgeSrc when it is in use.

Definition at line 82 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), pup(), RouterStrategy(), and setupRouter().

Similar to newKnowledge only for the destination list.

Definition at line 84 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), pup(), RouterStrategy(), and setupRouter().

Size of newKnowledgeDest when it is in use.

Definition at line 86 of file routerstrategy.h.

Referenced by bracketedUpdatePeKnowledge(), pup(), RouterStrategy(), and setupRouter().

Type of subsystem specified for the strategy, routerID can become USE_DIRECT if no objects are local, but then it can become again what required.

Definition at line 99 of file routerstrategy.h.

Referenced by EachToManyMulticastStrategy::commonInit(), pup(), RouterStrategy(), and setupRouter().


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

Generated on Fri May 25 08:05:15 2012 for Charm++ by  doxygen 1.5.5