ParNode(DataFlowStar* Mas, int invoc_no);Initializes data members. If the argument star is at the wormhole boundary, we do not parallelize the invocations. Therefore, we create precedence relations between invocations by calling
claimStickyof EGNode class in the constructor. If this constructor is called, the
typeprotected member is set 0.
The ParNode class has another constructor with one argument.
ParNode(int type);The scheduling result is stored in UniProcessor class as a list of ParNodes. This constructor is to model idle time (
type= 1), or communication time (
type= -1 for sending time,
type= -2 for receiving time) as a ParNode
.It initializes data members.
int StaticLevel;Is set to the longest execution path to a termination node in the APEG. It defines the static level (or priority) of the node in Hu's scheduling algorithm. Initially it is set to 0.
int procIdIs the processor index on which this ParNode is scheduled. Initially it is set to 0.
int scheduledTime;Indicate when the node is scheduled and finished, respectively.
int exTime;Is the execution time of the node. If it is a regular node (
type= 0), it is set to the execution time of the original DataFlowStar. Otherwise, it is set to 0.
int waitNum;Indicates the number of ancestors to be scheduled before scheduling this node. during the scheduling procedure. Initially it is set to 0. At a certain point of scheduling procedure, we can schedule a ParNode only when all ancestors are already assigned, or
EGNodeList tempAncs;These list members are copies of the ancestors and descendants of the node. While EGGateLists,
descendants,may not be modified during scheduling procedure, these lists can be modified.
void assignSL(int SL);The first two methods set and get the
virtual int getLevel();
StaticLevelmember. The last one returns the priority of the node, which is just
StaticLevelby default. In the derived classes, this method can be redefined, for example in Dynamic Level Scheduling, to return the dynamic level of the node.
int getType();Returns the type of the node.
void setProcId(int i);These two methods set and get the
void setScheduledTime(int i);These methods are used to set or get the time when the node is scheduled first and finished.
void setFinishTime(int i);
void setExTime(int i);These methods are used to set and get the execution time of the node.
void resetWaitNum();Resets the
waitNumvariable to the number of ancestors, and increases it by 1.
int fireable();This method decreases
waitNumby one, and return
FALSE, based on whether
waitNumreaches zero or not. If it reaches 0, the node is declared "fireable".
void copyAncDesc(ParGraph* g, int flag);The first method initializes the lists of temporary ancestors and descendants,
void removeDescs(ParNode* n);
void removeAncs(ParNode* n);
void connectedTo(ParNode* to);
descendantsthat are inherited members from EGNode class. List
tempAncsis sorted smallest
StaticLevelfirst while list
tempDescsis sorted largest
StaticLevelfirst. The first argument is necessary to call the sorting routine which is defined in the ParGraph class . By virtue of sorting, we can traverse descendant with larger
StaticLevelfirst. If the second argument is not 0, we switch the lists: copy
The second and the third methods remove the argument node from the temporary descendant list or from the temporary ancestor list. In the latter case, we decrease
The last method above is to make a temporary connection between the node as the source and the argument node as the destination. The temporary descendant list of the current node is added the argument node while the temporary ancestor list of the argument node is added the current node (also increase
waitNumof the argument node by 1).
CGStar* myStar();Returns the original DataFlowStar after casting the type to CGStar, star class type of the CG domain.
FALSE, based on whether
myStaris a wormhole or not. Before the scheduling is performed in the top-level graph, the wormhole executes scheduling the inside galaxy and stores the scheduling results in the Profile object . The ParNode keeps the pointer to the Profile object if it is an invocation of the wormhole. In the general context, the node will be considered "Big" if the master star can be scheduled onto more than one processors. Then, the star is supposed to keep the Profile object to store the schedules on the processors. A wormhole is a special case of those masters.
void setOSOPflag(int i);After scheduling is performed, we set a flag to indicate whether all invocations of a star are assigned to the same processor or not, using the first method. The second method queries the flag. Note that only the
firstinvocation has the valid information.
void setCopyStar(DataFlowStar* s, ParNode* prevN);The above methods are used to create sub-universes . When we create a sub-universe, we make a copy of the master star if some invocations are assigned to the processor. Then, these invocations keep the pointer to the cloned star. Since all invocations may not be assigned to the same processor, we maintain the list of invocations assigned to the given processor. The first and second methods set and get the pointer to the cloned star. The first method also make a chain of the invocations assigned to the same processor. The third method returns the next invocation chained from the current node, while the fourth method returns the starting invocation of the chain. The last method returns the total number of invocations in the chain. It should be called at the starting invocation of the chain.
void setOrigin(EGGate* g);These methods manipulate the connection information of communication nodes. If two adjacent nodes in an APEG are assigned to two different processors, we insert communication nodes between them: Send and Receive nodes. As explained earlier, a communication node is created by one-argument constructor. The first two methods are related to which EGGate the communication node is connected. The last two methods concern the other communication node inserted.
void setPartner(ParNode* n);
tempAncs),and ParDescendantIter class returns the ParNodes in the temporary descendant list (