From: adash Date: Wed, 14 May 2008 00:19:06 +0000 (+0000) Subject: Remove unnecessary files X-Git-Tag: preEdgeChange~86 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=578be7c368fa1d67e4c4ca34ab1744fa86322087;p=IRC.git Remove unnecessary files Remove print statements from benchmarks Modify java version for Moldyn benchmark make changes to most makefiles to be compliant with our run.sh script add a new script(ang.sh) to calculate averages in the runlog directory --- diff --git a/Robust/src/Benchmarks/Prefetch/Array/makefile b/Robust/src/Benchmarks/Prefetch/Array/makefile index b1ebcdbf..4ea4c33d 100644 --- a/Robust/src/Benchmarks/Prefetch/Array/makefile +++ b/Robust/src/Benchmarks/Prefetch/Array/makefile @@ -1,10 +1,12 @@ MAINCLASS=Array SRC1=${MAINCLASS}.java -FLAGS=-dsm -prefetch -optimize -debug -excprefetch Array.Array -mainclass ${MAINCLASS} -trueprob 0.7 -FLAGS2=-dsm -optimize -debug -excprefetch Array.Array -mainclass ${MAINCLASS} -trueprob 0.7 +FLAGS=-dsm -prefetch -optimize -debug -excprefetch Array.Array -mainclass ${MAINCLASS} -trueprob 0.98 +FLAGS2=-dsm -optimize -debug -excprefetch Array.Array -mainclass ${MAINCLASS} default: ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC1} ../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1} + cp ${MAINCLASS}NP.bin ${MAINCLASS}1NP.bin + cp ${MAINCLASS}P.bin ${MAINCLASS}1.bin clean: rm *.bin diff --git a/Robust/src/Benchmarks/Prefetch/Chase/makefile b/Robust/src/Benchmarks/Prefetch/Chase/makefile index 96dc9711..89d610d8 100644 --- a/Robust/src/Benchmarks/Prefetch/Chase/makefile +++ b/Robust/src/Benchmarks/Prefetch/Chase/makefile @@ -2,9 +2,13 @@ MAINCLASS=Chase SRC1=${MAINCLASS}.java FLAGS=-dsm -prefetch -optimize -debug -excprefetch Chase.main -excprefetch Chase.Chase -mainclass ${MAINCLASS} -trueprob 0.7 FLAGS2=-dsm -optimize -debug -mainclass ${MAINCLASS} -trueprob 0.7 +#for testing no java option +#FLAGS=-dsm -prefetch -optimize -debug -excprefetch Chase.main -excprefetch Chase.Chase -mainclass ${MAINCLASS} -trueprob 0.99 -nojava default: ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC1} ../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1} + cp ${MAINCLASS}NP.bin ${MAINCLASS}1NP.bin + cp ${MAINCLASS}P.bin ${MAINCLASS}1.bin clean: rm *.bin diff --git a/Robust/src/Benchmarks/Prefetch/Crypt/dsm/crypt/IDEATest.java b/Robust/src/Benchmarks/Prefetch/Crypt/dsm/crypt/IDEATest.java index 02a76446..550224da 100644 --- a/Robust/src/Benchmarks/Prefetch/Crypt/dsm/crypt/IDEATest.java +++ b/Robust/src/Benchmarks/Prefetch/Crypt/dsm/crypt/IDEATest.java @@ -39,6 +39,7 @@ //import java.util.*; //import jgfutil.*; +/* class IDEATest { @@ -58,21 +59,21 @@ class IDEATest int [] Z; // Encryption subkey (userkey derived). int [] DK; // Decryption subkey (userkey derived). - void Do(int nthreads, JGFInstrumentor instr) + void Do(int nthreads) { int mid = (128<<24)|(195<<16)|(175<<8)|73; - IDEARunner tmp; IDEARunner[] th; atomic { th = global new IDEARunner [nthreads]; } // Start the stopwatch. - instr.startTimer("Section2:Crypt:Kernel"); + //instr.startTimer("Section2:Crypt:Kernel"); // Encrypt plain1. + IDEARunner tmp; for(int i=1;i 1) b.cleared=true; b.entercount--; - //return; ret1 = true; } retry=false; } } } while(retry); - if (ret1) return; + if (ret1) { + return; + } while(ret2) { atomic { if (b.cleared) { @@ -45,7 +46,6 @@ public class Barrier { int count = b.entercount; if (count==0) b.cleared=false; - //return; ret2=false; } } diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraphN.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraphN.java index 19793c1d..fdcf37b1 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraphN.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/BiGraphN.java @@ -97,7 +97,7 @@ public class BiGraph **/ public void makeNeighbors( int indexBegin, int indexEnd, Random r ) { - System.printString( "Making unique neighbors for hNodes...\n" ); + //System.printString( "Making unique neighbors for hNodes...\n" ); // making neighbors //if (verbose) System.printString("updating from and coeffs"); @@ -106,7 +106,7 @@ public class BiGraph n.makeUniqueNeighbors(eNodes, r); } - System.printString( "Making unique neighbors for eNodes...\n" ); + //System.printString( "Making unique neighbors for eNodes...\n" ); for (int i = indexBegin; i < indexEnd; i++) { Node n = eNodes[i]; @@ -117,7 +117,7 @@ public class BiGraph public void makeFromNodes( int indexBegin, int indexEnd ) { - System.printString( "Making h fromNodes...\n" ); + //System.printString( "Making h fromNodes...\n" ); // Create the fromNodes and coeff field //if (verbose) System.printString("filling from fields"); @@ -126,7 +126,7 @@ public class BiGraph n.makeFromNodes(); } - System.printString( "Making e fromNodes...\n" ); + //System.printString( "Making e fromNodes...\n" ); for(int i = indexBegin; i < indexEnd; i++) { Node n = eNodes[i]; @@ -137,7 +137,7 @@ public class BiGraph public void makeFromLinks( int indexBegin, int indexEnd, Random r ) { - System.printString( "Updating h fromNodes...\n" ); + //System.printString( "Updating h fromNodes...\n" ); // Update the fromNodes for(int i = indexBegin; i < indexEnd; i++) { @@ -145,7 +145,7 @@ public class BiGraph n.updateFromNodes(r); } - System.printString( "Updating e fromNodes...\n" ); + //System.printString( "Updating e fromNodes...\n" ); for(int i = indexBegin; i < indexEnd; i++) { Node n = eNodes[i]; diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d1.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d1.java deleted file mode 100644 index b9a04f5d..00000000 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d1.java +++ /dev/null @@ -1,237 +0,0 @@ -/** - * - * - * Java implementation of the em3d Olden benchmark. This Olden - * benchmark models the propagation of electromagnetic waves through - * objects in 3 dimensions. It is a simple computation on an irregular - * bipartite graph containing nodes representing electric and magnetic - * field values. - * - *

