Top Up Prev Next Bottom Contents Index Search

15.9 Class DLParProcs

Class DLParProcs, derived from the ParProcessors class, defines a main object to perform the dynamic level scheduling algorithm. It has a constructor with two arguments:

DLParProcs(int pNum, MultiTarget* t); 
The arguments are the number of processors and the pointer to the multiprocessor target. This method creates pNum UniProcessors for processing elements. These UniProcessors are deallocated in the destructor ~DLParProcs().

Based on the type of node described in scheduleIt method of the DLScheduler class, we call one of the following methods to schedule the node. scheduleSmall, scheduleBig, copyBigSchedule.

virtual void scheduleSmall(DLNode* n); 
This method is a public method to schedule an atomic node that will be scheduled on one processor. This is virtual since the HuParProcs class redefines this method. The scheduling procedure is as follows:

(1) Obtain the list of processors that can schedule this node. Refer to candidateProcs method of the CGMultiTarget class . Here, we examine the resource restriction of the processor, as well as the types of stars that a processor supports, in case of a heterogeneous target. If all invocations of a star should be scheduled to the same processor and another invocation of the star is already scheduled, we put only that processor only into the list of candidate processors that can schedule this node.

(2) Among all candidate processors, we select the processor that can schedule this node the earliest. In this stage, we consider all communication overhead if ancestors would be assigned to the different processors.

(3) Assign the node to that processor:

void assignNode(DLNode* n, int destP, int time); 
Is a protected method to assign an atomic node (n) to the processor of index destP at time. This method also schedules the communication requirements in the communication resources.

(4) Indicate that the node was fired:

virtual void fireNode(DLNode* node); 
It is a virtual and protected method. It fires the argument node and insert its descendants into the list of runnable nodes if they become runnable after this node is fired.

(5) Finally, we decrease the number of unscheduled nodes and the total remaining work of the DLGraph class.

The DLNode class has the pointer to the Profile class that determines the inside schedule of the node. We insert idle time slots to the processors to match the pattern of processor availability with the starting pattern of the profile and append the node at the end of the processors. We record the assignment of the profile to the processors in assignedId array of the Profile class . We also save the scheduling information in the DLNode: when the node is scheduled and completed, and on which processor it is scheduled. To determine the latter, we select the processor that the inside scheduler assumes the first processor it is assigned.

After appending the profile at the end of the available processors, we fire the node and update the variables of the DLGraph.



void initialize(DLGraph* graph); 
This method calls ParProcessors :: initialize and resets the candidate member to the index of the first UniProcessor, and myGraph member to graph argument.

DLGraph* myGraph; 
A protected members to store the pointer to the input APEG.

int costAssignedTo(DLNode* node, int destP, int start); 
This method is a protected method to compute the earliest time when the processor of index destP could schedule the node node that is runnable at time start.



Top Up Prev Next Bottom Contents Index Search

ptolemy@eecs.berkeley.edu
Copyright © 1990-1997, University of California. All rights reserved.