bw.close();
}
+
+ public Hashtable<String, ConflictNode> getId2cn() {
+ return id2cn;
+ }
}
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;
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;
+ }
+
}
$(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
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
// 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));
}
NUM_OOO_WORKERS=24
NUM_RCR_WORKERS=23
+BMFLAGS=-nostalltr
+
include ../master-makefile
-time ./JGFMolDynBenchSizeBr.bin 1 128
+time ./JGFMolDynBenchSizeBr.bin 1 215
NUM_OOO_WORKERS=24
NUM_RCR_WORKERS=23
-COREPINFLAG=-corepin
+#BMFLAGS=-corepin
include ../master-makefile
//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.");
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
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"));
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
public boolean OOOJAVA=false;
public boolean OOODEBUG=false;
public boolean RCR=false;
+ public boolean NOSTALLTR=false;
public boolean OPTIONAL=false;
} 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");
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
EXTRAOPTIONS="$EXTRAOPTIONS -DINITIALHEAPSIZE_MB=($2)"
shift
+elif [[ $1 = '-nostalltr' ]]
+then
+JAVAOPTS="$JAVAOPTS -nostalltr"
+
elif [[ $1 = '-rcr' ]]
then
JAVAOPTS="$JAVAOPTS -rcr"