Top Up Prev Next Bottom Contents Index Search

15.2 Class ParGraph


Class ParGraph, derived from class ExpandedGraph, is an APEG graph for parallel schedulers. It has a constructor with no argument.

int createMe(Galaxy& g, int selfLoopFlag = 0);
Is the main routine to create and initialize the APEG of the argument Galaxy. Using createMe method of the ExpandedGraph class, it creates an APEG. After that, it resets the busy flags of the ParNodes, and calls

virtual int initializeGraph(); 
This is a protected method. It performs 4 main tasks as follows. (1) Call a protected method removeArcsWithDelay to remove the arcs with delays, and to store the source and the destination nodes of each removed arc into the list of NodePairs . The list is a protected member, named nodePairs of SequentialList class.

void removeArcsWithDelay(); 
SequentialList nodePairs;
(2) For each node, compute the static level (StaticLevel) by calling a protected method SetNodeSL.

int SetNodeSL(ParNode* n); 
(3) Sum the execution times of all nodes and save the total execution time to a protected member ExecTotal.

int ExecTotal; 
(4) Assign the larger static level than any other nodes to the nodes at the wormhole boundary. This let the parallel scheduler schedules the nodes at the wormhole boundary first.

15.2.1 Other ParGraph protected members

EGNode* newNode(DataFlowStar*, int);
Redefines the virtual method to create a ParNode associated with the given invocation of the argument star.

ostream* logstrm; 
This is a stream object for logging information.

15.2.2 Other ParGraph public members

EGNodeList runnableNodes; 
void findRunnableNodes();
The list of runnable (or fireable) nodes are stored in runnableNodes. The above method is to initialize the list with all root ParNodes.

int getExecTotal();
Galaxy* myGalaxy();
Returns the total execution time of the graph and the original graph.

void setLog(ostream* l); 
Sets the stream object logstrm.

void replenish(int flag); 
This method initialize the temporary ancestor list and descendant list of all ParNodes in the graph.

void sortedInsert(EGNodeList& l, ParNode* n, int flag); 
Insert a ParNode, n, into the EGNodeList, l, in sorted order. It sorts nodes of highest StaticLevel first if flag = 1, or lowest StaticLevel first if flag = 0.

void restoreHiddenGates(); 
This method restores the hidden EGGates from removeArcsWithDelay method to the initial list, either ancestors or descendants of the parent node.

int pairDistance(); 
After scheduling is completed, it is supposed to return the maximum scheduling distance between node pairs in nodePairs list. Currently, however, it just returns -1, indicating the information is not available.

~ParGraph(); 
The destructor initializes the nodePairs list.

15.2.3 Class NodePair

Class NodePair saves the source and the destination ParNodes of an arc.

NodePair(ParNode* src, ParNode* dest);
ParNode* getStart();
ParNode* getDest();
The constructor requires two arguments of the source and the destination nodes, while the next two methods return the node.



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.