DLScheduler(MultiTarget* t, const char* log, int i);The arguments are the pointer to the multiprocessor target, the name of the logging file, and a flag to indicate whether the communication overhead can be ignored or not. If the processor target has special hardware for communication separate from the CPU, then most of the communication can be simultaneous with processor computation. In this case, we do not reserve the communication time slot in the processor schedule but in the access schedule of the communication resources only. This mode of operation is selecte if
i
is set TRUE
. This is not implemented since we haven't dealt with that kind of architecture yet.There is a protected member to point to a ParProcessor class:
DLParProcs* parSched;
This pointer is set in the following redefined method:
void setUpProcs(int num);This method first performs
ParScheduler::setUpProcs,
and then create a DLParProcs object. While this class defines the overall procedure of the dynamic level scheduling algorithm, the DLParProcs class provides the details of the algorithm .
~DLScheduler();Deallocate the DLParProcs object.
The main procedure of the dynamic level schedule is defined in
int scheduleIt();This method does the following:
(1) Initializes the DLParProcs and resets the DLGraph and the communication resources of the multiprocessor target.
(2) Fetch a node from the list of runnable nodes until there are no more nodes in the list.
(2-1) If the node is not a parallel node, call
scheduleSmall
method of the DLParProcs class to schedule the node.(2-2) If the node is the first invocation of a parallel-star node, we give up. NOTE: We do not support parallel stars since we haven't had to deal with them yet.
(3) When there are no more runnable nodes, we check whether the graph is deadlocked. In case of successful completion, we perform an additional list scheduling (
listSchedule
of the ParProcessors class), based on the processor assignment determined by the above procedure.
StringList displaySchedule();Displays the final schedule results.