adds new option '-nostalltr' that turns off rcr traversers that only handle conflicts...
authoryeom <yeom>
Fri, 19 Nov 2010 01:47:39 +0000 (01:47 +0000)
committeryeom <yeom>
Fri, 19 Nov 2010 01:47:39 +0000 (01:47 +0000)
12 files changed:
Robust/src/Analysis/OoOJava/ConflictGraph.java
Robust/src/Analysis/OoOJava/ConflictNode.java
Robust/src/Benchmarks/oooJava/master-makefile
Robust/src/Benchmarks/oooJava/moldyn/JGFMolDynBench.java
Robust/src/Benchmarks/oooJava/moldyn/makefile
Robust/src/Benchmarks/oooJava/moldyn/runr
Robust/src/Benchmarks/oooJava/sor/makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/RuntimeConflictResolver.java
Robust/src/IR/State.java
Robust/src/Main/Main.java
Robust/src/buildscript

index d3f47c8639b410d1d91c82f7167cbd019c040ae2..75304f40e3a98d8b148d51307a87033e9f90b282 100644 (file)
@@ -802,5 +802,9 @@ public class ConflictGraph {
     bw.close();
 
   }
+  
+  public Hashtable<String, ConflictNode> getId2cn() {
+    return id2cn;
+  }
 
 }
index c0f14a83dfe2efcb9ca669cf881b65e03913ca09..932d7ed9b289baa3840ebe37132fa15be6067ce4 100644 (file)
@@ -39,7 +39,7 @@ public class ConflictNode {
 
   public static final int INVAR = 0;
   public static final int STALLSITE = 1;
-
+  
   public ConflictNode(String id, int nodeType, TempDescriptor var, FlatNode stallSite) {
     this(id, var, nodeType);
     this.stallSite = stallSite;
@@ -222,5 +222,34 @@ public class ConflictNode {
   public String toString() {
     return id;
   }
+  
+  public boolean IsValidToPrune() {
+
+    for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
+      ConflictEdge edge = (ConflictEdge) iterator.next();
+
+      if (edge.getVertexU() == edge.getVertexV()) {
+        // self-conflict, need to generate traverser
+        return false;
+      } else {
+
+        if (edge.getVertexU() == this) {
+          if (edge.getVertexV().isInVarNode()) {
+            // has a conflict with invar, need to generate traverser
+            return false;
+          }
+        } else {
+          if (edge.getVertexU().isInVarNode()) {
+            // has a conflict with invar, need to generate traverser
+            return false;
+          }
+        }
+
+      }
+
+    }
+    return true;
+  }
+  
 
 }
index 38dd565ba403d2e0b9a6bfd857ec3097b44b3d38..000c9c74778e100cc902022d934347afdbc2178f 100644 (file)
@@ -43,7 +43,7 @@ default:
        $(BUILDSCRIPT) -nojava $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES)
 
 rcr-remake-c:
-       $(BUILDSCRIPT) -nojava $(COREPINFLAG) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
+       $(BUILDSCRIPT) -nojava $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
 
 
 single: $(PROGRAM)s.bin
@@ -59,7 +59,7 @@ $(PROGRAM)p.bin: $(SOURCE_FILES) ../master-makefile
 rcr: $(PROGRAM)r.bin
 
 $(PROGRAM)r.bin: $(SOURCE_FILES) ../master-makefile
-       $(BUILDSCRIPT)  $(COREPINFLAG) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
+       $(BUILDSCRIPT)  $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
 
 clean:
        rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin $(PROGRAM)r.bin
index 5f3b0946a0f9987d4868ecefb9d52e914be72066..b45112b6f6f6f2ccc20100f9f1dc195b06df3dce 100644 (file)
@@ -77,20 +77,18 @@ public class JGFMolDynBench {
 
     // spawn threads
     MDWrap[] thobjects = new MDWrap[numthreads];
-
     for (int i = 0; i < numthreads; i++) {
       thobjects[i] = new MDWrap(new mdRunner(i, mold.mm, sh_force, sh_force2, mold.nthreads, mold,mold.workload));
     }
-
     /*
      * boolean waitfordone=true; while(waitfordone) { if (mybarr.done)
      * waitfordone=false; }
      */
     long start=System.currentTimeMillis();
-    for (int i = 0; i < numthreads; i++) {
+//    for (int i = 0; i < numthreads; i++) {
       // thobjects[i].md.start(mid[i]);
-      thobjects[i].md.run();
-    }
+      thobjects[0].md.run();
+//    }
     long end=System.currentTimeMillis();
 //    System.out.println("Total="+(end-start));
   }
index f7bd7d53fbf3b8965dbb397d5139bcdde46628d4..69837e1dd22ae45ac7c60aad683ce38228ad70bc 100644 (file)
@@ -5,4 +5,6 @@ SOURCE_FILES=JGFMolDynBenchSizeB.java
 NUM_OOO_WORKERS=24
 NUM_RCR_WORKERS=23
 
+BMFLAGS=-nostalltr
+
 include ../master-makefile
index 4585b2419d0dd8839ef830297928858546f0c022..ca764f316b5d98a63dff4cf0e6f50626461d36b9 100755 (executable)
@@ -1 +1 @@
-time ./JGFMolDynBenchSizeBr.bin 1 128
+time ./JGFMolDynBenchSizeBr.bin 1 215
index 81f32ad64c05ca67d9836025d5a9a4d389ab83a5..980264557f2c91107f1169cb228afea4ff295b6e 100644 (file)
@@ -4,6 +4,6 @@ SOURCE_FILES=JGFSORBenchSizeD.java
 
 NUM_OOO_WORKERS=24
 NUM_RCR_WORKERS=23
