From ba86a5b23723322cf294a13d1556eb44b9e56a3e Mon Sep 17 00:00:00 2001 From: adash Date: Sun, 4 May 2008 01:18:28 +0000 Subject: [PATCH] changes --- .../Prefetch/SOR/dsm/JGFSORBench.java | 8 +- .../Prefetch/SOR/dsm/SORRunner.java | 97 ++++++++----------- .../src/Benchmarks/Prefetch/SOR/dsm/makefile | 22 +++-- 3 files changed, 61 insertions(+), 66 deletions(-) diff --git a/Robust/src/Benchmarks/Prefetch/SOR/dsm/JGFSORBench.java b/Robust/src/Benchmarks/Prefetch/SOR/dsm/JGFSORBench.java index b0f1a1b7..21773b9e 100644 --- a/Robust/src/Benchmarks/Prefetch/SOR/dsm/JGFSORBench.java +++ b/Robust/src/Benchmarks/Prefetch/SOR/dsm/JGFSORBench.java @@ -39,7 +39,7 @@ public class JGFSORBench { RANDOM_SEED = 10101010; R = global new Random(RANDOM_SEED); Gtotal = 0.0; - cachelinesize = 128; + cachelinesize = 1; } public void JGFsetsize(int size){ @@ -92,10 +92,10 @@ public class JGFSORBench { SORRunner tmp; int[] mid = new int[4]; - mid[0] = (128<<24)|(195<<16)|(175<<8)|69; - mid[1] = (128<<24)|(195<<16)|(175<<8)|78; + mid[0] = (128<<24)|(195<<16)|(175<<8)|79; + mid[1] = (128<<24)|(195<<16)|(175<<8)|80; mid[2] = (128<<24)|(195<<16)|(175<<8)|73; - mid[3] = (128<<24)|(195<<16)|(175<<8)|79; + mid[3] = (128<<24)|(195<<16)|(175<<8)|78; for(int i=1;i Mm1) iupper = Mm1+1; if (tmpid == (numthreads-1)) iupper = Mm1+1; - atomic { for (int p=0; p<2*numiterations; p++) { - for (int i=ilow+(p%2); i prevvalue) { - donecount++; - } - } - if (id == 0) { - donecount = 0; - prevvalue++; - } - /* // Wait for neighbours; - if (id > 0) { - System.printString("id: " + id + " sync: id-1 0 " + sync[id-1][0] + " id 0" + sync[id][0] + "\n"); - while (sync[id-1][0] < sync[id][0]) ; - System.printString("id: " + id + " sync: id-1 0 " + sync[id-1][0] + " id 0" + sync[id][0] + "\n"); + long ourcount; + boolean done=true; + + atomic { + sync[tmpid][0]++; + ourcount=sync[tmpid][0]; } - if (id < nthreads -1) { - System.printString("id: " + id + " sync: id 0 " + sync[id][0] + " id+1 0" + sync[id+1][0] + "\n"); - while (sync[id+1][0] < sync[id][0]) ; - System.printString("id: " + id + " sync: id 0 " + sync[id][0] + " id+1 0" + sync[id+1][0] + "\n"); + + while(done) { + atomic { + if ((tmpid==0 || ourcount <= sync[tmpid-1][0]) + &&((tmpid==(numthreads-1))||ourcount<=sync[tmpid+1][0])) + done=false; + } } - */ - } - } //end of atomic + + }//end of for } //end of run() } diff --git a/Robust/src/Benchmarks/Prefetch/SOR/dsm/makefile b/Robust/src/Benchmarks/Prefetch/SOR/dsm/makefile index 375d7099..4615bc04 100644 --- a/Robust/src/Benchmarks/Prefetch/SOR/dsm/makefile +++ b/Robust/src/Benchmarks/Prefetch/SOR/dsm/makefile @@ -1,15 +1,21 @@ MAINCLASS=JGFSORBenchSizeA SRC=${MAINCLASS}.java \ -JGFSORBench.java \ -JGFInstrumentor.java \ -JGFTimer.java \ -SORRunner.java -FLAGS=-dsm -prefetch -nooptimize -debug -profile -excprefetch JGFSORBench.RandomMatrix -excprefetch JGFSORBench.init_sync -excprefetch JGFSORBench.JGFkernel -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8 -FLAGS2=-dsm -nooptimize -debug -profile -mainclass ${MAINCLASS} -o ${MAINCLASS}NP + JGFSORBench.java \ + JGFInstrumentor.java \ + JGFTimer.java \ + SORRunner.java +FLAGS=-dsm -prefetch -nooptimize -debug -profile -excprefetch JGFSORBench.RandomMatrix -excprefetch JGFSORBench.init_sync -excprefetch JGFSORBench.JGFkernel -mainclass ${MAINCLASS} -trueprob 0.8 +FLAGS2=-dsm -nooptimize -debug -profile -mainclass ${MAINCLASS} default: - ../../../../buildscript ${FLAGS2} ${SRC} - ../../../../buildscript ${FLAGS} ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}1NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS}1 ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}2NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS}2 ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}4NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS}4 ${SRC} clean: rm -rf tmpbuilddirectory -- 2.34.1