force oid increment to be a prime number
authorjjenista <jjenista>
Thu, 18 Nov 2010 06:14:53 +0000 (06:14 +0000)
committerjjenista <jjenista>
Thu, 18 Nov 2010 06:14:53 +0000 (06:14 +0000)
Robust/src/Benchmarks/oooJava/master-makefile
Robust/src/Benchmarks/oooJava/moldyn/makefile
Robust/src/IR/Flat/BuildCode.java
Robust/src/Runtime/garbage.c
Robust/src/Runtime/workschedule.c

index 8e84a30109aad4c7fde399b1049c4dc5de58b9d4..870f822f0ab8f36a21e4f632569ec99bf2532723 100644 (file)
@@ -13,7 +13,7 @@ BUILDSCRIPT=../../../buildscript
 
 
 COREPROFOVERFLOW= #-coreprof-checkoverflow
-USECOREPROF= #-coreprof $(COREPROFOVERFLOW) \
+USECOREPROF= -coreprof $(COREPROFOVERFLOW) \
        -coreprof-eventwords 1024*1024*128 \
        -coreprof-enable cpe_main \
        -coreprof-enable cpe_taskexecute \
index 6ef3d5634b2aa30856261dd0474c2957d8690a53..f7bd7d53fbf3b8965dbb397d5139bcdde46628d4 100644 (file)
@@ -3,6 +3,6 @@ PROGRAM=JGFMolDynBenchSizeB
 SOURCE_FILES=JGFMolDynBenchSizeB.java
 
 NUM_OOO_WORKERS=24
-NUM_RCR_WORKERS=24
+NUM_RCR_WORKERS=23
 
 include ../master-makefile
index 160fb0c6b9f5c2291d5fab0d26ae3e04a6dff8f6..3ae8dca484bd87d183405bec4cbf330756df3081 100644 (file)
@@ -1267,7 +1267,7 @@ public class BuildCode {
     outclassdefs.print("int numprefetchsites = " + pa.prefetchsiteid + ";\n");
     if(this.state.MLP || state.OOOJAVA ){
        outclassdefs.print("extern __thread int oid;\n");
-       outclassdefs.print("extern int numWorkSchedWorkers;\n");
+       outclassdefs.print("extern int oidIncrement;\n");
     }
 
     Iterator it=state.getClassSymbolTable().getDescriptorsIterator();
@@ -5631,7 +5631,7 @@ public class BuildCode {
       } else if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
          if(this.state.MLP || state.OOOJAVA){
             output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarray_mlp("+localsprefixaddr+", "+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+", oid, "+oooa.getDisjointAnalysis().getAllocationSiteFromFlatNew(fn).getUniqueAllocSiteID()+");");
-       output.println("    oid += numWorkSchedWorkers;");
+       output.println("    oid += oidIncrement;");
          }else{
     output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_newarray("+localsprefixaddr+", "+arrayid+", "+generateTemp(fm, fn.getSize(),lb)+");");                     
          }
@@ -5644,7 +5644,7 @@ public class BuildCode {
       } else if ((GENERATEPRECISEGC) || (this.state.MULTICOREGC)) {
          if (this.state.MLP || state.OOOJAVA){
        output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_new_mlp("+localsprefixaddr+", "+fn.getType().getClassDesc().getId()+", oid, "+oooa.getDisjointAnalysis().getAllocationSiteFromFlatNew(fn).getUniqueAllocSiteID()+");");
-       output.println("    oid += numWorkSchedWorkers;");
+       output.println("    oid += oidIncrement;");
          } else {
     output.println(generateTemp(fm,fn.getDst(),lb)+"=allocate_new("+localsprefixaddr+", "+fn.getType().getClassDesc().getId()+");");                     
          }
index 9094dd647319c5667111a648c181c690cd473846..7acd62b2fe9515e0b34a6ac9247827aed07aa6a4 100644 (file)
@@ -16,7 +16,7 @@
 #include "deque.h"
 #endif
 #include "workschedule.h"
-extern int    numWorkSchedWorkers;
+extern volatile int    numWorkSchedWorkers;
 extern deque* deques;
 #endif
 
index 108a39173991ce75b9938ce54a6f3f85d06018ca..94b3a17c288acd66980a58786d08aedd75ef2b46 100644 (file)
@@ -69,6 +69,7 @@ __thread int myWorkerID;
 const int workerID_NOTAWORKER = 0xffffff0;
 
 
+int oidIncrement;
 volatile int numWorkSchedWorkers;
 int realnumWorkSchedWorkers;
 static WorkerData*  workerDataArray;
@@ -284,6 +285,21 @@ void workScheduleInit( int numProcessors,
 
   numWorkSchedWorkers = numProcessors;
   realnumWorkSchedWorkers=numProcessors;
+  oidIncrement=numProcessors;
+  while(1) {
+    int x=2;
+    //check primality
+    for(;x<oidIncrement;x++) {
+      //not prime
+      if (oidIncrement%x==0) {
+        oidIncrement++;
+        break;
+      }
+    }
+    //have prime
+    if (x==oidIncrement)
+      break;
+  }
 
   workFunc = func;