|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.dms.kjc.slicegraph.Partitioner
public abstract class Partitioner
An abstract class that a slice parititoner will subclass from: It holds the
partitioned stream graph.
Partitioning maps filters to slices. This is normally not useful since most
back ends will assume one filter per slice, but is sometimes used in at.dms.kjc.spacetime
.
Partitioning also converts a SIR graph to a slice graph.
Field Summary | |
---|---|
protected HashMap<Slice,FilterSliceNode> |
bottleNeckFilter
This hashmap maps a Slice to the FilterSliceNode that has the most work; |
protected HashMap[] |
exeCounts
|
protected HashMap<FilterSliceNode,Integer> |
filterOccupancy
This hashmap store the filters work plus any blocking that is caused by the pipeline imbalance of the slice. |
protected HashMap<FilterSliceNode,Integer> |
filterStartupCost
The startup cost of a filter when starting a slice |
protected HashMap<SIRFilter,Integer> |
genIdWorks
|
Slice[] |
io
|
protected LinearAnalyzer |
lfa
|
protected int |
maxPartitions
|
protected HashMap<SIRFilter,FilterContent> |
sirToContent
|
protected HashMap<Slice,Integer> |
sliceBNWork
|
protected Slice[] |
sliceGraph
|
protected int |
steadyMult
|
protected UnflatFilter[] |
topFilters
|
protected Slice[] |
topSlices
|
protected WorkEstimate |
work
|
protected HashMap<FilterContent,Integer> |
workEstimation
|
Constructor Summary | |
---|---|
Partitioner(UnflatFilter[] topFilters,
HashMap[] exeCounts,
LinearAnalyzer lfa,
WorkEstimate work,
int maxPartitions)
Create a Partitioner. |
Method Summary | |
---|---|
void |
addFilterToSlice(FilterSliceNode node,
Slice slice)
Update all the necesary state to add node to slice. |
void |
calculateWorkStats()
|
boolean |
containsSlice(Slice slice)
Does the the slice graph contain slice (perform a simple linear search). |
void |
createPredefinedContent()
Force creation of kopi methods and fields for predefined filters. |
void |
dumpGraph(String filename)
|
void |
ensureSimpleSlices()
Make sure that all the Slice s are SimpleSlice s. |
FilterContent |
getContent(SIRFilter f)
|
protected FilterContent |
getFilterContent(UnflatFilter f)
|
int |
getFilterOccupancy(FilterSliceNode filter)
This hashmap store the filters work plus any blocking that is caused by the pipeline imbalance of the slice. |
int |
getFilterStartupCost(FilterSliceNode node)
|
int |
getFilterWork(FilterSliceNode node)
|
int |
getFilterWorkSteadyMult(FilterSliceNode node)
|
protected Slice[] |
getNext(Slice slice)
|
FilterSliceNode |
getSliceBNFilter(Slice slice)
|
int |
getSliceBNWork(Slice slice)
|
Slice[] |
getSliceGraph()
Get all slices |
Slice[] |
getTopSlices()
Get just top level slices in the slice graph. |
protected int |
getWorkEstimate(FilterContent fc)
|
int |
getWorkEstOneFiring(FilterSliceNode node)
The cost of 1 firing of the filter, to be run after the steady multiplier has been accounted for in the steady multiplicity of each filter content. |
boolean |
isIO(Slice slice)
Check for I/O in slice |
abstract Slice[] |
partition()
Partition the stream graph into slices (slices) and return the slices. |
void |
setSliceGraphNewIds(Slice[] slices)
Set the slice graph to slices, where the only difference between the previous slice graph and the new slice graph is the addition of identity slices (meaning slices with only an identities filter). |
protected String |
sliceName(Slice slice)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected HashMap<Slice,Integer> sliceBNWork
protected HashMap<FilterSliceNode,Integer> filterStartupCost
protected Slice[] sliceGraph
protected int maxPartitions
protected UnflatFilter[] topFilters
protected HashMap[] exeCounts
protected LinearAnalyzer lfa
protected WorkEstimate work
protected Slice[] topSlices
protected HashMap<SIRFilter,Integer> genIdWorks
protected HashMap<Slice,FilterSliceNode> bottleNeckFilter
protected HashMap<FilterSliceNode,Integer> filterOccupancy
public Slice[] io
protected HashMap<FilterContent,Integer> workEstimation
protected int steadyMult
protected HashMap<SIRFilter,FilterContent> sirToContent
Constructor Detail |
---|
public Partitioner(UnflatFilter[] topFilters, HashMap[] exeCounts, LinearAnalyzer lfa, WorkEstimate work, int maxPartitions)
topFilters
- from FlattenGraph
exeCounts
- a schedulelfa
- a linearAnalyzer to convert filters to linear form if appropriate.work
- a work estimate, see at.dms.kjc.sir.lowering.partition
, updeted if filters are added to a slice.maxPartitions
- if non-zero, a maximum number of partitions to createMethod Detail |
---|
public abstract Slice[] partition()
public boolean isIO(Slice slice)
slice
-
public Slice[] getSliceGraph()
public Slice[] getTopSlices()
public boolean containsSlice(Slice slice)
slice
- The slice to query.
public void addFilterToSlice(FilterSliceNode node, Slice slice)
node
- The node to add.slice
- The slice to add the node to.public void setSliceGraphNewIds(Slice[] slices)
slices
- The new slice graph.public int getFilterWork(FilterSliceNode node)
node
- The Filter
public int getFilterWorkSteadyMult(FilterSliceNode node)
node
-
public int getSliceBNWork(Slice slice)
slice
-
public int getFilterOccupancy(FilterSliceNode filter)
public FilterSliceNode getSliceBNFilter(Slice slice)
slice
-
public void calculateWorkStats()
public void dumpGraph(String filename)
protected Slice[] getNext(Slice slice)
protected FilterContent getFilterContent(UnflatFilter f)
public FilterContent getContent(SIRFilter f)
protected String sliceName(Slice slice)
protected int getWorkEstimate(FilterContent fc)
public int getWorkEstOneFiring(FilterSliceNode node)
node
-
public int getFilterStartupCost(FilterSliceNode node)
node
-
node
public void ensureSimpleSlices()
Slice
s are SimpleSlice
s.
public void createPredefinedContent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |