From: jjenista Date: Thu, 18 Nov 2010 06:14:53 +0000 (+0000) Subject: force oid increment to be a prime number X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6a74e2512973b815546d98599d6fbb45d06556d7;p=IRC.git force oid increment to be a prime number --- diff --git a/Robust/src/Benchmarks/oooJava/master-makefile b/Robust/src/Benchmarks/oooJava/master-makefile index 8e84a301..870f822f 100644 --- a/Robust/src/Benchmarks/oooJava/master-makefile +++ b/Robust/src/Benchmarks/oooJava/master-makefile @@ -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 \ diff --git a/Robust/src/Benchmarks/oooJava/moldyn/makefile b/Robust/src/Benchmarks/oooJava/moldyn/makefile index 6ef3d563..f7bd7d53 100644 --- a/Robust/src/Benchmarks/oooJava/moldyn/makefile +++ b/Robust/src/Benchmarks/oooJava/moldyn/makefile @@ -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 diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 160fb0c6..3ae8dca4 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -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()+");"); } diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 9094dd64..7acd62b2 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -16,7 +16,7 @@ #include "deque.h" #endif #include "workschedule.h" -extern int numWorkSchedWorkers; +extern volatile int numWorkSchedWorkers; extern deque* deques; #endif diff --git a/Robust/src/Runtime/workschedule.c b/Robust/src/Runtime/workschedule.c index 108a3917..94b3a17c 100644 --- a/Robust/src/Runtime/workschedule.c +++ b/Robust/src/Runtime/workschedule.c @@ -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