at.dms.kjc.backendSupport
Class BasicGreedyLayout<T extends ComputeNode>

java.lang.Object
  extended by at.dms.kjc.backendSupport.BasicGreedyLayout<T>
All Implemented Interfaces:
Layout<T>

public class BasicGreedyLayout<T extends ComputeNode>
extends Object
implements Layout<T>

Use greedy bin packing to allocate slices to compute nodes.

Author:
mgordon / dimock

Constructor Summary
BasicGreedyLayout(SpaceTimeScheduleAndPartitioner spaceTime, T[] nodes)
          Constructor
 
Method Summary
 HashMap<SliceNode,T> getAssignment()
           
 int[] getBinWeights()
          get the bin weights (Estimated max computation at each node).
 T getComputeNode(SliceNode node)
          Get the ComputeNode for a Slice
 int maxBinWeight()
          get maximum bin weight (Estimated max computation at any node).
 void run()
          Do the setup for getComputeNode.
 void setComputeNode(SliceNode node, T tile)
          Set the ComputeNode for a Slice
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGreedyLayout

public BasicGreedyLayout(SpaceTimeScheduleAndPartitioner spaceTime,
                         T[] nodes)
Constructor

Parameters:
spaceTime -
nodes -
Method Detail

getAssignment

public HashMap<SliceNode,T> getAssignment()

getComputeNode

public T getComputeNode(SliceNode node)
Description copied from interface: Layout
Get the ComputeNode for a Slice

Specified by:
getComputeNode in interface Layout<T extends ComputeNode>
Parameters:
node - : the SliceNode to look up.
Returns:
the ComputeNode that should execute the SliceNode.

setComputeNode

public void setComputeNode(SliceNode node,
                           T tile)
Description copied from interface: Layout
Set the ComputeNode for a Slice

Specified by:
setComputeNode in interface Layout<T extends ComputeNode>
Parameters:
node - the SliceNode to associate with ...
tile - the ComputeNode where the SliceNode should execute.

run

public void run()
Description copied from interface: Layout
Do the setup for getComputeNode.

Specified by:
run in interface Layout<T extends ComputeNode>

getBinWeights

public int[] getBinWeights()
get the bin weights (Estimated max computation at each node).

Returns:

maxBinWeight

public int maxBinWeight()
get maximum bin weight (Estimated max computation at any node).

Returns: