at.dms.kjc.sir.lowering.partition
Class WorkEstimate

java.lang.Object
  extended by at.dms.kjc.sir.lowering.partition.WorkEstimate

public class WorkEstimate
extends Object

Provides a means for estimating the amount of work in a stream graph. This is meant to be an IMMUTABLE class. Once you have an instance, it's estimates will never change. Thus you can do the estimate once, then pass it around and share it.


Field Summary
static boolean UNROLL_FOR_WORK_EST
          If true, attempt to fully unroll the filter before we estimate its work
 
Method Summary
 HashMap getExecutionCounts()
          Return the execution counts that were used to create this work estimation.
 int getICodeSize(SIRFilter filter)
          Returns estimate of instruction code for
 int getReps(SIRFilter obj)
          Returns the number of times that filter
 WorkList getSortedContainerWork()
          Returns a sorted worklist in increasing order of work for all containers in this graph that contain at least a single filter.
 WorkList getSortedFilterWork()
          Returns a sorted worklist corresponding to a given work estimate.
 int getWork(SIRFilter obj)
          Returns the work estimate for filter
static WorkEstimate getWorkEstimate(SIRStream str)
          Returns a work estimate of
 void printGraph(SIRStream str, String filename)
          Prints dot graph of work estimates for
 void printWork()
          prints work of all functions to system.err.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNROLL_FOR_WORK_EST

public static boolean UNROLL_FOR_WORK_EST
If true, attempt to fully unroll the filter before we estimate its work

Method Detail

getWorkEstimate

public static WorkEstimate getWorkEstimate(SIRStream str)
Returns a work estimate of
str


getSortedFilterWork

public WorkList getSortedFilterWork()
Returns a sorted worklist corresponding to a given work estimate. The entries will be sorted by increasing values of work. These entries will map FILTERS to work estimate, for all filters in the graph.


getExecutionCounts

public HashMap getExecutionCounts()
Return the execution counts that were used to create this work estimation.

Returns:
the execution counts that were used to create this work estimation.

getSortedContainerWork

public WorkList getSortedContainerWork()
Returns a sorted worklist in increasing order of work for all containers in this graph that contain at least a single filter. The caller might then try fusing the first elements of this list.


getWork

public int getWork(SIRFilter obj)
Returns the work estimate for filter
obj
. Requires that
obj
was present in the original graph used to construct this.


getICodeSize

public int getICodeSize(SIRFilter filter)
Returns estimate of instruction code for
filter

This is cluster backend specific


getReps

public int getReps(SIRFilter obj)
Returns the number of times that filter
obj
executes in this estimate. Requires that
obj
was present in the original graph used to construct this.


printWork

public void printWork()
prints work of all functions to system.err.


printGraph

public void printGraph(SIRStream str,
                       String filename)
Prints dot graph of work estimates for
str
to
filename
.