From 9a2394aa9eca90985e708fb6a7292bb95514482b Mon Sep 17 00:00:00 2001 From: jjenista Date: Thu, 15 Apr 2010 21:25:18 +0000 Subject: [PATCH] bug fix, some callees were not being rescheduled because code to do it was conditional on caller having a new result since last visit --- .../Analysis/Disjoint/DisjointAnalysis.java | 48 +++++++++++-------- .../Benchmarks/disjoint/expectedSharing.tex | 2 +- Robust/src/Benchmarks/disjoint/makefile | 3 +- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 20bbfdaa..072f2988 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -469,6 +469,9 @@ public class DisjointAnalysis { static protected Hashtable fn2rg = new Hashtable(); + private Hashtable fc2enclosing; + + // allocate various structures that are not local // to a single class method--should be done once @@ -537,6 +540,11 @@ public class DisjointAnalysis { new Hashtable(); pm = new PointerMethod(); + + if( state.DISJOINTDEBUGSCHEDULING ) { + fc2enclosing = new Hashtable(); + } + } @@ -801,27 +809,23 @@ public class DisjointAnalysis { System.out.println( " "+dNext ); } } + } - if( state.DISJOINTDVISITSTACKEESONTOP ) { - - depsItr = calleesToEnqueue.iterator(); - while( depsItr.hasNext() ) { - Descriptor dNext = depsItr.next(); - enqueue( dNext ); - } - calleesToEnqueue.clear(); + // whether or not the method under analysis changed, + // we may have some callees that are scheduled for + // more analysis, and they should go on the top of + // the stack now (in other method-visiting modes they + // are already enqueued at this point + if( state.DISJOINTDVISITSTACKEESONTOP ) { + Iterator depsItr = calleesToEnqueue.iterator(); + while( depsItr.hasNext() ) { + Descriptor dNext = depsItr.next(); + enqueue( dNext ); } + calleesToEnqueue.clear(); + } - } else { - // we got the result result as the last visit - // to this method, but we might need to clean - // something up - if( state.DISJOINTDVISITSTACKEESONTOP ) { - calleesToEnqueue.clear(); - } - } - - } + } } protected ReachGraph analyzeMethod( Descriptor d ) @@ -1014,7 +1018,6 @@ public class DisjointAnalysis { rg.merge( rgContrib ); } - // additionally, we are enforcing STRICT MONOTONICITY for the // method's initial context, so grow the context by whatever // the previously computed context was, and put the most @@ -1184,6 +1187,11 @@ public class DisjointAnalysis { if( state.DISJOINTDEBUGSCHEDULING ) { System.out.println( " context changed, scheduling callee: "+mdCallee ); + + // if we're debugging the scheduling system, map a FlatCall + // to its enclosing method/task descriptor so we can write + // that info out later + fc2enclosing.put( fc, mdCaller ); } if( state.DISJOINTDVISITSTACKEESONTOP ) { @@ -1674,6 +1682,7 @@ public class DisjointAnalysis { return heapsFromCallers.get( fc ); } + public void addIHMcontribution( Descriptor d, FlatCall fc, ReachGraph rg @@ -1684,6 +1693,7 @@ public class DisjointAnalysis { heapsFromCallers.put( fc, rg ); } + private AllocSite createParameterAllocSite( ReachGraph rg, TempDescriptor tempDesc, boolean flagRegions diff --git a/Robust/src/Benchmarks/disjoint/expectedSharing.tex b/Robust/src/Benchmarks/disjoint/expectedSharing.tex index 100d5fbc..fe74f657 100644 --- a/Robust/src/Benchmarks/disjoint/expectedSharing.tex +++ b/Robust/src/Benchmarks/disjoint/expectedSharing.tex @@ -20,7 +20,7 @@ Bank & 0 & 0 & 0 & 0 \\ Chat & 3 & 3 & 3 & 3 \\ WebPortal & 0 & 0 & 0 & 0 \\ jHTTPp2 & 0 & 0 & 0 & 0 \\ -MapReduce1 & 2 & 1 & 1 & 1 \\ +MapReduce1 & 2 & \color{green}{1} & \color{green}{1} & \color{green}{1} \\ MultiGame & 10 & 10 & 10 & 10 \\ PERT & 0 & 0 & 0 & 0 \\ FilterBank & 0 & 0 & 0 & 0 \\ diff --git a/Robust/src/Benchmarks/disjoint/makefile b/Robust/src/Benchmarks/disjoint/makefile index 9e4f5dae..9cd6bc88 100644 --- a/Robust/src/Benchmarks/disjoint/makefile +++ b/Robust/src/Benchmarks/disjoint/makefile @@ -17,7 +17,6 @@ BUILDSCRIPT=~/research/Robust/src/buildscript #DEBUGFLAGS= -disjoint-debug-callsite addElement addInterOutput 30 100 false #DEBUGFLAGS= -disjoint-debug-callsite setPartial reduceOutput 1 20 false - #DEBUGFLAGS= -disjoint-debug-callsite close Transaction 1 20 false @@ -57,7 +56,7 @@ JAVAFLAGS= -mainclass test #VISITMODE= -disjoint-dvisit-pqueue VISITMODE= -disjoint-dvisit-stack-callees-on-top -DEBUGMODE= -enable-assertions -disjoint-write-dots final -disjoint-write-ihms -disjoint-write-initial-contexts -disjoint-alias-file aliases.txt normal -disjoint-desire-determinism #-disjoint-debug-scheduling +DEBUGMODE= -enable-assertions -disjoint-write-dots final -disjoint-alias-file aliases.txt normal -disjoint-desire-determinism #-disjoint-write-ihms -disjoint-debug-scheduling -disjoint-write-initial-contexts RELEASEMODE= -disjoint-release-mode -disjoint-alias-file aliases.txt tabbed BSFLAGS= -justanalyze -disjoint -disjoint-k 1 #-flatirusermethods -flatirtasks -- 2.34.1