at.dms.kjc.flatgraph
Class StreamGraph

java.lang.Object
  extended by at.dms.kjc.flatgraph.StreamGraph
Direct Known Subclasses:
ScheduledStreamGraph, SpdStreamGraph

public class StreamGraph
extends Object

A representation of a FlatGraph as a collection of StaticStreamGraph. This class represents the entire stream graph of the application we are compiling. It is composed of StaticStreamGraphs. The StreamGraph / StaticSteam(sub)Graph representation was developed before SIRDynamicRateManager. In the future, try not to use this representation but instead use SIRDynamicRateManager to fake up disconnection of graph.


Field Summary
 HashMap<FlatNode,StaticStreamGraph> parentMap
          map of flat nodes to parent ssg.
protected  StaticStreamGraph[] staticSubGraphs
          A list of all the static sub graphs *
 
Constructor Summary
StreamGraph(FlatNode top)
          Create the static stream graph for the application that has
 
Method Summary
 void createStaticStreamGraphs()
          This method creates the static subgraphs of the StreamGraph by cutting the stream graph at dynamic rate boundaries.
 void dumpStaticStreamGraph()
          print out some stats on each SSG to STDOUT *
 boolean dynamicEntry(SIRStream stream)
          Return true if the source of this stream, stream has dynamic rate input.
 boolean dynamicExit(SIRStream stream)
          Return true if the sink of this stream, stream has dynamic rate output TODO: SIRDynamicRateManager
 StaticStreamGraph getParentSSG(FlatNode node)
          get the parent SSG of
 StaticStreamGraph[] getStaticSubGraphs()
          return the array of SSGs of this Stream Graph in no particular order
 StaticStreamGraph getTopLevel()
          get the toplevel (source) SSG
protected  StaticStreamGraph new_StaticStreamGraph(StreamGraph sg, FlatNode realTop)
          Use in place of "new StaticStreamGraph" for subclassing.
 SIRStream recreateSIR()
          The current version pastes together the topLevelSIR graphs for all StaticStreamGraphs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

staticSubGraphs

protected StaticStreamGraph[] staticSubGraphs
A list of all the static sub graphs *


parentMap

public HashMap<FlatNode,StaticStreamGraph> parentMap
map of flat nodes to parent ssg.
this needs to be updated whenever a node is added or deleted.

Constructor Detail

StreamGraph

public StreamGraph(FlatNode top)
Create the static stream graph for the application that has
top
as the top level FlatNode.

Parameters:
top: - the entry point of the FlatGraph, used to start the first StaticStreamGraph.
Method Detail

new_StaticStreamGraph

protected StaticStreamGraph new_StaticStreamGraph(StreamGraph sg,
                                                  FlatNode realTop)
Use in place of "new StaticStreamGraph" for subclassing. A subclass of StreamGraph may refer to a subclass of StaticStreamGraph. If we just used "new StaticStreamGraph" in this class we would only be making StaticStreamGraph's of the type in this package.

Parameters:
sg - a StreamGraph
realTop - the top node
Returns:
a new StaticStreamGraph

createStaticStreamGraphs

public void createStaticStreamGraphs()
This method creates the static subgraphs of the StreamGraph by cutting the stream graph at dynamic rate boundaries.
The top level node may either be a filter (which would have no peeks or pops if it is really the top level), or a 0-weight splitter introducing independent parallel threads that are eventually joined, or a 2-way joiner with 0 weight on edge 0 for a top-level feedback loop (if the feedback loop really is at top level).


dynamicEntry

public boolean dynamicEntry(SIRStream stream)
Return true if the source of this stream, stream has dynamic rate input. TODO: SIRDynamicRateManager

Parameters:
stream: -
Returns:
true if stream is a filter with dynamic peek or pop rate or pipeline starting with such a filter

dynamicExit

public boolean dynamicExit(SIRStream stream)
Return true if the sink of this stream, stream has dynamic rate output TODO: SIRDynamicRateManager

Parameters:
stream: -
Returns:
true if stream is a filter with dynamic push rate or pipeline ending with such a filter

getParentSSG

public StaticStreamGraph getParentSSG(FlatNode node)
get the parent SSG of
node

Parameters:
node - for which to find the contaiing StaticStreamGraph
Returns:
a StaticStreamGraph containing the node or null if none.

getStaticSubGraphs

public StaticStreamGraph[] getStaticSubGraphs()
return the array of SSGs of this Stream Graph in no particular order

Returns:
the array of SSGs of this Stream Graph in no particular order

getTopLevel

public StaticStreamGraph getTopLevel()
get the toplevel (source) SSG

Returns:
the SSG originally passed to the StreamGraph constructor

dumpStaticStreamGraph

public void dumpStaticStreamGraph()
print out some stats on each SSG to STDOUT *


recreateSIR

public SIRStream recreateSIR()
The current version pastes together the topLevelSIR graphs for all StaticStreamGraphs. Be sure that you do not want to continue to use the individual graphs.