- * D. Culler, A. Dusseau, S. Goldstein, A. Krishnamurthy, S. Lumetta, T. von - * Eicken and K. Yelick. "Parallel Programming in Split-C". Supercomputing - * 1993, pages 262-273. - * - **/ -public class Em3d extends Thread -{ - - /** - * The number of nodes (E and H) - **/ - private int numNodes; - /** - * The out-degree of each node. - **/ - private int numDegree; - /** - * The number of compute iterations - **/ - private int numIter; - /** - * Should we print the results and other runtime messages - **/ - private boolean printResult; - /** - * Print information messages? - **/ - private boolean printMsgs; - - BiGraph bg; - int upperlimit; - int lowerlimit; - Barrier mybarr; - - public Em3d() { - numNodes = 0; - numDegree = 0; - numIter = 1; - printResult = false; - printMsgs = false; - } - - public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, Barrier mybarr) { - this.bg = bg; - this.lowerlimit = lowerlimit; - this.upperlimit = upperlimit; - this.numIter = numIter; - this.mybarr = mybarr; - } - - public void run() { - int iteration; - Barrier barr; - Node enodebase; - Node hnodebase; - - atomic { - iteration = numIter; - barr=mybarr; - } - atomic { - enodebase=bg.eNodes; - hnodebase=bg.hNodes; - for(int j = 0; j numThreads = " + numThreads+"\n"); - Barrier mybarr; - atomic { - mybarr = global new Barrier(numThreads); - } - BiGraph graph; - Random rand = new Random(783); - atomic { - graph = BiGraph.create(em.numNodes, em.numDegree, em.printResult, rand); - } - - long end0 = System.currentTimeMillis(); - - // compute a single iteration of electro-magnetic propagation - if (em.printMsgs) - System.printString("Propagating field values for " + em.numIter + - " iteration(s)...\n"); - long start1 = System.currentTimeMillis(); - Em3d[] em3d; - atomic { - em3d = global new Em3d[numThreads]; - em3d[0] = global new Em3d(graph, 0, em.numNodes, em.numIter, mybarr); - } - - Em3d tmp; - for(int i = 0; i -d [-p] [-m] [-h]\n"); - System.printString(" -N the number of nodes\n"); - System.printString(" -d the out-degree of each node\n"); - System.printString(" -i the number of iterations\n"); - System.printString(" -p (print detailed results\n)"); - System.printString(" -m (print informative messages)\n"); - System.printString(" -h (this message)\n"); - } - -} diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java deleted file mode 100644 index 22bda0a3..00000000 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d2.java +++ /dev/null @@ -1,239 +0,0 @@ -/** - * - * - * Java implementation of the em3d Olden benchmark. This Olden - * benchmark models the propagation of electromagnetic waves through - * objects in 3 dimensions. It is a simple computation on an irregular - * bipartite graph containing nodes representing electric and magnetic - * field values. - * - *

- * D. Culler, A. Dusseau, S. Goldstein, A. Krishnamurthy, S. Lumetta, T. von - * Eicken and K. Yelick. "Parallel Programming in Split-C". Supercomputing - * 1993, pages 262-273. - * - **/ -public class Em3d extends Thread -{ - - /** - * The number of nodes (E and H) - **/ - private int numNodes; - /** - * The out-degree of each node. - **/ - private int numDegree; - /** - * The number of compute iterations - **/ - private int numIter; - /** - * Should we print the results and other runtime messages - **/ - private boolean printResult; - /** - * Print information messages? - **/ - private boolean printMsgs; - - BiGraph bg; - int upperlimit; - int lowerlimit; - Barrier mybarr; - - public Em3d() { - numNodes = 0; - numDegree = 0; - numIter = 1; - printResult = false; - printMsgs = false; - } - - public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, Barrier mybarr) { - this.bg = bg; - this.lowerlimit = lowerlimit; - this.upperlimit = upperlimit; - this.numIter = numIter; - this.mybarr = mybarr; - } - - public void run() { - int iteration; - Barrier barr; - Node enodebase; - Node hnodebase; - - atomic { - iteration = numIter; - barr=mybarr; - } - atomic { - enodebase=bg.eNodes; - hnodebase=bg.hNodes; - for(int j = 0; j numThreads = " + numThreads+"\n"); - Barrier mybarr; - atomic { - mybarr = global new Barrier(numThreads); - } - BiGraph graph; - Random rand = new Random(783); - atomic { - graph = BiGraph.create(em.numNodes, em.numDegree, em.printResult, rand); - } - - long end0 = System.currentTimeMillis(); - - // compute a single iteration of electro-magnetic propagation - if (em.printMsgs) - System.printString("Propagating field values for " + em.numIter + - " iteration(s)...\n"); - long start1 = System.currentTimeMillis(); - Em3d[] em3d; - atomic { - em3d = global new Em3d[numThreads]; - em3d[0] = global new Em3d(graph, 0, em.numNodes/2, em.numIter, mybarr); - em3d[1] = global new Em3d(graph, (em.numNodes/2) + 1, em.numNodes, em.numIter, mybarr); - } - - Em3d tmp; - for(int i = 0; i -d [-p] [-m] [-h]\n"); - System.printString(" -N the number of nodes\n"); - System.printString(" -d the out-degree of each node\n"); - System.printString(" -i the number of iterations\n"); - System.printString(" -p (print detailed results\n)"); - System.printString(" -m (print informative messages)\n"); - System.printString(" -h (this message)\n"); - } - -} diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d4.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d4.java deleted file mode 100644 index 73c71fa8..00000000 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3d4.java +++ /dev/null @@ -1,243 +0,0 @@ -/** - * - * - * Java implementation of the em3d Olden benchmark. This Olden - * benchmark models the propagation of electromagnetic waves through - * objects in 3 dimensions. It is a simple computation on an irregular - * bipartite graph containing nodes representing electric and magnetic - * field values. - * - *

- * D. Culler, A. Dusseau, S. Goldstein, A. Krishnamurthy, S. Lumetta, T. von - * Eicken and K. Yelick. "Parallel Programming in Split-C". Supercomputing - * 1993, pages 262-273. - * - **/ -public class Em3d extends Thread -{ - - /** - * The number of nodes (E and H) - **/ - private int numNodes; - /** - * The out-degree of each node. - **/ - private int numDegree; - /** - * The number of compute iterations - **/ - private int numIter; - /** - * Should we print the results and other runtime messages - **/ - private boolean printResult; - /** - * Print information messages? - **/ - private boolean printMsgs; - - BiGraph bg; - int upperlimit; - int lowerlimit; - Barrier mybarr; - - public Em3d() { - numNodes = 0; - numDegree = 0; - numIter = 1; - printResult = false; - printMsgs = false; - } - - public Em3d(BiGraph bg, int lowerlimit, int upperlimit, int numIter, Barrier mybarr) { - this.bg = bg; - this.lowerlimit = lowerlimit; - this.upperlimit = upperlimit; - this.numIter = numIter; - this.mybarr = mybarr; - } - - public void run() { - int iteration; - Barrier barr; - Node enodebase; - Node hnodebase; - - atomic { - iteration = numIter; - barr=mybarr; - } - atomic { - enodebase=bg.eNodes; - hnodebase=bg.hNodes; - for(int j = 0; j numThreads = " + numThreads+"\n"); - Barrier mybarr; - atomic { - mybarr = global new Barrier(numThreads); - } - BiGraph graph; - Random rand = new Random(783); - atomic { - graph = BiGraph.create(em.numNodes, em.numDegree, em.printResult, rand); - } - - long end0 = System.currentTimeMillis(); - - // compute a single iteration of electro-magnetic propagation - if (em.printMsgs) - System.printString("Propagating field values for " + em.numIter + - " iteration(s)...\n"); - long start1 = System.currentTimeMillis(); - Em3d[] em3d; - atomic { - em3d = global new Em3d[numThreads]; - em3d[0] = global new Em3d(graph, 0, em.numNodes/4, em.numIter, mybarr); - em3d[1] = global new Em3d(graph, (em.numNodes/4) + 1, em.numNodes/2, em.numIter, mybarr); - em3d[2] = global new Em3d(graph, (em.numNodes/2) + 1, (3*em.numNodes)/4, em.numIter, mybarr); - em3d[3] = global new Em3d(graph, ((3*em.numNodes)/4 + 1), em.numNodes, em.numIter, mybarr); - } - - Em3d tmp; - for(int i = 0; i -d [-p] [-m] [-h]\n"); - System.printString(" -N the number of nodes\n"); - System.printString(" -d the out-degree of each node\n"); - System.printString(" -i the number of iterations\n"); - System.printString(" -p (print detailed results\n)"); - System.printString(" -m (print informative messages)\n"); - System.printString(" -h (this message)\n"); - } - -} diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3dN.java b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3dN.java index b90711c6..49113568 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3dN.java +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/Em3dN.java @@ -166,8 +166,8 @@ public class Em3d extends Thread long start0 = System.currentTimeMillis(); int numThreads = em.numThreads; int[] mid = new int[4]; - mid[0] = (128<<24)|(195<<16)|(175<<8)|69;//dw-1 - mid[1] = (128<<24)|(195<<16)|(175<<8)|70;//dw-2 + mid[0] = (128<<24)|(195<<16)|(175<<8)|79;//dw-1 + mid[1] = (128<<24)|(195<<16)|(175<<8)|80;//dw-2 mid[2] = (128<<24)|(195<<16)|(175<<8)|73; mid[3] = (128<<24)|(195<<16)|(175<<8)|78; System.printString("DEBUG -> numThreads = " + numThreads+"\n"); @@ -177,7 +177,7 @@ public class Em3d extends Thread // initialization step 1: allocate BiGraph - System.printString( "Allocating BiGraph.\n" ); + // System.printString( "Allocating BiGraph.\n" ); atomic { mybarr = global new Barrier(numThreads); @@ -195,7 +195,7 @@ public class Em3d extends Thread // initialization step 2: divide work of allocating nodes - System.printString( "Launching distributed allocation of nodes.\n" ); + // System.printString( "Launching distributed allocation of nodes.\n" ); atomic { em3d = global new Em3d[numThreads]; @@ -225,7 +225,7 @@ public class Em3d extends Thread // initialization step 3: link together the ends of segments // that were allocated and internally linked in step 2 - System.printString( "Linking together allocated segments.\n" ); + // System.printString( "Linking together allocated segments.\n" ); base = 0; for(int i = 0; i < numThreads - 1; i++) { @@ -236,7 +236,7 @@ public class Em3d extends Thread } // initialization step 4: divide work of making links - System.printString( "Launching distributed neighbor initialization.\n" ); + // System.printString( "Launching distributed neighbor initialization.\n" ); atomic { em3d = global new Em3d[numThreads]; @@ -265,7 +265,7 @@ public class Em3d extends Thread } // initialization step 5: divide work of making from links - System.printString( "Launching distributed makeFromNodes initialization.\n" ); + //System.printString( "Launching distributed makeFromNodes initialization.\n" ); atomic { em3d = global new Em3d[numThreads]; @@ -294,7 +294,7 @@ public class Em3d extends Thread } // initialization step 6: divide work of making from links - System.printString( "Launching distributed fromLink initialization.\n" ); + //System.printString( "Launching distributed fromLink initialization.\n" ); atomic { em3d = global new Em3d[numThreads]; @@ -323,7 +323,7 @@ public class Em3d extends Thread } // initialization complete - System.printString( "Initialization complete.\n" ); + //System.printString( "Initialization complete.\n" ); long end0 = System.currentTimeMillis(); diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/README b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/README new file mode 100644 index 00000000..05de81ff --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/README @@ -0,0 +1,6 @@ +Create the dstm.conf file +To compile: + make +To run the Em3dNP.bin on single machine + ./Em3dNP.bin master -T -N -d -p + diff --git a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/makefile b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/makefile index f5ec498f..87b5a127 100644 --- a/Robust/src/Benchmarks/Prefetch/Em3d/dsm/makefile +++ b/Robust/src/Benchmarks/Prefetch/Em3d/dsm/makefile @@ -3,17 +3,27 @@ SRC=${MAINCLASS}.java \ BiGraph.java \ Node.java \ Barrier.java -SRC1=${MAINCLASS}N.java \ - BiGraphN.java \ +SRC1=${MAINCLASS}Nold.java \ + BiGraphNold.java \ Node.java \ Barrier.java -FLAGS=-dsm -prefetch -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -nooptimize -debug -mainclass ${MAINCLASS} -FLAGS2=-dsm -nooptimize -debug -mainclass ${MAINCLASS} +FLAGS=-dsm -prefetch -profile -excprefetch Em3d.main -excprefetch BiGraph.create -excprefetch Node.Node -excprefetch Node.fillTable -excprefetch Node.makeUniqueNeighbors -excprefetch Node.makeFromNodes -excprefetch Node.updateFromNodes -nooptimize -debug -mainclass ${MAINCLASS} -trueprob 0.91 +FLAGS2=-dsm -nooptimize -debug -profile -mainclass ${MAINCLASS} default: - ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC1} - ../../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS} ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}NNP ${SRC1} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS}N ${SRC1} + cp ${MAINCLASS}NNP.bin ${MAINCLASS}1NP.bin + cp ${MAINCLASS}N.bin ${MAINCLASS}1.bin + cp ${MAINCLASS}NNP.bin ${MAINCLASS}2NP.bin + cp ${MAINCLASS}N.bin ${MAINCLASS}2.bin + cp ${MAINCLASS}NNP.bin ${MAINCLASS}3NP.bin + cp ${MAINCLASS}N.bin ${MAINCLASS}3.bin + cp ${MAINCLASS}NNP.bin ${MAINCLASS}4NP.bin + cp ${MAINCLASS}N.bin ${MAINCLASS}4.bin clean: rm -rf tmpbuilddirectory diff --git a/Robust/src/Benchmarks/Prefetch/LUFact/dsm/Barrier.java b/Robust/src/Benchmarks/Prefetch/LUFact/dsm/Barrier.java index fda1503f..eb2bedec 100644 --- a/Robust/src/Benchmarks/Prefetch/LUFact/dsm/Barrier.java +++ b/Robust/src/Benchmarks/Prefetch/LUFact/dsm/Barrier.java @@ -30,7 +30,6 @@ public class Barrier { if(b.numthreads > 1) b.cleared=true; b.entercount--; - //return; ret1 = true; } retry=false; @@ -45,7 +44,6 @@ public class Barrier { int count = b.entercount; if (count==0) b.cleared=false; - //return; ret2=false; } } diff --git a/Robust/src/Benchmarks/Prefetch/LUFact/dsm/makefile b/Robust/src/Benchmarks/Prefetch/LUFact/dsm/makefile index 8b7b40f2..3ad1cc01 100644 --- a/Robust/src/Benchmarks/Prefetch/LUFact/dsm/makefile +++ b/Robust/src/Benchmarks/Prefetch/LUFact/dsm/makefile @@ -4,14 +4,21 @@ JGFLUFactBench.java \ JGFInstrumentor.java \ JGFTimer.java \ Barrier.java \ -Linpack.java \ LinpackRunner.java -FLAGS=-dsm -prefetch -nooptimize -debug -profile -excprefetch JGFLUFactBench.JGFkernel -excprefetch JGFLUFactBench.dmxpy -excprefetch JGFLUFactBench.JGFvalidate -excprefetch JGFLUFactBench.JGFinitialise -excprefetch JGFLUFactBench.matgen -excprefetch JGFLUFactBench.dgesl -mainclass ${MAINCLASS} -o ${MAINCLASS} -trueprob 0.8 -FLAGS2=-dsm -nooptimize -debug -profile -mainclass ${MAINCLASS} -o ${MAINCLASS}NP +FLAGS=-dsm -prefetch -nooptimize -debug -profile -excprefetch JGFLUFactBench.JGFkernel -excprefetch JGFLUFactBench.dmxpy -excprefetch JGFLUFactBench.JGFvalidate -excprefetch JGFLUFactBench.JGFinitialise -excprefetch JGFLUFactBench.matgen -excprefetch JGFLUFactBench.dgesl -mainclass ${MAINCLASS} -trueprob 0.95 +FLAGS2=-dsm -nooptimize -debug -profile -mainclass ${MAINCLASS} default: - ../../../../buildscript ${FLAGS2} ${SRC} - ../../../../buildscript ${FLAGS} ${SRC} +#../../../../buildscript ${FLAGS2} ${SRC} +# ../../../../buildscript ${FLAGS} ${SRC} + ../../../../buildscript ${FLAGS2} -o ${MAINCLASS}1NP ${SRC} + ../../../../buildscript ${FLAGS} -o ${MAINCLASS}1 ${SRC} + cp ${MAINCLASS}1NP.bin ${MAINCLASS}2NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}2.bin + cp ${MAINCLASS}1NP.bin ${MAINCLASS}3NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}3.bin + cp ${MAINCLASS}1NP.bin ${MAINCLASS}4NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}4.bin clean: rm -rf tmpbuilddirectory diff --git a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply1.java b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply1.java deleted file mode 100644 index dc3b4bca..00000000 --- a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply1.java +++ /dev/null @@ -1,174 +0,0 @@ -public class MatrixMultiply extends Thread{ - MMul mmul; - public int x0, y0, x1, y1; - - public MatrixMultiply(MMul mmul, int x0, int y0, int x1, int y1) { - this.mmul = mmul; - this.x0 = x0; - this.y0 = y0; - this.x1 = x1; - this.y1 = y1; - } - - public void run() { - double localresults[][]; - - atomic { - //compute the results - localresults=new double[1+x1-x0][1+y1-y0]; - - //Use b transpose for cache performance - for(int i = x0; i<= x1; i++){ - double a[]=mmul.a[i]; - int M=mmul.M; - for (int j = y0; j <= y1; j++) { - double innerProduct=0; - double b[] = mmul.btranspose[j]; - for(int k = 0; k < M; k++) { - innerProduct += a[k] *b[k]; - } - localresults[i-x0][j-y0]=innerProduct; - } - } - } - - atomic { - //write the results - for(int i=x0;i<=x1;i++) { - double c[]=mmul.c[i]; - for(int j=y0;j<=y1;j++) { - c[j]=localresults[i-x0][j-y0]; - } - } - } - } - - public static void main(String[] args) { - int NUM_THREADS = 1; - int[] mid = new int[NUM_THREADS]; - mid[0] = (128<<24)|(195<<16)|(175<<8)|79; - int p, q, r; - MatrixMultiply[] mm; - MatrixMultiply tmp; - MMul matrix; - - atomic { - matrix = global new MMul(600, 600, 600); - matrix.setValues(); - matrix.transpose(); - } - - atomic{ - mm = global new MatrixMultiply[NUM_THREADS]; - } - - atomic { - mm[0] = global new MatrixMultiply(matrix,0,0,599,599); - } - - atomic { - p = matrix.L; - q = matrix.M; - r = matrix.N; - } - - // print out the matrices to be multiplied - System.printString("\n"); - System.printString("MatrixMultiply: L="); - System.printInt(p); - System.printString("\t"); - System.printString("M="); - System.printInt(q); - System.printString("\t"); - System.printString("N="); - System.printInt(r); - System.printString("\n"); - - // start a thread to compute each c[l,n] - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.start(mid[i]); - } - - // wait for them to finish - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.join(); - } - - // print out the result of the matrix multiply - System.printString("Starting\n"); - System.printString("Matrix Product c =\n"); - double val; - atomic { - for (int i = 0; i < p; i++) { - double c[]=matrix.c[i]; - for (int j = 0; j < r; j++) { - val = c[j]; - } - } - } - System.printString("Finished\n"); - } -} - -public class MMul{ - - public int L, M, N; - public double[][] a; - public double[][] b; - public double[][] c; - public double[][] btranspose; - - public MMul(int L, int M, int N) { - this.L = L; - this.M = M; - this.N = N; - a = global new double[L][M]; - b = global new double[M][N]; - c = global new double[L][N]; - btranspose = global new double[N][M]; - } - - public void setValues() { - for(int i = 0; i < L; i++) { - double ai[] = a[i]; - for(int j = 0; j < M; j++) { - ai[j] = j+1; - } - } - - for(int i = 0; i < M; i++) { - double bi[] = b[i]; - for(int j = 0; j < N; j++) { - bi[j] = j+1; - } - } - - for(int i = 0; i < L; i++) { - double ci[] = c[i]; - for(int j = 0; j < N; j++) { - ci[j] = 0; - } - } - for(int i = 0; i < N; i++) { - double btransposei[] = btranspose[i]; - for(int j = 0; j < M; j++) { - btransposei[j] = 0; - } - } - } - - public void transpose() { - for(int row = 0; row < M; row++) { - double brow[] = b[row]; - for(int col = 0; col < N; col++) { - btranspose[col][row] = brow[col]; - } - } - } -} diff --git a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply2.java b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply2.java deleted file mode 100644 index 1b17dd8d..00000000 --- a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply2.java +++ /dev/null @@ -1,176 +0,0 @@ -public class MatrixMultiply extends Thread{ - MMul mmul; - public int x0, y0, x1, y1; - - public MatrixMultiply(MMul mmul, int x0, int y0, int x1, int y1) { - this.mmul = mmul; - this.x0 = x0; - this.y0 = y0; - this.x1 = x1; - this.y1 = y1; - } - - public void run() { - double localresults[][]; - - atomic { - //compute the results - localresults=new double[1+x1-x0][1+y1-y0]; - - //Use b transpose for cache performance - for(int i = x0; i<= x1; i++){ - double a[]=mmul.a[i]; - int M=mmul.M; - for (int j = y0; j <= y1; j++) { - double innerProduct=0; - double b[] = mmul.btranspose[j]; - for(int k = 0; k < M; k++) { - innerProduct += a[k] *b[k]; - } - localresults[i-x0][j-y0]=innerProduct; - } - } - } - - atomic { - //write the results - for(int i=x0;i<=x1;i++) { - double c[]=mmul.c[i]; - for(int j=y0;j<=y1;j++) { - c[j]=localresults[i-x0][j-y0]; - } - } - } - } - - public static void main(String[] args) { - int NUM_THREADS = 2; - int[] mid = new int[NUM_THREADS]; - mid[0] = (128<<24)|(195<<16)|(175<<8)|79; - mid[1] = (128<<24)|(195<<16)|(175<<8)|78; - int p, q, r; - MatrixMultiply[] mm; - MatrixMultiply tmp; - MMul matrix; - - atomic { - matrix = global new MMul(600, 600, 600); - matrix.setValues(); - matrix.transpose(); - } - - atomic{ - mm = global new MatrixMultiply[NUM_THREADS]; - } - - atomic { - mm[0] = global new MatrixMultiply(matrix,0,0,599,300); - mm[1] = global new MatrixMultiply(matrix,0,301,599,599); - } - - atomic { - p = matrix.L; - q = matrix.M; - r = matrix.N; - } - - // print out the matrices to be multiplied - System.printString("\n"); - System.printString("MatrixMultiply: L="); - System.printInt(p); - System.printString("\t"); - System.printString("M="); - System.printInt(q); - System.printString("\t"); - System.printString("N="); - System.printInt(r); - System.printString("\n"); - - // start a thread to compute each c[l,n] - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.start(mid[i]); - } - - // wait for them to finish - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.join(); - } - - // print out the result of the matrix multiply - System.printString("Starting\n"); - System.printString("Matrix Product c =\n"); - double val; - atomic { - for (int i = 0; i < p; i++) { - double c[]=matrix.c[i]; - for (int j = 0; j < r; j++) { - val = c[j]; - } - } - } - System.printString("Finished\n"); - } -} - -public class MMul{ - - public int L, M, N; - public double[][] a; - public double[][] b; - public double[][] c; - public double[][] btranspose; - - public MMul(int L, int M, int N) { - this.L = L; - this.M = M; - this.N = N; - a = global new double[L][M]; - b = global new double[M][N]; - c = global new double[L][N]; - btranspose = global new double[N][M]; - } - - public void setValues() { - for(int i = 0; i < L; i++) { - double ai[] = a[i]; - for(int j = 0; j < M; j++) { - ai[j] = j+1; - } - } - - for(int i = 0; i < M; i++) { - double bi[] = b[i]; - for(int j = 0; j < N; j++) { - bi[j] = j+1; - } - } - - for(int i = 0; i < L; i++) { - double ci[] = c[i]; - for(int j = 0; j < N; j++) { - ci[j] = 0; - } - } - for(int i = 0; i < N; i++) { - double btransposei[] = btranspose[i]; - for(int j = 0; j < M; j++) { - btransposei[j] = 0; - } - } - } - - public void transpose() { - for(int row = 0; row < M; row++) { - double brow[] = b[row]; - for(int col = 0; col < N; col++) { - btranspose[col][row] = brow[col]; - } - } - } -} diff --git a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply4.java b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply4.java deleted file mode 100644 index 029ead4c..00000000 --- a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/MatrixMultiply4.java +++ /dev/null @@ -1,182 +0,0 @@ -public class MatrixMultiply extends Thread{ - MMul mmul; - public int x0, y0, x1, y1; - - public MatrixMultiply(MMul mmul, int x0, int y0, int x1, int y1) { - this.mmul = mmul; - this.x0 = x0; - this.y0 = y0; - this.x1 = x1; - this.y1 = y1; - } - - public void run() { - double localresults[][]; - - atomic { - //compute the results - localresults=new double[1+x1-x0][1+y1-y0]; - - //Use b transpose for cache performance - for(int i = x0; i<= x1; i++){ - double a[]=mmul.a[i]; - int M=mmul.M; - for (int j = y0; j <= y1; j++) { - double innerProduct=0; - double b[] = mmul.btranspose[j]; - for(int k = 0; k < M; k++) { - innerProduct += a[k] *b[k]; - } - localresults[i-x0][j-y0]=innerProduct; - } - } - } - - atomic { - //write the results - for(int i=x0;i<=x1;i++) { - double c[]=mmul.c[i]; - for(int j=y0;j<=y1;j++) { - c[j]=localresults[i-x0][j-y0]; - } - } - } - } - - public static void main(String[] args) { - int NUM_THREADS = 4; - int[] mid = new int[NUM_THREADS]; - mid[0] = (128<<24)|(195<<16)|(175<<8)|80; - mid[1] = (128<<24)|(195<<16)|(175<<8)|73; - mid[2] = (128<<24)|(195<<16)|(175<<8)|78; - mid[3] = (128<<24)|(195<<16)|(175<<8)|79; - //int mid1 = (128<<24)|(195<<16)|(175<<8)|69; - //int mid2 = (128<<24)|(195<<16)|(175<<8)|73; - int p, q, r; - MatrixMultiply[] mm; - MatrixMultiply tmp; - MMul matrix; - - atomic { - matrix = global new MMul(600, 600, 600); - matrix.setValues(); - matrix.transpose(); - } - - atomic{ - mm = global new MatrixMultiply[NUM_THREADS]; - } - - atomic { - mm[0] = global new MatrixMultiply(matrix,0,0,300,300); - mm[1] = global new MatrixMultiply(matrix,0,301,300,599); - mm[2] = global new MatrixMultiply(matrix,301,0,599,300); - mm[3] = global new MatrixMultiply(matrix,301,301,599,599); - } - - atomic { - p = matrix.L; - q = matrix.M; - r = matrix.N; - } - - // print out the matrices to be multiplied - System.printString("\n"); - System.printString("MatrixMultiply: L="); - System.printInt(p); - System.printString("\t"); - System.printString("M="); - System.printInt(q); - System.printString("\t"); - System.printString("N="); - System.printInt(r); - System.printString("\n"); - - // start a thread to compute each c[l,n] - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.start(mid[i]); - } - - // wait for them to finish - for (int i = 0; i < NUM_THREADS; i++) { - atomic { - tmp = mm[i]; - } - tmp.join(); - } - - // print out the result of the matrix multiply - System.printString("Starting\n"); - System.printString("Matrix Product c =\n"); - double val; - atomic { - for (int i = 0; i < p; i++) { - double c[]=matrix.c[i]; - for (int j = 0; j < r; j++) { - val = c[j]; - } - } - } - System.printString("Finished\n"); - } -} - -public class MMul{ - - public int L, M, N; - public double[][] a; - public double[][] b; - public double[][] c; - public double[][] btranspose; - - public MMul(int L, int M, int N) { - this.L = L; - this.M = M; - this.N = N; - a = global new double[L][M]; - b = global new double[M][N]; - c = global new double[L][N]; - btranspose = global new double[N][M]; - } - - public void setValues() { - for(int i = 0; i < L; i++) { - double ai[] = a[i]; - for(int j = 0; j < M; j++) { - ai[j] = j+1; - } - } - - for(int i = 0; i < M; i++) { - double bi[] = b[i]; - for(int j = 0; j < N; j++) { - bi[j] = j+1; - } - } - - for(int i = 0; i < L; i++) { - double ci[] = c[i]; - for(int j = 0; j < N; j++) { - ci[j] = 0; - } - } - for(int i = 0; i < N; i++) { - double btransposei[] = btranspose[i]; - for(int j = 0; j < M; j++) { - btransposei[j] = 0; - } - } - } - - public void transpose() { - for(int row = 0; row < M; row++) { - double brow[] = b[row]; - for(int col = 0; col < N; col++) { - btranspose[col][row] = brow[col]; - } - } - } -} diff --git a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile index dcbce88e..b73534f0 100644 --- a/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile +++ b/Robust/src/Benchmarks/Prefetch/MatrixMultiply/makefile @@ -1,13 +1,19 @@ MAINCLASS=MatrixMultiply SRC1=${MAINCLASS}N.java SRC2=${MAINCLASS}Nrun.java -FLAGS=-dsm -prefetch -optimize -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -trueprob 0.7 +FLAGS=-dsm -prefetch -optimize -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} -trueprob 0.90 FLAGS2=-dsm -optimize -debug -excprefetch MatrixMultiply.main -excprefetch MMul.setValues -excprefetch MMul.transpose -mainclass ${MAINCLASS} default: - ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NP ${SRC1} - ../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1} - ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NrunNP ${SRC2} - ../../../buildscript ${FLAGS} -o ${MAINCLASS}NrunP ${SRC2} + ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NNP ${SRC1} + ../../../buildscript ${FLAGS} -o ${MAINCLASS}N ${SRC1} + ../../../buildscript ${FLAGS2} -o ${MAINCLASS}1NP ${SRC2} + ../../../buildscript ${FLAGS} -o ${MAINCLASS}1 ${SRC2} + cp ${MAINCLASS}1NP.bin ${MAINCLASS}2NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}2.bin + cp ${MAINCLASS}1NP.bin ${MAINCLASS}3NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}3.bin + cp ${MAINCLASS}1NP.bin ${MAINCLASS}4NP.bin + cp ${MAINCLASS}1.bin ${MAINCLASS}4.bin clean: rm *.bin diff --git a/Robust/src/Benchmarks/Prefetch/Moldyn/dsm/DebugBarrier.java b/Robust/src/Benchmarks/Prefetch/Moldyn/dsm/DebugBarrier.java index eaddc75c..8dca6d7a 100644 --- a/Robust/src/Benchmarks/Prefetch/Moldyn/dsm/DebugBarrier.java +++ b/Robust/src/Benchmarks/Prefetch/Moldyn/dsm/DebugBarrier.java @@ -4,7 +4,7 @@ public class Barrier { boolean cleared; public Barrier(int n) { - System.printString("Initializing barrier for "+n+" threads.\n"); + //System.printString("Initializing barrier for "+n+" threads.\n"); numthreads=n; cleared = false; entercount = 0; @@ -24,7 +24,7 @@ public class Barrier { do { atomic { - System.printString("Entering barrier with ec="+b.entercount+" cl="+b.cleared+"\n"); + //System.printString("Entering barrier with ec="+b.entercount+" cl="+b.cleared+"\n"); if (!b.cleared) { b.entercount++; tmp = b.entercount; @@ -32,14 +32,14 @@ public class Barrier { if(b.numthreads > 1) b.cleared=true; b.entercount--; - System.printString("Exiting Barrier #1\n"); + //System.printString("Exiting Barrier #1\n"); return; } retry=false; } } } while(retry); - System.printString("Waiting for last thread to enter\n"); + //System.printString("Waiting for last thread to enter\n"); while(true) { atomic { if (b.cleared) { @@ -47,7 +47,7 @@ public class Barrier { int count = b.entercount; if (count==0) b.cleared=false; - System.printString("Exiting Barrier #2\n"); + //System.printString("Exiting Barrier #2\n"); return; } } diff --git a/Robust/src/Benchmarks/Prefetch/Moldyn/java/Barrier.java b/Robust/src/Benchmarks/Prefetch/Moldyn/java/Barrier.java new file mode 100644 index 00000000..590b3a66 --- /dev/null +++ b/Robust/src/Benchmarks/Prefetch/Moldyn/java/Barrier.java @@ -0,0 +1,48 @@ +public class Barrier { + int numthreads; + int entercount; + boolean cleared; + + public Barrier(int n) { + numthreads=n; + cleared = false; + } + + public Barrier() { + + } + + public void reset() { + cleared = false; + entercount = 0; + } + + public static void enterBarrier(Barrier b) { + int tmp; + boolean retry=true; + + do { + if (!b.cleared) { + b.entercount++; + tmp = b.entercount; + if (tmp==b.numthreads) { + if(b.numthreads > 1) + b.cleared=true; + b.entercount--; + return; + } + retry=false; + } + } while(retry); + + while(true) { + if (b.cleared) { + b.entercount--; + int count = b.entercount; + if (count==0) + b.cleared=false; + return; + } + } + } +} diff --git a/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFInstrumentor.java b/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFInstrumentor.java index 772949fa..3f9f580c 100644 --- a/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFInstrumentor.java +++ b/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFInstrumentor.java @@ -17,9 +17,6 @@ * All rights reserved. * * * **************************************************************************/ - -import java.util.*; - public class JGFInstrumentor{ protected HashMap timers; @@ -33,8 +30,8 @@ public class JGFInstrumentor{ public static void addTimer (String name, HashMap timers){ if (timers.containsKey(name)) { - System.out.println("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists\n"); } else { timers.put(name, new JGFTimer(name)); @@ -44,8 +41,8 @@ public class JGFInstrumentor{ public static void addTimer (String name, String opname, HashMap timers){ if (timers.containsKey(name)) { - System.out.println("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists\n"); } else { timers.put(name, new JGFTimer(name,opname)); @@ -56,8 +53,8 @@ public class JGFInstrumentor{ public static void addTimer (String name, String opname, int size, HashMap timers){ if (timers.containsKey(name)) { - System.out.println("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); + System.printString("JGFInstrumentor.addTimer: warning - timer " + name + + " already exists\n"); } else { timers.put(name, new JGFTimer(name,opname,size)); @@ -70,8 +67,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).start(); } else { - System.out.println("JGFInstrumentor.startTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.startTimer: failed - timer " + name + + " does not exist\n"); } } @@ -81,8 +78,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).stop(); } else { - System.out.println("JGFInstrumentor.stopTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.stopTimer: failed - timer " + name + + " does not exist\n"); } } @@ -91,8 +88,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).addops(count); } else { - System.out.println("JGFInstrumentor.addOpsToTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.addOpsToTimer: failed - timer " + name + + " does not exist\n"); } } @@ -101,8 +98,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).addtime(added_time); } else { - System.out.println("JGFInstrumentor.addTimeToTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.addTimeToTimer: failed - timer " + name + + " does not exist\n"); } @@ -115,8 +112,8 @@ public class JGFInstrumentor{ time = ((JGFTimer) timers.get(name)).time; } else { - System.out.println("JGFInstrumentor.readTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.readTimer: failed - timer " + name + + " does not exist\n"); time = 0.0; } return time; @@ -127,8 +124,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).reset(); } else { - System.out.println("JGFInstrumentor.resetTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.resetTimer: failed - timer " + name + + " does not exist\n"); } } @@ -137,8 +134,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).print(); } else { - System.out.println("JGFInstrumentor.printTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.printTimer: failed - timer " + name + + " does not exist\n"); } } @@ -147,8 +144,8 @@ public class JGFInstrumentor{ ((JGFTimer) timers.get(name)).printperf(); } else { - System.out.println("JGFInstrumentor.printTimer: failed - timer " + name + - " does not exist"); + System.printString("JGFInstrumentor.printTimer: failed - timer " + name + + " does not exist\n"); } } @@ -167,46 +164,36 @@ public class JGFInstrumentor{ header = ""; base = "Java Grande Forum Thread Benchmark Suite - Version 1.0 - Section "; - switch (section) { - case 1: - header = base + "1"; - break; - case 2: - switch (size) { - case 0: - header = base + "2 - Size A"; - break; - case 1: - header = base + "2 - Size B"; - break; - case 2: - header = base + "2 - Size C"; - break; - } - break; - case 3: - switch (size) { - case 0: - header = base + "3 - Size A"; - break; - case 1: - header = base + "3 - Size B"; - break; - } - break; - } - - System.out.println(header); + if (section == 1) + { + header = base + "1"; + } + else if (section == 2) + { + if (size == 0) + header = base + "2 - Size A"; + else if (size == 1) + header = base + "2 - Size B"; + else if (size == 2) + header = base + "2 - Size C"; + } + else if (section == 3) + { + if (size == 0) + header = base + "3 - Size A"; + else if (size == 1) + header = base + "3 - Size B"; + } + + System.printString(header + "\n"); if (nthreads == 1) { - System.out.println("Executing on " + nthreads + " thread"); + System.printString("Executing on " + nthreads + " thread\n"); } else { - System.out.println("Executing on " + nthreads + " threads"); + System.printString("Executing on " + nthreads + " threads\n"); } - System.out.println(""); - + System.printString(" \n"); } - } diff --git a/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFMolDynBench.java b/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFMolDynBench.java index fef7a041..0f7b8a77 100644 --- a/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFMolDynBench.java +++ b/Robust/src/Benchmarks/Prefetch/Moldyn/java/JGFMolDynBench.java @@ -17,9 +17,6 @@ * All rights reserved. * * * **************************************************************************/ - -import java.io.*; - public class JGFMolDynBench { public int ITERS; public double LENGTH; @@ -44,9 +41,8 @@ public class JGFMolDynBench { public int nthreads; public JGFInstrumentor instr; - public JGFMolDynBench(int nthreads, JGFInstrumentor instr) { + public JGFMolDynBench(int nthreads) { this.nthreads=nthreads; - this.instr = instr; } public void JGFsetsize(int size){ @@ -68,50 +64,66 @@ public class JGFMolDynBench { kb = 1.38066e-23; TSIM = 50; deltat = 5e-16; - - //initialise(); } - public void JGFapplication() { + public static void JGFapplication(JGFMolDynBench mold) { // Create new arrays - epot = new double [nthreads]; - vir = new double [nthreads]; - ek = new double [nthreads]; + mold.epot = new double [mold.nthreads]; + mold.vir = new double [mold.nthreads]; + mold.ek = new double [mold.nthreads]; + mold.interacts = new int [mold.nthreads]; - interacts = new int [nthreads]; + int partsize, numthreads; + partsize = mold.PARTSIZE; + numthreads = mold.nthreads; - double sh_force [][] = new double[3][PARTSIZE]; - double sh_force2 [][][] = new double[3][nthreads][PARTSIZE]; + double sh_force [][]; + double sh_force2 [][][]; + sh_force = new double[3][partsize]; + sh_force2 = new double[3][numthreads][partsize]; // spawn threads - Thread thobjects[] = new Thread [nthreads]; - TournamentBarrier br= new TournamentBarrier(nthreads); - //Barrier br = new Barrier(nthreads); - - for(int i=1;i 1.0e-10 ){ - System.out.println("Validation failed"); - System.out.println("Kinetic Energy = " + ek[0] + " " + dev + " " + size); + //System.printString("Validation failed\n"); + //System.printString("Kinetic Energy = " + (long)ek[0] + " " + (long)dev + " " + size + "\n"); } } } @@ -119,7 +131,7 @@ public class JGFMolDynBench { class mdRunner extends Thread { double count; - int id,i,j,k,lg,mdsize,move,mm; + int id,i,j,k,lg,mdsize,mm; double l,rcoff,rcoffs,side,sideh,hsq,hsq2,vel,velt; double a,r,sum,tscale,sc,ekin,ts,sp; double den; @@ -137,26 +149,21 @@ class mdRunner extends Thread { int irep; int istop; int iprint; - int movemx; - TournamentBarrier br; - //Barrier br; + Barrier br; random randnum; - JGFInstrumentor instr; JGFMolDynBench mymd; int nthreads; particle[] one; - public mdRunner(int id, int mm, double [][] sh_force, double [][][] sh_force2,TournamentBarrier br, - //public mdRunner(int id, int mm, double [][] sh_force, double [][][] sh_force2,Barrier br, - JGFInstrumentor instr, int nthreads, JGFMolDynBench mymd) { + public mdRunner(int id, int mm, double [][] sh_force, double [][][] sh_force2,Barrier br, + int nthreads, JGFMolDynBench mymd) { this.id=id; this.mm=mm; this.sh_force=sh_force; this.sh_force2=sh_force2; this.br=br; - this.instr = instr; this.nthreads = nthreads; this.mymd = mymd; count = 0.0; @@ -166,297 +173,315 @@ class mdRunner extends Thread { irep = 10; istop = 19; iprint = 10; - movemx = 50; } public void run() { + //System.printString("Start run method\n"); + /* Parameter determination */ - mdsize = mymd.PARTSIZE; - one = new particle [mdsize]; - l = mymd.LENGTH; - - side = Math.pow((mdsize/den),0.3333333); - rcoff = mm/4.0; - - a = side/mm; - sideh = side*0.5; - hsq = h*h; - hsq2 = hsq*0.5; - npartm = mdsize - 1; - rcoffs = rcoff * rcoff; - tscale = 16.0 / (1.0 * mdsize - 1.0); - vaver = 1.13 * Math.sqrt(tref / 24.0); - vaverh = vaver * h; - - /* Particle Generation */ - - xvelocity = 0.0; - yvelocity = 0.0; - zvelocity = 0.0; - - ijk = 0; - for (lg=0; lg<=1; lg++) { - for (i=0; i vaverh) { count = count + 1.0; } - vel = vel + velt; - } + for (i=0;i vaverh) { count = count + 1.0; } + vel = vel + velt; + } - vel = vel / h; + vel = vel / h; - /* temperature scale if required */ + /* temperature scale if required */ - if((move < istop) && (((move+1) % irep) == 0)) { - sc = Math.sqrt(tref / (tscale*ekin)); - for (i=0;i> average.txt diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/JGFCryptBenchSizeA.java b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/JGFCryptBenchSizeA.java deleted file mode 100644 index 74bd2834..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/JGFCryptBenchSizeA.java +++ /dev/null @@ -1,53 +0,0 @@ -/************************************************************************** -* * -* Java Grande Forum Benchmark Suite - Thread Version 1.0 * -* * -* produced by * -* * -* Java Grande Benchmarking Project * -* * -* at * -* * -* Edinburgh Parallel Computing Centre * -* * -* email: epcc-javagrande@epcc.ed.ac.uk * -* * -* * -* This version copyright (c) The University of Edinburgh, 2001. * -* All rights reserved. * -* * -**************************************************************************/ -/************************************************************************** -* Ported for DSTM Benchmark * -**************************************************************************/ - - -import crypt.*; -import jgfutil.*; - -public class JGFCryptBenchSizeA{ - - global JGFIntrumentor instr; - - public static void main(String argv[]){ - - int nthreads; - - if(argv.length != 0 ) { - nthreads = Integer.parseInt(argv[0]); - } else { - System.printString("The no of threads has not been specified, defaulting to 1"); - System.printString(" "); - nthreads = 1; - } - - instr = new JGFInstrumentor(); - instr.printHeader(2,0,nthreads); - - JGFCryptBench cb = new JGFCryptBench(nthreads, instr); - cb.JGFrun(0); - - } -} - - diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/IDEATest.java b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/IDEATest.java deleted file mode 100644 index 940c8598..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/IDEATest.java +++ /dev/null @@ -1,562 +0,0 @@ -/************************************************************************** -* * -* Java Grande Forum Benchmark Suite - Thread Version 1.0 * -* * -* produced by * -* * -* Java Grande Benchmarking Project * -* * -* at * -* * -* Edinburgh Parallel Computing Centre * -* * -* email: epcc-javagrande@epcc.ed.ac.uk * -* * -* Original version of this code by * -* Gabriel Zachmann (zach@igd.fhg.de) * -* * -* This version copyright (c) The University of Edinburgh, 2001. * -* All rights reserved. * -* * -**************************************************************************/ -/************************************************************************** -* Ported for DSTM Benchmark * -**************************************************************************/ - - -/** -* Class IDEATest -* -* This test performs IDEA encryption then decryption. IDEA stands -* for International Data Encryption Algorithm. The test is based -* on code presented in Applied Cryptography by Bruce Schnier, -* which was based on code developed by Xuejia Lai and James L. -* Massey. - -**/ - -package crypt; - -import java.util.*; -import jgfutil.*; - -class IDEATest -{ - -// Declare class data. Byte buffer plain1 holds the original -// data for encryption, crypt1 holds the encrypted data, and -// plain2 holds the decrypted data, which should match plain1 -// byte for byte. - -int array_rows; - -byte [] plain1; // Buffer for plaintext data. -byte [] crypt1; // Buffer for encrypted data. -byte [] plain2; // Buffer for decrypted data. - -short [] userkey; // Key for encryption/decryption. -int [] Z; // Encryption subkey (userkey derived). -int [] DK; // Decryption subkey (userkey derived). - - - -void Do() -{ - - IDEARunner th[] = new IDEARunner [JGFCryptBench.nthreads]; - - // Start the stopwatch. - JGFInstrumentor.startTimer("Section2:Crypt:Kernel"); - - // Encrypt plain1. - for(int i=1;i>>9) | (Z[i-6]<<7)) // Shift and combine. - & 0xFFFF; // Just 16 bits. - continue; // Next iteration. - } - - if (j == 6) // Wrap to beginning for second chunk. - { - Z[i] = ((Z[i -7]>>>9) | (Z[i-14]<<7)) - & 0xFFFF; - continue; - } - - // j == 7 so wrap to beginning for both chunks. - - Z[i] = ((Z[i -15]>>>9) | (Z[i-14]<<7)) - & 0xFFFF; - } -} - -/* -* calcDecryptKey -* -* Builds the 52 16-bit encryption subkeys DK[] from the encryption- -* subkeys Z[]. DK[] is a 32-bit int array holding 16-bit values as -* unsigned. -*/ - -private void calcDecryptKey() -{ - int j, k; // Index counters. - int t1, t2, t3; // Temps to hold decrypt subkeys. - - t1 = inv(Z[0]); // Multiplicative inverse (mod x10001). - t2 = - Z[1] & 0xffff; // Additive inverse, 2nd encrypt subkey. - t3 = - Z[2] & 0xffff; // Additive inverse, 3rd encrypt subkey. - - DK[51] = inv(Z[3]); // Multiplicative inverse (mod x10001). - DK[50] = t3; - DK[49] = t2; - DK[48] = t1; - - j = 47; // Indices into temp and encrypt arrays. - k = 4; - for (int i = 0; i < 7; i++) - { - t1 = Z[k++]; - DK[j--] = Z[k++]; - DK[j--] = t1; - t1 = inv(Z[k++]); - t2 = -Z[k++] & 0xffff; - t3 = -Z[k++] & 0xffff; - DK[j--] = inv(Z[k++]); - DK[j--] = t2; - DK[j--] = t3; - DK[j--] = t1; - } - - t1 = Z[k++]; - DK[j--] = Z[k++]; - DK[j--] = t1; - t1 = inv(Z[k++]); - t2 = -Z[k++] & 0xffff; - t3 = -Z[k++] & 0xffff; - DK[j--] = inv(Z[k++]); - DK[j--] = t3; - DK[j--] = t2; - DK[j--] = t1; -} - - - - - -/* -* mul -* -* Performs multiplication, modulo (2**16)+1. This code is structured -* on the assumption that untaken branches are cheaper than taken -* branches, and that the compiler doesn't schedule branches. -* Java: Must work with 32-bit int and one 64-bit long to keep -* 16-bit values and their products "unsigned." The routine assumes -* that both a and b could fit in 16 bits even though they come in -* as 32-bit ints. Lots of "& 0xFFFF" masks here to keep things 16-bit. -* Also, because the routine stores mod (2**16)+1 results in a 2**16 -* space, the result is truncated to zero whenever the result would -* zero, be 2**16. And if one of the multiplicands is 0, the result -* is not zero, but (2**16) + 1 minus the other multiplicand (sort -* of an additive inverse mod 0x10001). - -* NOTE: The java conversion of this routine works correctly, but -* is half the speed of using Java's modulus division function (%) -* on the multiplication with a 16-bit masking of the result--running -* in the Symantec Caje IDE. So it's not called for now; the test -* uses Java % instead. -*/ - -private int mul(int a, int b) -{ - int ret; - long p; // Large enough to catch 16-bit multiply - // without hitting sign bit. - if (a != 0) - { - if(b != 0) - { - p = (long) a * b; - b = (int) p & 0xFFFF; // Lower 16 bits. - a = (int) p >>> 16; // Upper 16 bits. - if (b < a) - return (b - a + 1) & 0xFFFF; - else - return (b - a) & 0xFFFF; - } - else - return ((1 - a) & 0xFFFF); // If b = 0, then same as - // 0x10001 - a. - } - else // If a = 0, then return - return((1 - b) & 0xFFFF); // same as 0x10001 - b. -} - -/* -* inv -* -* Compute multiplicative inverse of x, modulo (2**16)+1 using -* extended Euclid's GCD (greatest common divisor) algorithm. -* It is unrolled twice to avoid swapping the meaning of -* the registers. And some subtracts are changed to adds. -* Java: Though it uses signed 32-bit ints, the interpretation -* of the bits within is strictly unsigned 16-bit. -*/ - -private int inv(int x) -{ - int t0, t1; - int q, y; - - if (x <= 1) // Assumes positive x. - return(x); // 0 and 1 are self-inverse. - - t1 = 0x10001 / x; // (2**16+1)/x; x is >= 2, so fits 16 bits. - y = 0x10001 % x; - if (y == 1) - return((1 - t1) & 0xFFFF); - - t0 = 1; - do { - q = x / y; - x = x % y; - t0 += q * t1; - if (x == 1) return(t0); - q = y / x; - y = y % x; - t1 += q * t0; - } while (y != 1); - - return((1 - t1) & 0xFFFF); -} - -/* -* freeTestData -* -* Nulls arrays and forces garbage collection to free up memory. -*/ - -void freeTestData() -{ - plain1 = null; - crypt1 = null; - plain2 = null; - userkey = null; - Z = null; - DK = null; - - //System.gc(); // Force garbage collection. -} - - -} - - - -class IDEARunner extends Thread { - - int id,key[]; - byte text1[],text2[]; - - public IDEARunner(int id, byte [] text1, byte [] text2, int [] key) { - this.id = id; - this.text1=text1; - this.text2=text2; - this.key=key; - } -/* -* run() -* -* IDEA encryption/decryption algorithm. It processes plaintext in -* 64-bit blocks, one at a time, breaking the block into four 16-bit -* unsigned subblocks. It goes through eight rounds of processing -* using 6 new subkeys each time, plus four for last step. The source -* text is in array text1, the destination text goes into array text2 -* The routine represents 16-bit subblocks and subkeys as type int so -* that they can be treated more easily as unsigned. Multiplication -* modulo 0x10001 interprets a zero sub-block as 0x10000; it must to -* fit in 16 bits. -*/ - - public void run() { - int ilow, iupper, slice, tslice, ttslice; - - tslice = text1.length / 8; - ttslice = (tslice + JGFCryptBench.nthreads-1) / JGFCryptBench.nthreads; - slice = ttslice*8; - - ilow = id*slice; - iupper = (id+1)*slice; - if(iupper > text1.length) iupper = text1.length; - -int i1 = ilow; // Index into first text array. -int i2 = ilow; // Index into second text array. -int ik; // Index into key array. -int x1, x2, x3, x4, t1, t2; // Four "16-bit" blocks, two temps. -int r; // Eight rounds of processing. - - for (int i =ilow ; i >> 8); - text2[i2++] = (byte) x3; // x3 and x2 are switched - text2[i2++] = (byte) (x3 >>> 8); // only in name. - text2[i2++] = (byte) x2; - text2[i2++] = (byte) (x2 >>> 8); - text2[i2++] = (byte) x4; - text2[i2++] = (byte) (x4 >>> 8); - -} // End for loop. - - } // End routine. - -} // End of class - - - - - - - - - diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/JGFCryptBench.java b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/JGFCryptBench.java deleted file mode 100644 index d80e0631..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/crypt/JGFCryptBench.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************** -* * -* Java Grande Forum Benchmark Suite - Thread Version 1.0 * -* * -* produced by * -* * -* Java Grande Benchmarking Project * -* * -* at * -* * -* Edinburgh Parallel Computing Centre * -* * -* email: epcc-javagrande@epcc.ed.ac.uk * -* * -* * -* This version copyright (c) The University of Edinburgh, 2001. * -* All rights reserved. * -* * -**************************************************************************/ -/************************************************************************** -* Ported for DSTM Benchmark * -**************************************************************************/ - - -package crypt; -import jgfutil.*; - - -public class JGFCryptBench extends IDEATest { - - private int size; - private int datasizes[]; - public int nthreads; - global JGFInstrumentor instr; - - public JGFCryptBench(int nthreads, JGFInstrumentor instr) - { - this.nthreads = nthreads; - this.instr = instr; - datasizes = new int[3]; - datasizes[0] = 3000000; - datasizes[1] = 20000000; - datasizes[2] = 50000000; - } - - - public void JGFsetsize(int size){ - this.size = size; - } - - public void JGFinitialise(){ - array_rows = datasizes[size]; - buildTestData(); - } - - public void JGFkernel(){ - Do(); - } - - public void JGFvalidate(){ - boolean error; - - error = false; - for (int i = 0; i < array_rows; i++){ - error = (plain1 [i] != plain2 [i]); - if (error){ - System.printString("Validation failed"); - System.printString("Original Byte " + i + " = " + plain1[i]); - System.printString("Encrypted Byte " + i + " = " + crypt1[i]); - System.printString("Decrypted Byte " + i + " = " + plain2[i]); - //break; - } - } - } - - - public void JGFtidyup(){ - freeTestData(); - } - - - - public void JGFrun(int size){ - - - instr.addTimer("Section2:Crypt:Kernel", "Kbyte",size); - - JGFsetsize(size); - JGFinitialise(); - JGFkernel(); - JGFvalidate(); - JGFtidyup(); - - - instr.addOpsToTimer("Section2:Crypt:Kernel", (2*array_rows)/1000.); - instr.printTimer("Section2:Crypt:Kernel"); - } -} diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFInstrumentor.java b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFInstrumentor.java deleted file mode 100644 index e9c0906f..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFInstrumentor.java +++ /dev/null @@ -1,211 +0,0 @@ -/************************************************************************** -* * -* Java Grande Forum Benchmark Suite - Thread Version 1.0 * -* * -* produced by * -* * -* Java Grande Benchmarking Project * -* * -* at * -* * -* Edinburgh Parallel Computing Centre * -* * -* email: epcc-javagrande@epcc.ed.ac.uk * -* * -* * -* This version copyright (c) The University of Edinburgh, 1999. * -* All rights reserved. * -* * -**************************************************************************/ -/************************************************************************** -* Ported for DSTM Benchmark * -**************************************************************************/ - - -package jgfutil; - -import java.util.*; - -public class JGFInstrumentor{ - - private HashMap timers; - private HashMap data; - - public JGFIntrumentor() - { - timers = new HashMap(); - data = new HashMap(); - } - - public void addTimer (String name){ - - if (timers.containsKey(name)) { - System.printString("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); - } - else { - timers.put(name, new JGFTimer(name)); - } - } - - public void addTimer (String name, String opname){ - - if (timers.containsKey(name)) { - System.printString("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); - } - else { - timers.put(name, new JGFTimer(name,opname)); - } - - } - - public void addTimer (String name, String opname, int size){ - - if (timers.containsKey(name)) { - System.printString("JGFInstrumentor.addTimer: warning - timer " + name + - " already exists"); - } - else { - timers.put(name, new JGFTimer(name,opname,size)); - } - - } - - public void startTimer(String name){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).start(); - } - else { - System.printString("JGFInstrumentor.startTimer: failed - timer " + name + - " does not exist"); - } - - } - - public void stopTimer(String name){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).stop(); - } - else { - System.printString("JGFInstrumentor.stopTimer: failed - timer " + name + - " does not exist"); - } - } - - public void addOpsToTimer(String name, double count){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).addops(count); - } - else { - System.printString("JGFInstrumentor.addOpsToTimer: failed - timer " + name + - " does not exist"); - } - } - - public void addTimeToTimer(String name, double added_time){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).addtime(added_time); - } - else { - System.printString("JGFInstrumentor.addTimeToTimer: failed - timer " + name + - " does not exist"); - } - - - - } - - public double readTimer(String name){ - double time; - if (timers.containsKey(name)) { - time = ((JGFTimer) timers.get(name)).time; - } - else { - System.printString("JGFInstrumentor.readTimer: failed - timer " + name + - " does not exist"); - time = 0.0; - } - return time; - } - - public void resetTimer(String name){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).reset(); - } - else { - System.printString("JGFInstrumentor.resetTimer: failed - timer " + name + - " does not exist"); - } - } - - public void printTimer(String name){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).print(); - } - else { - System.printString("JGFInstrumentor.printTimer: failed - timer " + name + - " does not exist"); - } - } - - public void printperfTimer(String name){ - if (timers.containsKey(name)) { - ((JGFTimer) timers.get(name)).printperf(); - } - else { - System.printString("JGFInstrumentor.printTimer: failed - timer " + name + - " does not exist"); - } - } - - public void storeData(String name, Object obj){ - data.put(name,obj); - } - - public void retrieveData(String name, Object obj){ - obj = data.get(name); - } - - public static void printHeader(int section, int size,int nthreads) { - - String header, base; - - header = ""; - base = "Java Grande Forum Thread Benchmark Suite - Version 1.0 - Section "; - - if (section == 1) - { - header = base + "1"; - } - else if (section == 2) - { - if (size == 0) - header = base + "2 - Size A"; - else if (size == 1) - header = base + "2 - Size B"; - else if (size == 2) - header = base + "2 - Size C"; - } - else if (section == 3) - { - if (size == 0) - header = base + "3 - Size A"; - else if (size == 1) - header = base + "3 - Size B"; - } - - System.printString(header); - - if (nthreads == 1) { - System.printString("Executing on " + nthreads + " thread"); - } - else { - System.printString("Executing on " + nthreads + " threads"); - } - - System.printString(""); - - } - -} diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFTimer.java b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFTimer.java deleted file mode 100644 index 0ea93c88..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/jgfutil/JGFTimer.java +++ /dev/null @@ -1,129 +0,0 @@ -/************************************************************************** -* * -* Java Grande Forum Benchmark Suite - Thread Version 1.0 * -* * -* produced by * -* * -* Java Grande Benchmarking Project * -* * -* at * -* * -* Edinburgh Parallel Computing Centre * -* * -* email: epcc-javagrande@epcc.ed.ac.uk * -* * -* * -* This version copyright (c) The University of Edinburgh, 1999. * -* All rights reserved. * -* * -**************************************************************************/ -/************************************************************************** -* Ported for DSTM Benchmark * -**************************************************************************/ - - -package jgfutil; - -public class JGFTimer { - - public String name; - public String opname; - public double time; - public double opcount; - public long calls; - public int size = -1; - - private long start_time; - private boolean on; - - public JGFTimer(String name, String opname){ - this.name = name; - this.opname = opname; - reset(); - } - - public JGFTimer(String name, String opname, int size){ - this.name = name; - this.opname = opname; - this.size = size; - reset(); - } - - public JGFTimer(String name){ - this.name = name; - this.opname = ""; - reset(); - } - - - - public void start(){ - if (on) System.printString("Warning timer " + name + " was already turned on"); - on = true; - start_time = System.currentTimeMillis(); - } - - - public void stop(){ - time += (double) (System.currentTimeMillis()-start_time) / 1000.; - if (!on) System.printString("Warning timer " + name + " wasn't turned on"); - calls++; - on = false; - } - - public void addops(double count){ - opcount += count; - } - - public void addtime(double added_time){ - time += added_time; - } - - public void reset(){ - time = 0.0; - calls = 0; - opcount = 0; - on = false; - } - - public double perf(){ - return opcount / time; - } - - public void longprint(){ - System.printString("Timer Calls Time(s) Performance("+opname+"/s)"); - System.printString(name + " " + calls + " " + time + " " + this.perf()); - } - - public void print(){ - if (opname.equals("")) - { - System.printString(name + " " + time + " (s)"); - } - else - { - if(size == 0) - System.printString(name + ":SizeA" + "\t" + time + " (s) \t " + (float)this.perf() + "\t" + " ("+opname+"/s)"); - else if (size == 1) - System.printString(name + ":SizeB" + "\t" + time + " (s) \t " + (float)this.perf() + "\t" + " ("+opname+"/s)"); - else if (size == 2) - System.printString(name + ":SizeC" + "\t" + time + " (s) \t " + (float)this.perf() + "\t" + " ("+opname+"/s)"); - else - System.printString(name + "\t" + time + " (s) \t " + (float)this.perf() + "\t" + " ("+opname+"/s)"); - } - } - - - public void printperf(){ - - String name; - name = this.name; - - // pad name to 40 characters - while ( name.length() < 40 ) name = name + " "; - - System.printString(name + "\t" + (float)this.perf() + "\t" - + " ("+opname+"/s)"); - } - -} diff --git a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/makefile b/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/makefile deleted file mode 100644 index 91d1abc3..00000000 --- a/Robust/src/Benchmarks/Prefetch/threadv1.0/section2/makefile +++ /dev/null @@ -1,11 +0,0 @@ -MAINCLASS=JGFCryptBenchSizeA -SRC=${MAINCLASS}.java \ -jgfutil/JGFInstrumentor.java \ -jgfutil/JGFTimer.java \ -crypt/IDEATest.java \ -crypt/JGFCryptBench.java -FLAGS=-dsm -prefetch -nooptimize -debug -mainclass ${MAINCLASS} -o ${MAINCLASS} - -default: - ../../../../buildscript ${FLAGS} ${SRC} -