micro benchmarks for OoOJava task dispatch improvement, but behavior or ooo version...
authorjjenista <jjenista>
Thu, 14 Oct 2010 21:48:30 +0000 (21:48 +0000)
committerjjenista <jjenista>
Thu, 14 Oct 2010 21:48:30 +0000 (21:48 +0000)
Robust/src/Benchmarks/oooJava/micro-master-makefile [new file with mode: 0644]
Robust/src/Benchmarks/oooJava/micro/makefile
Robust/src/Benchmarks/oooJava/micro/test.java
Robust/src/Benchmarks/oooJava/micro2/makefile
Robust/src/Benchmarks/oooJava/micro2/test.java
Robust/src/Benchmarks/oooJava/micro3/makefile
Robust/src/Benchmarks/oooJava/micro3/test.java

diff --git a/Robust/src/Benchmarks/oooJava/micro-master-makefile b/Robust/src/Benchmarks/oooJava/micro-master-makefile
new file mode 100644 (file)
index 0000000..e77ffe5
--- /dev/null
@@ -0,0 +1,62 @@
+##########################################################################
+#
+#  This master makefile should be included in each local makefile of a
+#  MICRO benchmark directory.  Note that joptimize is disabled so
+#  nonsensical code patterns will still generate the micro structure
+#  desired.
+#
+##########################################################################
+
+PROGRAM=test
+SOURCE_FILES=test.java
+
+
+BUILDSCRIPT=../../../buildscript
+
+
+COREPROFOVERFLOW= #-coreprof-checkoverflow
+USECOREPROF= -coreprof $(COREPROFOVERFLOW) \
+       -coreprof-eventwords 1024*1024*128 \
+       -coreprof-enable cpe_main \
+       -coreprof-enable cpe_runmalloc \
+       -coreprof-enable cpe_taskexecute \
+       -coreprof-enable cpe_taskdispatch \
+       -coreprof-enable cpe_poolalloc
+#      -coreprof-enable cpe_preparememq
+#      -coreprof-enable cpe_runfree \
+#      -coreprof-enable cpe_count_poolalloc \
+#      -coreprof-enable cpe_count_poolreuse \
+#      -coreprof-enable cpe_workschedgrab \
+#      -coreprof-enable cpe_taskretire \
+#      -coreprof-enable cpe_taskstallvar \
+#      -coreprof-enable cpe_taskstallmem
+
+
+USEOOO= -ooojava 24 2 #-ooodebug-disable-task-mem-pool #-ooodebug 
+BSFLAGS= -64bit -mainclass $(PROGRAM)  -heapsize-mb 8000 -garbagestats -joptimize -noloop -optimize #src-after-pp #-debug
+
+DRELEASEMODE=-disjoint-release-mode -disjoint-dvisit-stack-callees-on-top -disjoint-alias-file aliases.txt tabbed
+DISJOINT= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) #-disjoint-desire-determinism
+
+default:
+       $(BUILDSCRIPT) -nojava $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES)
+
+single:
+       $(BUILDSCRIPT) -thread $(BSFLAGS) $(USECOREPROF)                       -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
+
+ooo:
+       $(BUILDSCRIPT)         $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES) 
+
+clean:
+       rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin
+       rm -fr par sing
+       rm -f tmp.c
+       rm -f  *~
+       rm -f  *.dot
+       rm -f  *.png
+       rm -f  *.txt
+       rm -f  aliases.txt
+       rm -f  mlpReport*txt
+       rm -f  results*txt
+       rm -f coreprof.dat
+       rm -f trace.out
index b6b2f6cfc8f94a081d26ddc1fc483d3e068eefc1..a12742fa69b088650cfd9abf2bb65a08aa969132 100644 (file)
@@ -1,30 +1 @@
-#raytracer
-PROGRAM=test
-
-SOURCE_FILES=test.java
-
-BUILDSCRIPT=../../../buildscript
-
-USEOOO= -ooojava 1 2  -ooodebug  
-BSFLAGS= -64bit -mainclass test -debug -garbagestats -joptimize -optimize
-DISJOINT= -disjoint -disjoint-k 1 -enable-assertions 
-
-default:
-       $(BUILDSCRIPT) -nojava $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p $(SOURCE_FILES) -builddir par
-
-single:
-       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
-
-ooo:
-       $(BUILDSCRIPT) $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) 
-
-clean:
-       rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin
-       rm -fr par sing
-       rm -f  *~
-       rm -f  *.dot
-       rm -f  *.png
-       rm -f  *.txt
-       rm -f  aliases.txt
-       rm -f  mlpReport*txt
-       rm -f  results*txt
+include ../micro-master-makefile
index b8803cd5d9d6bf91c902fa89c599dd4f6bbfa630..753c8f77413d1a06f6fcda91e6e42499d994f937 100644 (file)
@@ -1,33 +1,40 @@
 public class test {
 
-       public static void main(String argv[]) {
-
-           long x=0;
-           long count=500000;
-
-           if(argv.length>0){
-               count=count * Integer.parseInt(argv[0]);
-           }
+  public static void main( String argv[] ) {
+    
+    long count = 500000;
+    
+    if( argv.length > 0 ) {
+      count = count * Integer.parseInt( argv[0] );
+    }
             
-            long s=System.currentTimeMillis();
-
-           for(long i=0;i<count;i++){
-               rblock rchild{
-                   x++;
-                    for(int j=0;j<1000;j++) {
-                      x++;x--;
-                    }
-               }
-           }
+    long s = System.currentTimeMillis();
+    long e1;
+    long e2;
 
-            long e1=System.currentTimeMillis();
-            System.out.println( "x="+x );
-            long e2=System.currentTimeMillis();
+    rblock parent {
+      long x = 3;
+      long y = 0;
+      
+      for( long i = 0; i < count; i++ ) {
 
-            double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
-            double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
-            System.out.println( "dt1="+dt1+"s" );
-            System.out.println( "dt2="+dt2+"s" );
-       }
+        // the parent does a simple variable copy
+        // into this child's record at issue because
+        // the value is definitely available, the
+        // child needs the value read-only
+        rblock child {
+          if( x + 4 == -9 ) {
+            ++y;
+          }
+        }
+      }
+      e1 = System.currentTimeMillis();
+    }
+    e2 = System.currentTimeMillis();
 
+    double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
+    double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
+    System.out.println( "dt to parent done   ="+dt1+"s" );
+    System.out.println( "dt to parent retired="+dt2+"s" );
+  }
 }
