at.dms.kjc.backendSupport
Class NoSWPipeLayout<T extends ComputeNode,Ts extends ComputeNodesI>

java.lang.Object
  extended by at.dms.kjc.common.SimulatedAnnealing
      extended by at.dms.kjc.backendSupport.NoSWPipeLayout<T,Ts>
All Implemented Interfaces:
Layout<T>
Direct Known Subclasses:
CellNoSWPipeLayout

public class NoSWPipeLayout<T extends ComputeNode,Ts extends ComputeNodesI>
extends SimulatedAnnealing
implements Layout<T>

Author:
mgordon

Field Summary
protected  LinkedList<SliceNode> assignedFilters
           
protected  Ts chip
           
protected  Partitioner partitioner
           
protected  Random rand
           
protected  LinkedList<Slice> scheduleOrder
           
 
Fields inherited from class at.dms.kjc.common.SimulatedAnnealing
ANNEALITERATIONS, assignment, MAXTEMPITERATIONS, MINTEMPITERATIONS, TFACTR
 
Constructor Summary
NoSWPipeLayout(SpaceTimeScheduleAndPartitioner spaceTime, Ts chip)
           
 
Method Summary
 T getComputeNode(SliceNode node)
          only valid after run();
 void initialize()
          Perform any initialization that has to be done before simulated annealing.
 void initialPlacement()
          Random initial assignment.
protected  boolean keepNewEqualMin()
          Decide if we should keep a configuration that has a cost that is EQUAL to the current minimum of the search.
 double placementCost(boolean debug)
          The placement cost (energy) of the configuration.
 void run()
          Do the setup for getComputeNode.
 void setAssignment(HashMap newAssign)
          Use this function to reassign the assignment to , update anything that needs to be updated on a new assignment.
 void setComputeNode(SliceNode node, T tile)
          only valid after run()
 void swapAssignment()
          Called by perturbConfiguration() to perturb the configuration.
 
Methods inherited from class at.dms.kjc.common.SimulatedAnnealing
getRandom, printLayoutStats, setConstants, simAnnealAssign
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

partitioner

protected Partitioner partitioner

chip

protected Ts extends ComputeNodesI chip

scheduleOrder

protected LinkedList<Slice> scheduleOrder

assignedFilters

protected LinkedList<SliceNode> assignedFilters

rand

protected Random rand
Constructor Detail

NoSWPipeLayout

public NoSWPipeLayout(SpaceTimeScheduleAndPartitioner spaceTime,
                      Ts chip)
Method Detail

getComputeNode

public T getComputeNode(SliceNode node)
only valid after run();

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)
only valid after run()

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

setAssignment

public void setAssignment(HashMap newAssign)
Use this function to reassign the assignment to , update anything that needs to be updated on a new assignment. Callable only during Simulated Annealing.

Specified by:
setAssignment in class SimulatedAnnealing
Parameters:
newAssign -

swapAssignment

public void swapAssignment()
Called by perturbConfiguration() to perturb the configuration. perturbConfiguration() decides if we should keep the new assignment. The assignment should contain only FilterSliceNodes when this is called.

Specified by:
swapAssignment in class SimulatedAnnealing

initialPlacement

public void initialPlacement()
Random initial assignment.

Specified by:
initialPlacement in class SimulatedAnnealing

placementCost

public double placementCost(boolean debug)
The placement cost (energy) of the configuration.

Specified by:
placementCost in class SimulatedAnnealing
Parameters:
debug - Might want to do some debugging...
Returns:
placement cost

initialize

public void initialize()
Perform any initialization that has to be done before simulated annealing. This does not include the initial placement.

Specified by:
initialize in class SimulatedAnnealing

keepNewEqualMin

protected boolean keepNewEqualMin()
Decide if we should keep a configuration that has a cost that is EQUAL to the current minimum of the search. By default, don't keep it. Override if you want other behavior.

Specified by:
keepNewEqualMin in class SimulatedAnnealing
Returns:
Should we set the min config to this config (they have the same cost).

run

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

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