-COREPINFLAG=-corepin
+#BMFLAGS=-corepin
 
 include ../master-makefile
index 3ae8dca484bd87d183405bec4cbf330756df3081..a94f438def7578e1560119ae75496ca9210e47c7 100644 (file)
@@ -301,7 +301,7 @@ public class BuildCode {
       //TODO signal the object that will report errors
       if(state.RCR) {
         try {
-          rcr = new RuntimeConflictResolver(PREFIX, oooa);
+          rcr = new RuntimeConflictResolver(PREFIX, oooa, state);
           rcr.setGlobalEffects(oooa.getDisjointAnalysis().getEffectsAnalysis().getAllEffects());
         } catch (FileNotFoundException e) {
           System.out.println("Runtime Conflict Resolver could not create output file.");
index ca36565cf82115738511e10d685f427add3cc0b4..f5827ef0f18400f410c64fcd021a69793c893a79 100644 (file)
@@ -12,7 +12,10 @@ import java.util.Vector;
 import Util.Tuple;
 import Analysis.Disjoint.*;
 import Analysis.MLP.CodePlan;
+import IR.State;
 import IR.TypeDescriptor;
+import Analysis.OoOJava.ConflictGraph;
+import Analysis.OoOJava.ConflictNode;
 import Analysis.OoOJava.OoOJavaAnalysis;
 
 /* An instance of this class manages all OoOJava coarse-grained runtime conflicts
@@ -68,10 +71,12 @@ public class RuntimeConflictResolver {
   private ArrayList<TaintAndInternalHeapStructure> pendingPrintout;
   private EffectsTable effectsLookupTable;
   private OoOJavaAnalysis oooa;
+  private State state;
 
-  public RuntimeConflictResolver(String buildir, OoOJavaAnalysis oooa) throws FileNotFoundException {
+  public RuntimeConflictResolver(String buildir, OoOJavaAnalysis oooa, State state) throws FileNotFoundException {
     String outputFile = buildir + "RuntimeConflictResolver";
     this.oooa=oooa;
+    this.state=state;
 
     cFile = new PrintWriter(new File(outputFile + ".c"));
     headerFile = new PrintWriter(new File(outputFile + ".h"));
@@ -437,10 +442,23 @@ public class RuntimeConflictResolver {
       Vector<TempDescriptor> invars=fsen.getInVarsForDynamicCoarseConflictResolution();
       for(int i=0;i<invars.size();i++) {
         TempDescriptor tmp=invars.get(i);
+        
+        // FIX IT LATER! Right now, we assume that there is only one parent
+        FlatSESEEnterNode parentSESE = (FlatSESEEnterNode) fsen.getSESEParent().iterator().next();
+        ConflictGraph graph=oooa.getConflictGraph(parentSESE);
+        String id = tmp + "_sese" + fsen.getPrettyIdentifier();
+        ConflictNode node = graph.getId2cn().get(id);        
+        
        if (i!=0) {
            cFile.println("      if (record->rcrstatus!=0)");
        }
-        cFile.println("      " + this.getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen));
+       
+        if(state.NOSTALLTR && node.IsValidToPrune()){
+          cFile.println("    /*  " + this.getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen)+"*/");
+        }else{
+          cFile.println("      " + this.getTraverserInvocation(tmp, "rec->"+tmp+", rec", fsen));
+        }
+        
       }
       //release traverser reference...traversal finished...
       //executing thread will clean bins for us
index 459021b14e5c5cdf1a573b6f14480ea72f69e99e..c9ac058a6c8f877f475cc858d86cb821f9516c0b 100644 (file)
@@ -105,6 +105,7 @@ public class State {
   public boolean OOOJAVA=false;
   public boolean OOODEBUG=false;
   public boolean RCR=false;
+  public boolean NOSTALLTR=false;
 
 
   public boolean OPTIONAL=false;
index d33533db08962315cba8604aeb807bbf5f1442da..d6eb421d7937870a0e45d0deacbc8e46f2f9839e 100644 (file)
@@ -338,8 +338,10 @@ public class Main {
       } else if (option.equals("-ooodebug") ){ 
   state.OOODEBUG  = true;
       } else if (option.equals("-rcr")){
-   state.RCR = true;
-      } else if (option.equals("-help")) {
+  state.RCR = true;
+      } else if (option.equals("-nostalltr")){
+  state.NOSTALLTR = true;     
+      }else if (option.equals("-help")) {      
        System.out.println("-classlibrary classlibrarydirectory -- directory where classlibrary is located");
        System.out.println("-selfloop task -- this task doesn't self loop its parameters forever");
        System.out.println("-dir outputdirectory -- output code in outputdirectory");
index f1ef1978b3b46631fe5bf571531b6309ad63d56d..6c6c78eeb2dca20af2cb6b73dc5330d9e7ee5728 100755 (executable)
@@ -29,6 +29,7 @@ echo -mempool-detect-misuse turn on to find code misusing pool-allocated records
 echo -rcr turn on runtime conflict resolver
 echo -squeue use single queue
 echo -corepin use core pinning
+echo -nostalltr turn off RCR traversers that only handle conflicts between task and stallsite
 echo
 echo Disjoint Reachability Analysis options
 echo -disjoint enable analysis
@@ -579,6 +580,10 @@ then
 EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
 shift
 
+elif [[ $1 = '-nostalltr' ]]
+then
+JAVAOPTS="$JAVAOPTS -nostalltr"
+
 elif [[ $1 = '-rcr' ]]
 then
 JAVAOPTS="$JAVAOPTS -rcr"