
SDFDirector |
ptolemy.domains.sdf.kernel.SDFDirector |
Director for the synchronous dataflow (SDF) model of computation.
SDF overview
The Synchronous Dataflow(SDF) domain supports the efficient
execution of Dataflow graphs that
lack control structures. Dataflow graphs that contain control structures
should be executed using the Process Networks(PN) domain instead.
SDF allows efficient execution, with very little overhead at runtime. It
requires that the rates on the ports of all actors be known before hand.
SDF also requires that the rates on the ports not change during
execution. In addition, in some cases (namely systems with feedback) delays,
which are represented by initial tokens on relations must be explicitly
noted. SDF uses this rate and delay information to determine
the execution sequence of the actors before execution begins.
Schedule Properties
- The number of tokens accumulated on every relation is bounded, given
an infinite number of executions of the schedule.
- Deadlock will never occur, given an infinite number of executions of
the schedule.
Class comments
An SDFDirector is the class that controls execution of actors under the
SDF domain. By default, actor scheduling is handled by the SDFScheduler
class. Furthermore, the newReceiver method creates Receivers of type
SDFReceiver, which extends QueueReceiver to support optimized gets
and puts of arrays of tokens.
Actors are assumed to consume and produce exactly one token per channel on
each firing. Actors that do not follow this convention should set
the appropriate parameters on input and output ports to declare the number
of tokens they produce or consume. See the
Author(s): Steve Neuendorffer
Version:$Id: SDFDirector.java,v 1.139 2006/03/30 16:36:39 cxh Exp $
Pt.Proposed Rating:Green (neuendor)
Pt.Accepted Rating:Green (neuendor)
allowDisconnectedGraphs
A parameter representing whether disconnected graphs are
permitted. A model may have two or more graphs of actors that
are not connected. The schedule can jump from one graph to
another among the disconnected graphs. There is nothing to
force the scheduler to finish executing all actors on one
graph before firing actors on another graph. However, the
order of execution within an graph should be correct.
Usually, disconnected graphs in an SDF model indicates an
error. The default value is a BooleanToken with the value
false.
allowRateChanges
A parameter representing whether dynamic rate changes are
permitted. An SDF model may constructed such that the values
of rate parameters are modified during the execution of the
system. If this parameter is true, then such models are
valid and this class dynamically computes a new schedule at
runtime. If this parameter is false, then the SDF domain
performs a static check to disallow such models. Note that in
order to generate code from an SDF model, this parameter must
be set to false. This is a boolean with default
value false.
constrainBufferSizes
If true, then buffer sizes are fixed according to the schedule,
and attempts to write to the buffer that cause the buffer to
exceed the schedule size result in an exception. This method
works by setting the capacity of the receivers if the value is
true. This parameter is a boolean that defaults to true.
iterations
A Parameter representing the number of times that postfire may be
called before it returns false. If the value is less than or
equal to zero, then the execution will never return false in postfire,
and thus the execution can continue forever. Note that the amount
of data processed by the SDF model is a function of both this
parameter and the value of parameter vectorizationFactor, since
vectorizationFactor can influence the choice of schedule.
The default value is an IntToken with the value zero.
period
The time period of each iteration. This parameter has type double
and default value 0.0, which means that this director does not
increment model time and does not request firings by calling
fireAt() on any enclosing director. If the value is set to
something greater than 0.0, then if this director is at the
top level, it will increment model time by the specified
amount in its postfire() method. If it is not at the top
level, then it will call fireAt() on the enclosing executive
director with the argument being the current time plus the
specified period.
synchronizeToRealTime
Specify whether the execution should synchronize to the
real time. This parameter has type boolean and defaults
to false. If set to true, then this director stalls in the
prefire() method until the elapsed real real time matches
the product of the period parameter value and the
iteration count. If the period parameter has value
0.0 (the default), then changing this parameter to true
has no effect.
vectorizationFactor
A Parameter representing the requested vectorization factor.
The director will attempt to construct a schedule where each
actor fires vectorizationFactor times more often than
it would in a minimal schedule. This can allow actor executions
to be grouped together, resulting in faster execution. This is
more likely to be possible in graphs without tight feedback.
This parameter must be a positive integer.
The default value is an IntToken with the value one.