Top Up Prev Next Bottom Contents Index Search

15.4 class ParProcessors


Class ParProcessors is the base class for all actual scheduler object. Refer to derived classes to see how scheduling is performed. This class just provide the set of common members and methods. Among them, there is a list scheduling routine.

int listSchedule(ParGraph* graph); 
This method performs the list scheduling with the input argument APEG. It should be called after all nodes are assigned to the processors. It is the last routine to be called for all parallel schedulers. It adds communication nodes to the APEG (findCommNodes) and schedule them with the regular ParNodes. It returns the makespan of the schedule.

void findCommNodes(ParGraph* graph); 
This method puts a pair of communication ParNodes, a send node and a receive node, on the arc between two nodes assigned to the different processors. Note that we use tempAncs and tempDescs list of ParNode class to insert these nodes instead of modifying the APEG. We store the newly created communication ParNodes in SCommNodes. The procedure consists of two stages. In the first stage, all regular arcs in the APEG are considered. The StaticLevel of the send node is assigned to that of the source node plus one to ensure that the send node is scheduled right after the source node. The static level of the receive node is assigned to the same value as the destination node. In the second stage, all hidden arcs are considered. In this case, the StaticLevel of communication nodes are assigned to 1, the minimum value since they may be scheduled at the end of the schedule. The number of interprocessor requirements are saved in a protected member, commCount.

int getMakespan(); 
Returns the longest scheduled time among all UniProcessors.

15.4.1 Other ParProcessors protected members

int numProcs;
MultiTarget* mtarget;
EGNodeList SCommNodes;
These members specify the number of processors, the pointer to the multiprocessor target class, and the list of communication nodes added during listSchedule.

IntArray pIndex; 
Is used to access the processors in the order of available time.

void scheduleParNode(ParNode* node); 
This method schedules a parallel node (a wormhole or a data-parallel star) inside the listSchedule method. Note that the processors are already assigned for the node.

virtual ParNode* createCommNode(int i); 
Is a virtual method to create a ParNode with type given as an argument. It is virtual since the derived scheduler may want to create a node of derived class of ParNode.

void removeCommNodes(); 
Clears the SCommNodes list.

void sortWithAvailTime(int guard); 
Sort the processors with their available times unless no node is assigned to the processor. All idle processors are appended after the processors that are available at guard time and before the processor busy at guard time. Store the results to pIndex array.

int OSOPreq(); 
Returns TRUE or FALSE, based on whether all invocations of a star are enforced to be scheduled on the same processor or not.

15.4.2 Other ParProcessors public members

ParProcessors(int, MultiTarget*); 
virtual ~ParProcessors();
The constructor has two arguments: the number of processors and the target pointer. It creates pIndex array and initialize other data structures. The destructor clears SCommNodes.

void mapTargets(IntArray* array);
void prepareCodeGen();
void createSubGals();
void generateCode();
The above methods perform the actual action defined in the ParScheduler class. For description, refer to class ParScheduler. The last method deliver the generate code from each processor to the target class.

int size(); 
returns the number of processors.

virtual UniProcessor* getProc(int num); 
This method returns the UniProcessor with a given index. It is virtual since the derived class wants to return it own specific class derived from UniProcessor class.

void initialize(); 
Initializes pIndex, SCommNodes, and processors.

StringList display(NamedObj* gal);
StringList displaySubUnivs();
These methods return the StringList contains the scheduling result and the sub-universe description.

ParNode* matchCommNodes(DataFlowStar*, EGGate*, PortHole);
This method is used in sub-universe generation. The first argument is a communication star, either a send star or a receive star, that the system automatically inserts for interprocessor communication. The second argument is the EGGate that the interprocessor communication (IPC) occurs. If the second argument is NULL, the third argument indicates the porthole that the IPC occurs. In case all invocations of any star are assigned to the same processor, the sub-universe creation procedure is greatly simplified: we do not need to look at the APEG, rather look at the original SDF graph to create the sub-universe. It is the case when the second argument becomes NULL. This method sets the pointer of the communication star to the corresponding ParNode that are inserted during listSchedule method.



Top Up Prev Next Bottom Contents Index Search

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