public class PartitionSolverSDF extends GenericPartitionSolver implements WorkloadCommClusterConstraints, WrkLdCommCostConstraints, MaxWrkLdCommCostClusterConstraints, WorkloadImbalanceConstraints, CommunicationCostConstraints, ClusterConstraints, MaxWorkLoadPerCluster
Z3Solver.SatResult
graph, hsdf, platform, solutions, totalWork, useImbalance, varDecl
contextStatements, pushedContext, statementCountAfterPush, z3Solver
Constructor and Description |
---|
PartitionSolverSDF(Graph inputGraph,
Graph hsdf,
Solutions solutions,
Platform platform,
java.lang.String outputDirectory)
Build a partition solver object
|
Modifier and Type | Method and Description |
---|---|
private void |
clusterTaskWorkAllocation() |
private void |
communicationCosts() |
void |
defineTaskVariables() |
void |
generateClusterConstraint(int numClusters)
Set total number of clusters used as a constraint.
|
void |
generateCommunicationCostConstraint(int constraintValue)
Sets the Communication cost constraint for the exploration query
|
void |
generateMaxWorkloadPerClusterConstraint(int constraintValue)
Set the maximum workload per cluster constraint for exploration query.
|
void |
generatePartitioningConstraints()
Generate all the partitioning constraints
|
void |
generateWorkImbalanceConstraint(int constraintValue)
Set an upper bound on max workload imbalance between the clusters.
|
int |
getCommunicationCost(java.util.Map<java.lang.String,java.lang.String> model)
Get the communication cost calculated in the model.
|
int |
getMaxWorkLoadPerCluster(java.util.Map<java.lang.String,java.lang.String> model)
Get maximum workload per cluster from the solver model.
|
int |
getTotalClustersUsed(java.util.Map<java.lang.String,java.lang.String> model)
Get total number of clusters used from the model.
|
int |
getWorkLoadImbalance(java.util.Map<java.lang.String,java.lang.String> model) |
protected DesignFlowSolution.Partition |
modelToPartition(java.util.Map<java.lang.String,java.lang.String> model,
DesignFlowSolution designFlowSolution)
Sets a new partition in design flow solution
|
private Graph |
modelToPartitionAwareGraph(java.util.Map<java.lang.String,java.lang.String> model)
Convert a model to partition aware graph by inserting DMA actors.
|
void |
setDesignFlowSolution(DesignFlowSolution designFlowSolution,
java.util.Map<java.lang.String,java.lang.String> model)
Set design flow solution parameters such as partition aware graph, solutions, etc.
|
private void |
taskLimits() |
private void |
totalCommunicationCost() |
calculateWorkImbalance, clusterAllocatedWorkId, clusterImbalanceId, clusterTaskAllocationId, clusterTaskAllocationId, commCostId, defineClusterVariables, maxWorkLoadOnCluster, maxWorkloadOnClusterId, totalClustersUsedId, totalCommCostId, totalWorkImbalance, totalWorkImbalanceId
addVariableDeclaration, checkSat, declareFunction, generateAssertion, generateSatCode, getModel, getStatistics, popContext, printContext, pushContext, resetSolver, setTacTicSolver
check, getModel, getVersion, setRandomSeed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkSat, getModel, popContext, pushContext
public PartitionSolverSDF(Graph inputGraph, Graph hsdf, Solutions solutions, Platform platform, java.lang.String outputDirectory)
inputGraph
- input application graphhsdf
- equivalent HSDF graphsolutions
- solutions to the application graphplatform
- target platformoutputDirectory
- output directory to generate output filespublic void generatePartitioningConstraints()
GenericPartitionSolver
generatePartitioningConstraints
in class GenericPartitionSolver
public void setDesignFlowSolution(DesignFlowSolution designFlowSolution, java.util.Map<java.lang.String,java.lang.String> model)
GenericPartitionSolver
setDesignFlowSolution
in class GenericPartitionSolver
designFlowSolution
- design flow solution to be modifiedmodel
- model from the SMT solver for partitioningprivate Graph modelToPartitionAwareGraph(java.util.Map<java.lang.String,java.lang.String> model)
model
- model from the SMT solverpublic int getMaxWorkLoadPerCluster(java.util.Map<java.lang.String,java.lang.String> model)
MaxWorkLoadPerCluster
getMaxWorkLoadPerCluster
in interface MaxWorkLoadPerCluster
getMaxWorkLoadPerCluster
in class GenericPartitionSolver
model
- model returned by the Solver on a SAT result.public void generateMaxWorkloadPerClusterConstraint(int constraintValue)
MaxWorkLoadPerCluster
generateMaxWorkloadPerClusterConstraint
in interface MaxWorkLoadPerCluster
generateMaxWorkloadPerClusterConstraint
in class GenericPartitionSolver
constraintValue
- upper bound on max workload allocated to the cluster.public int getTotalClustersUsed(java.util.Map<java.lang.String,java.lang.String> model)
ClusterConstraints
getTotalClustersUsed
in interface ClusterConstraints
getTotalClustersUsed
in class GenericPartitionSolver
model
- model returned by the Solver on a SAT result.public void generateClusterConstraint(int numClusters)
ClusterConstraints
generateClusterConstraint
in interface ClusterConstraints
generateClusterConstraint
in class GenericPartitionSolver
numClusters
- number of clusters to be usedpublic void generateCommunicationCostConstraint(int constraintValue)
CommunicationCostConstraints
generateCommunicationCostConstraint
in interface CommunicationCostConstraints
generateCommunicationCostConstraint
in class GenericPartitionSolver
public int getCommunicationCost(java.util.Map<java.lang.String,java.lang.String> model)
CommunicationCostConstraints
getCommunicationCost
in interface CommunicationCostConstraints
getCommunicationCost
in class GenericPartitionSolver
model
- model returned by the Solver on a SAT result.public void generateWorkImbalanceConstraint(int constraintValue)
WorkloadImbalanceConstraints
generateWorkImbalanceConstraint
in interface WorkloadImbalanceConstraints
generateWorkImbalanceConstraint
in class GenericPartitionSolver
constraintValue
- Set upper bound on max workload imbalance.public int getWorkLoadImbalance(java.util.Map<java.lang.String,java.lang.String> model)
getWorkLoadImbalance
in interface WorkloadImbalanceConstraints
getWorkLoadImbalance
in class GenericPartitionSolver
model
- model returned by the Solver on a SAT result.protected DesignFlowSolution.Partition modelToPartition(java.util.Map<java.lang.String,java.lang.String> model, DesignFlowSolution designFlowSolution)
GenericPartitionSolver
modelToPartition
in class GenericPartitionSolver
model
- model of solution from the SMT solverdesignFlowSolution
- design flow solution to be modifiedpublic void defineTaskVariables()
private void taskLimits()
private void totalCommunicationCost()
private void clusterTaskWorkAllocation()
private void communicationCosts()