From 84e434cf05530d0b929a849e5c54da93d595381a Mon Sep 17 00:00:00 2001 From: jjenista Date: Wed, 17 Sep 2008 18:21:35 +0000 Subject: [PATCH] helpful progress reporting --- .../OwnershipAnalysis/OwnershipAnalysis.java | 28 ++++++++++++++----- .../OwnershipAnalysis/OwnershipGraph.java | 7 ++--- .../OwnershipAnalysis/ReachabilitySet.java | 18 ++++++++++++ 3 files changed, 41 insertions(+), 12 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index 9647234d..7d597ae0 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -397,6 +397,8 @@ public class OwnershipAnalysis { FlatNode fn = (FlatNode) flatNodesToVisit.iterator().next(); flatNodesToVisit.remove(fn); + //System.out.println( " "+fn ); + // perform this node's contributions to the ownership // graph on a new copy, then compare it to the old graph // at this node to see if anything was updated. @@ -419,6 +421,12 @@ public class OwnershipAnalysis { returnNodesToCombineForCompleteOwnershipGraph, og); + + + //debugSnapshot(og,fn); + + + // if the results of the new graph are different from // the current graph at this node, replace the graph // with the update and enqueue the children for @@ -603,14 +611,20 @@ public class OwnershipAnalysis { // insert a call to debugSnapshot() somewhere in the analysis to get // successive captures of the analysis state - int debugCounter = 0; - int numIterationsIn = 80000; - int numIterationsToCapture = 53; + int debugCounter = 0; + int numStartCountReport = 66000; + int freqCountReport = 50; + int iterStartCapture = 70000; + int numIterToCapture = 100; void debugSnapshot( OwnershipGraph og, FlatNode fn ) { ++debugCounter; - if( debugCounter > numIterationsIn ) { - System.out.println( " @@@ capturing debug "+(debugCounter-numIterationsIn)+" @@@" ); - String graphName = String.format("snap%04d",debugCounter-numIterationsIn); + if( debugCounter > numStartCountReport && + debugCounter % freqCountReport == 0 ) { + System.out.println( " @@@ debug counter = "+debugCounter ); + } + if( debugCounter > iterStartCapture ) { + System.out.println( " @@@ capturing debug "+(debugCounter-iterStartCapture)+" @@@" ); + String graphName = String.format("snap%04d",debugCounter-iterStartCapture); if( fn != null ) { graphName = graphName+fn; } @@ -621,7 +635,7 @@ public class OwnershipAnalysis { System.exit( 0 ); } } - if( debugCounter == numIterationsIn + numIterationsToCapture ) { + if( debugCounter == iterStartCapture + numIterToCapture ) { System.out.println( "Stopping analysis after debug captures." ); System.exit( 0 ); } diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 6323975a..fce6f0d0 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -1013,7 +1013,9 @@ public class OwnershipGraph { ReferenceEdge edge = edgeItr.next(); D_i = D_i.union(edge.getBeta() ); } + D_i = D_i.exhaustiveArityCombinations(); + paramIndex2rewriteD.put(paramIndex, D_i); } @@ -1106,7 +1108,6 @@ public class OwnershipGraph { } } - // update reachable edges Iterator edgeReachableItr = edgesReachable.iterator(); while( edgeReachableItr.hasNext() ) { @@ -1125,7 +1126,6 @@ public class OwnershipGraph { edgesWithNewBeta.add(edgeReachable); } - // update upstream edges Hashtable edgeUpstreamPlannedChanges = new Hashtable(); @@ -1165,7 +1165,6 @@ public class OwnershipGraph { } - // verify the existence of allocation sites and their // shadows from the callee in the context of this caller graph // then map allocated nodes of callee onto the caller shadows @@ -1334,7 +1333,6 @@ public class OwnershipGraph { } - // return value may need to be assigned in caller if( fc.getReturnTemp() != null ) { @@ -1398,7 +1396,6 @@ public class OwnershipGraph { } - // merge the shadow nodes of allocation sites back down to normal capacity Iterator allocItr = ogCallee.allocationSites.iterator(); while( allocItr.hasNext() ) { diff --git a/Robust/src/Analysis/OwnershipAnalysis/ReachabilitySet.java b/Robust/src/Analysis/OwnershipAnalysis/ReachabilitySet.java index 64e1cc40..71be34fb 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/ReachabilitySet.java +++ b/Robust/src/Analysis/OwnershipAnalysis/ReachabilitySet.java @@ -255,6 +255,10 @@ public class ReachabilitySet extends Canonical { int numDimensions = this.possibleReachabilities.size(); + if( numDimensions > 10 ) { + System.out.println( "exhaustiveArityCombinations numDimensions = "+numDimensions ); + } + // add an extra digit to detect termination int[] digits = new int[numDimensions+1]; @@ -284,6 +288,20 @@ public class ReachabilitySet extends Canonical { // increment for( int i = 0; i < numDimensions+1; ++i ) { digits[i]++; + + + if( i == 11 ) { + System.out.print( "x " ); + } + + if( i == 15 ) { + System.out.print( "@ " ); + } + + if( i == 17 ) { + System.out.print( "# " ); + } + if( digits[i] > maxArity ) { // this axis reached its max, so roll it back to min and increment next higher digit digits[i] = minArity; -- 2.34.1