changes to Array benchmark
authoradash <adash>
Mon, 20 Jul 2009 22:09:34 +0000 (22:09 +0000)
committeradash <adash>
Mon, 20 Jul 2009 22:09:34 +0000 (22:09 +0000)
Robust/src/Benchmarks/Prefetch/Array/Array2D.java [new file with mode: 0644]
Robust/src/Benchmarks/Prefetch/Array/makefile

diff --git a/Robust/src/Benchmarks/Prefetch/Array/Array2D.java b/Robust/src/Benchmarks/Prefetch/Array/Array2D.java
new file mode 100644 (file)
index 0000000..912cde9
--- /dev/null
@@ -0,0 +1,37 @@
+public class Array2D extends Thread {
+    int [][] array;
+
+    public Array2D() {
+       int xmax=10000;
+       int ymax=10;
+       array=global new int[xmax][ymax];
+       for(int i=0;i<xmax;i++) {
+           for(int j=0;j<ymax;j++) {
+               array[i][j]=i*j;
+           }
+       }
+    }
+    
+    public static void main(String [] argv) {
+       Array2D a;
+       atomic {
+           a=global new Array2D();
+       }
+       a.start((128<<24)|(195<<16)|(136<<8)|162);
+       a.join();
+    }
+    
+    public void run() {
+        atomic {
+           int xlength=array.length;
+           int ylength=array[0].length;
+           long sum;
+           for(int i=0;i<xlength;i++) {
+               int a[]=array[i];
+               for(int j=0;j<ylength;j++) {
+                   sum+=a[j];
+               }
+           }
+        }
+    }
+}
index ce3d4ba2ad8526b1f3e9fea346098605a943bb7d..3670375b48e576487a41a8bcddb03ea9f838170a 100644 (file)
@@ -1,12 +1,12 @@
-MAINCLASS=Array
+MAINCLASS=Array2D
 SRC1=${MAINCLASS}.java
-FLAGS=-dsm -prefetch -dsmcaching -optimize -excprefetch Array.Array -mainclass ${MAINCLASS} -trueprob 0.98
+FLAGS=-dsm -prefetch -transstats -dsmcaching -optimize -excprefetch Array.Array -mainclass ${MAINCLASS} -trueprob 0.98
 FLAGS1=-dsm -dsmcaching -optimize -mainclass ${MAINCLASS} -trueprob 0.98
 FLAGS2=-dsm -optimize -mainclass ${MAINCLASS}
 default:
        ../../../buildscript ${FLAGS2} -o ${MAINCLASS}NPNC ${SRC1}
        ../../../buildscript ${FLAGS1} -o ${MAINCLASS}NPC ${SRC1}
-#      ../../../buildscript ${FLAGS} -o ${MAINCLASS}P ${SRC1}
+       ../../../buildscript ${FLAGS} -o ${MAINCLASS}N ${SRC1}
 
 clean:
        rm -rf tmpbuilddirectory