bug fix, some callees were not being rescheduled because code to do it was conditiona...
authorjjenista <jjenista>
Thu, 15 Apr 2010 21:25:18 +0000 (21:25 +0000)
committerjjenista <jjenista>
Thu, 15 Apr 2010 21:25:18 +0000 (21:25 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Benchmarks/disjoint/expectedSharing.tex
Robust/src/Benchmarks/disjoint/makefile

index 20bbfdaa361050a00249cd7f6f4717e08aa3bbf2..072f298868f07d32fb98b78142ebcd4d808219d3 100644 (file)
@@ -469,6 +469,9 @@ public class DisjointAnalysis {
   static protected Hashtable<FlatNode, ReachGraph> fn2rg =
     new Hashtable<FlatNode, ReachGraph>();
 
+  private Hashtable<FlatCall, Descriptor> 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<Descriptor, ReachGraph>();
 
     pm = new PointerMethod();
+
+    if( state.DISJOINTDEBUGSCHEDULING ) {
+      fc2enclosing = new Hashtable<FlatCall, Descriptor>();
+    }
+
   }
 
 
@@ -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<Descriptor> 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
index 100d5fbc85a5350665a1f0d056e2a56f52761077..fe74f6571964ffee4c1e282bc71917a4b99d1989 100644 (file)
@@ -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          \\
index 9e4f5dae61a6d76666c80b11a27e7f1c2f9bac9a..9cd6bc88220171e57b6c7e1621c8d7e66d98fd91 100644 (file)
@@ -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