index 577117515645b5dbb97e6918bff44931cf23b075..a12742fa69b088650cfd9abf2bb65a08aa969132 100644 (file)
@@ -1,30 +1 @@
-#raytracer
-PROGRAM=test
-
-SOURCE_FILES=test.java
-
-BUILDSCRIPT=../../../buildscript
-
-USEOOO= -ooojava 1 2  -ooodebug  
-BSFLAGS= -64bit -optimize -mainclass test -debug -garbagestats -joptimize
-DISJOINT= -disjoint -disjoint-k 1 -enable-assertions 
-
-default:
-       $(BUILDSCRIPT) -nojava $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p $(SOURCE_FILES) -builddir par
-
-single:
-       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
-
-ooo:
-       $(BUILDSCRIPT) $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) 
-
-clean:
-       rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin
-       rm -fr par sing
-       rm -f  *~
-       rm -f  *.dot
-       rm -f  *.png
-       rm -f  *.txt
-       rm -f  aliases.txt
-       rm -f  mlpReport*txt
-       rm -f  results*txt
+include ../micro-master-makefile
index 61086638d9681868f65f15e3dbe86d092f1b233b..4146e23cd95e3a79820276749654ecb49b3bcefd 100644 (file)
@@ -1,30 +1,42 @@
 public class test {
 
-       public static void main(String argv[]) {
-
-           long x=0;
-           long count=500000;
-
-           if(argv.length>0){
-               count=count * Integer.parseInt(argv[0]);
-           }
-
-            long s=System.currentTimeMillis();
-
-           for(long i=0;i<count;i++){
-               rblock rchild{
-               }
-                x++;
-           }
-
-            long e1=System.currentTimeMillis();
-            System.out.println( "x="+x );
-            long e2=System.currentTimeMillis();
-
-            double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
-            double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
-            System.out.println( "dt1="+dt1+"s" );
-            System.out.println( "dt2="+dt2+"s" );
-       }
-
+  public static void main( String argv[] ) {
+    
+    long count = 500000;
+    
+    if( argv.length > 0 ) {
+      count = count * Integer.parseInt( argv[0] );
+    }
+            
+    long s = System.currentTimeMillis();
+    long e1;
+    long e2;
+
+    rblock parent {
+      long y = 0;
+      
+      for( long i = 0; i < count; i++ ) {
+
+        // the subsequent sibling has a dependence
+        // on the first
+        rblock child1 {
+          long x = 3;
+        }
+
+        rblock child1 {
+          if( x + 4 == -9 ) {
+            ++y;
+          }
+        }
+
+      }
+      e1 = System.currentTimeMillis();
+    }
+    e2 = System.currentTimeMillis();
+
+    double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
+    double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
+    System.out.println( "dt to parent done   ="+dt1+"s" );
+    System.out.println( "dt to parent retired="+dt2+"s" );
+  }
 }
index 577117515645b5dbb97e6918bff44931cf23b075..a12742fa69b088650cfd9abf2bb65a08aa969132 100644 (file)
@@ -1,30 +1 @@
-#raytracer
-PROGRAM=test
-
-SOURCE_FILES=test.java
-
-BUILDSCRIPT=../../../buildscript
-
-USEOOO= -ooojava 1 2  -ooodebug  
-BSFLAGS= -64bit -optimize -mainclass test -debug -garbagestats -joptimize
-DISJOINT= -disjoint -disjoint-k 1 -enable-assertions 
-
-default:
-       $(BUILDSCRIPT) -nojava $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p $(SOURCE_FILES) -builddir par
-
-single:
-       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
-
-ooo:
-       $(BUILDSCRIPT) $(USEOOO) $(BSFLAGS) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) 
-
-clean:
-       rm -f  $(PROGRAM)p.bin $(PROGRAM)s.bin
-       rm -fr par sing
-       rm -f  *~
-       rm -f  *.dot
-       rm -f  *.png
-       rm -f  *.txt
-       rm -f  aliases.txt
-       rm -f  mlpReport*txt
-       rm -f  results*txt
+include ../micro-master-makefile
index 731a26721b9ebba50094dc9f664cafa1b253f12d..e2fb866d89406deb1992264cd45e316041d0ee49 100644 (file)
@@ -1,29 +1,55 @@
-public class test {
-
-       public static void main(String argv[]) {
-
-           long x=0;
-           long count=500000;
-
-           if(argv.length>0){
-               count=count * Integer.parseInt(argv[0]);
-           }
-
-            long s=System.currentTimeMillis();
-
-           for(long i=0;i<count;i++){
-               rblock rchild{
-               }
-           }
+public class Foo {
+  int z;
+}
 
-            long e1=System.currentTimeMillis();
-            System.out.println( "x="+x );
-            long e2=System.currentTimeMillis();
 
-            double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
-            double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
-            System.out.println( "dt1="+dt1+"s" );
-            System.out.println( "dt2="+dt2+"s" );
-       }
+public class test {
 
+  public static void main( String argv[] ) {
+    
+    long count  = 500000;
+    long numFoo = 1000;
+    
+    if( argv.length > 0 ) {
+      count = count * Integer.parseInt( argv[0] );
+    }
+
+    if( argv.length > 1 ) {
+      numFoo = numFoo * Integer.parseInt( argv[1] );
+    }
+            
+    long s = System.currentTimeMillis();
+    long e1;
+    long e2;
+
+    rblock parent {
+      
+      Foo[] array = new Foo[numFoo];
+      
+      for( long i = 0; i < numFoo; i++ ) {
+        array[i] = new Foo();
+      }
+      
+      for( long j = 0; j < count; j++ ) {
+        for( long i = 0; i < numFoo; i++ ) {
+
+          Foo f = array[i];
+          rblock child {
+            f.z++;
+          }
+        }
+      }
+
+      // force a coarse grained conflict
+      //array[numFoo - 1].z++;
+
+      e1 = System.currentTimeMillis();
+    }
+    e2 = System.currentTimeMillis();
+
+    double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
+    double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
+    System.out.println( "dt to parent done   ="+dt1+"s" );
+    System.out.println( "dt to parent retired="+dt2+"s" );
+  }
 }