|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.util.Attribute
ptolemy.actor.Director
ptolemy.actor.sched.StaticSchedulingDirector
ptolemy.domains.sdf.kernel.SDFDirector
ptolemy.distributed.domains.sdf.kernel.DistributedSDFDirector
public class DistributedSDFDirector
Director for the distributed version of the synchronous dataflow (SDF) model of computation.
A DistributedSDFDirector is the class that controls execution of actors under the distributed version of the SDF domain. It extends SDFDirector.
By default, actor scheduling is handled by the DistributedSDFScheduler class. Furthermore, the newReceiver method creates Receivers of type DistributedSDFReceiver, which extends SDFReceiver.
See ptolemy.domains.sdf.kernel.SDFScheduler for more information about the SDF Domain.
DistributedServerRMIGeneric
,
DistributedSDFReceiver
,
DistributedSDFScheduler
,
SDFDirector
,
SDFScheduler
,
Serialized Form
Red (cxh) |
Red (kapokasa) |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj |
---|
NamedObj.ContainedObjectsIterator |
Field Summary | |
---|---|
private java.util.HashMap |
actorsThreadsMap
Map of Actors to Threads (that contain the Service). |
private ClientServerInteractionManager |
clientServerInteractionManager
Encapsulates Jini functionality. |
(package private) java.util.HashMap |
commandsMap
Map of commands to be executed. |
private java.lang.String |
configFileName
The name of the Jini configuration file to be provided to the ClientServerInteractionManager. |
Parameter |
parallelExecution
A Parameter representing whether a sequential or parallel execution will be performed. |
Parameter |
parallelSchedule
A Parameter representing whether a sequential or parallel schedule will be computed. |
Parameter |
pipelining
A Parameter representing whether a pipelined parallel execution will be performed. |
private ThreadSynchronizer |
synchronizer
Performs synchronization of the ClientThreads and used to issue commandMaps. |
private boolean |
VERBOSE
It states whether debugging messages should be printed. |
Fields inherited from class ptolemy.domains.sdf.kernel.SDFDirector |
---|
_iterationCount, _periodicDirectorHelper, allowDisconnectedGraphs, allowRateChanges, constrainBufferSizes, iterations, period, synchronizeToRealTime, vectorizationFactor |
Fields inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_postfireReturns |
Fields inherited from class ptolemy.actor.Director |
---|
_actorsFinishedExecution, _currentTime, _finishRequested, _initializables, _stopRequested, timeResolution |
Fields inherited from class ptolemy.kernel.util.NamedObj |
---|
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
Fields inherited from interface ptolemy.actor.Executable |
---|
COMPLETED, NOT_READY, STOP_ITERATING |
Constructor Summary | |
---|---|
DistributedSDFDirector()
Construct a director in the default workspace with an empty string as its name. |
|
DistributedSDFDirector(CompositeEntity container,
java.lang.String name)
Construct a director in the given container with the given name. |
|
DistributedSDFDirector(Workspace workspace)
Construct a director in the workspace with an empty name. |
Method Summary | |
---|---|
void |
attributeChanged(Attribute attribute)
React to a change in an attribute. |
private void |
bufferingPhase()
Fills the queues with data tokens so that a fully parallel execution can be performed. |
private void |
connectActors()
Interconnect all the remote actors in the same manner as the model's topology. |
private java.util.HashMap |
createServicesReceiversMap(Receiver[][] receivers)
Create a map containing the services and Receivers ID's corresponding to a given bidimensional array of Receiver. |
private void |
distributeActorsOntoServers()
Distribute the actors to the corresponding Service specified in the actorsThreadsMap and initialize them remotely. |
private void |
exitClientThreads()
Create a commandMap containing and EXIT command for all the existing clientThreads and issue it to the synchronizer. |
void |
fire()
Calculate the current schedule, if necessary, and iterate the contained actors in the order given by the schedule. |
private java.util.LinkedList |
getActors()
Create a LinkedList containing all the instances of Actor contained by the CompositeActor in which this director is embedded. |
private java.util.LinkedList |
getServers()
Get the Jini Services discovered. |
private void |
init()
Initialize the object. |
void |
initialize()
Initialize the actors associated with this director (super). |
private void |
initializeJini()
Initializes Jini. |
private void |
mapActorsOntoServers()
Map the actors on to the Services. |
Receiver |
newReceiver()
Return a new receiver consistent with the Distributed-SDF domain. |
private void |
parallelFire()
Perform the dispatching of the schedule in parallel to the distributed platform. |
private void |
pipelinedParallelFire()
Perform the dispatching of the schedule in a pipelined parallel manner on to the distributed platform. |
void |
preinitialize()
Preinitialize the actors associated with this director and compute the schedule (super). |
private void |
printActorsOntoServersMap()
Print the actors-services mapping. |
void |
wrapup()
Invoke the wrapup() method of all the actors contained in the director's container (super). |
Methods inherited from class ptolemy.domains.sdf.kernel.SDFDirector |
---|
clone, createSchedule, fireAt, getModelNextIterationTime, periodValue, postfire, prefire, suggestedModalModelDirectors, supportMultirateFiring, transferInputs, transferOutputs |
Methods inherited from class ptolemy.actor.sched.StaticSchedulingDirector |
---|
_setScheduler, addDebugListener, getScheduler, invalidateSchedule, isScheduleValid, removeDebugListener, setScheduler |
Methods inherited from class ptolemy.kernel.util.Attribute |
---|
_checkContainer, _getContainedObject, _propagateExistence, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setName, updateContent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ptolemy.actor.Executable |
---|
isFireFunctional, isStrict, iterate, stop, stopFire, terminate |
Methods inherited from interface ptolemy.actor.Initializable |
---|
addInitializable, removeInitializable |
Methods inherited from interface ptolemy.kernel.util.Nameable |
---|
description, getContainer, getDisplayName, getFullName, getName, getName, setName |
Field Detail |
---|
public Parameter parallelSchedule
public Parameter pipelining
public Parameter parallelExecution
private boolean VERBOSE
private java.lang.String configFileName
private ClientServerInteractionManager clientServerInteractionManager
private java.util.HashMap actorsThreadsMap
private ThreadSynchronizer synchronizer
java.util.HashMap commandsMap
Constructor Detail |
---|
public DistributedSDFDirector() throws IllegalActionException, NameDuplicationException
IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.
NameDuplicationException
- If the container already contains
an entity with the specified name.public DistributedSDFDirector(Workspace workspace) throws IllegalActionException, NameDuplicationException
workspace
- The workspace for this object.
IllegalActionException
- If the name has a period in it, or
the director is not compatible with the specified container.
NameDuplicationException
- If the container already contains
an entity with the specified name.public DistributedSDFDirector(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- Container of the director.name
- Name of this director.
IllegalActionException
- If the director is not compatible
with the specified container. May be thrown in a derived class.
NameDuplicationException
- If the container is not a
CompositeActor and the name collides with an entity in the container.Method Detail |
---|
public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class SDFDirector
attribute
- The changed parameter.
IllegalActionException
- If the parameter set is not valid.public void fire() throws IllegalActionException
Iterating an actor involves calling the actor's iterate() method, which is equivalent to calling the actor's prefire(), fire() and postfire() methods in succession. If iterate() returns NOT_READY, indicating that the actor is not ready to execute, then an IllegalActionException will be thrown. The values returned from iterate() are recorded and are used to determine the value that postfire() will return at the end of the director's iteration.
This method may be overridden by some domains to perform additional domain-specific operations.
fire
in interface Executable
fire
in class StaticSchedulingDirector
IllegalActionException
- If any actor executed by this
actor return false in prefire.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class SDFDirector
IllegalActionException
- If the initialize() method of
one of the associated actors throws it, or if there is no
scheduler.public Receiver newReceiver()
newReceiver
in class SDFDirector
public void preinitialize() throws IllegalActionException
preinitialize
in interface Initializable
preinitialize
in class SDFDirector
IllegalActionException
- If the preinitialize() method of
one of the associated actors throws it.public void wrapup() throws IllegalActionException
wrapup
in interface Initializable
wrapup
in class Director
IllegalActionException
- If the wrapup() method of
one of the associated actors throws it.ClientThread
private void bufferingPhase() throws IllegalActionException
IllegalActionException
- If there is no scheduler.private void connectActors() throws IllegalActionException
IllegalActionException
- If the remote receivers can't be created.private java.util.HashMap createServicesReceiversMap(Receiver[][] receivers)
receivers
- The bidimensional array of Receivers.
private void distributeActorsOntoServers()
private void exitClientThreads()
ThreadSynchronizer
,
ClientThread
private java.util.LinkedList getActors()
private java.util.LinkedList getServers()
ClientServerInteractionManager
private void init() throws IllegalActionException, NameDuplicationException
IllegalActionException
NameDuplicationException
private void initializeJini() throws IllegalActionException
IllegalActionException
- If Jini cannot be initialized.ClientServerInteractionManager
private void mapActorsOntoServers()
ClientThread
private void parallelFire() throws IllegalActionException
IllegalActionException
- If port methods throw it.ThreadSynchronizer
private void pipelinedParallelFire() throws IllegalActionException
IllegalActionException
- If there is no scheduler.
IllegalActionException
- If port methods throw it.ThreadSynchronizer
private void printActorsOntoServersMap()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |