From: jjenista Date: Fri, 15 Oct 2010 21:34:12 +0000 (+0000) Subject: Tweaks to microbenchmarks, one stall semaphore per thread changes have been backed... X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=094382034ba79a24ac30c3a982e2dd22f10b4789;p=IRC.git Tweaks to microbenchmarks, one stall semaphore per thread changes have been backed out while exploring micro benchmark issues --- diff --git a/Robust/src/Benchmarks/oooJava/micro-master-makefile b/Robust/src/Benchmarks/oooJava/micro-master-makefile index e77ffe51..54fd6ae2 100644 --- a/Robust/src/Benchmarks/oooJava/micro-master-makefile +++ b/Robust/src/Benchmarks/oooJava/micro-master-makefile @@ -16,7 +16,7 @@ BUILDSCRIPT=../../../buildscript COREPROFOVERFLOW= #-coreprof-checkoverflow USECOREPROF= -coreprof $(COREPROFOVERFLOW) \ - -coreprof-eventwords 1024*1024*128 \ + -coreprof-eventwords 1024*1024*512 \ -coreprof-enable cpe_main \ -coreprof-enable cpe_runmalloc \ -coreprof-enable cpe_taskexecute \ @@ -33,7 +33,7 @@ USECOREPROF= -coreprof $(COREPROFOVERFLOW) \ 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 +BSFLAGS= -64bit -mainclass $(PROGRAM) -heapsize-mb 2000 -garbagestats -joptimize -noloop -optimize -debug #src-after-pp 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 diff --git a/Robust/src/Benchmarks/oooJava/micro/test.java b/Robust/src/Benchmarks/oooJava/micro/test.java index 753c8f77..69fd2f7b 100644 --- a/Robust/src/Benchmarks/oooJava/micro/test.java +++ b/Robust/src/Benchmarks/oooJava/micro/test.java @@ -24,14 +24,19 @@ public class test { // child needs the value read-only rblock child { if( x + 4 == -9 ) { - ++y; } } } e1 = System.currentTimeMillis(); - } + long z = 1; + } + // just read vars so compile doesn't throw them out + // and force parent of parent to depend on z, for + // timing + System.out.println( "ignore: "+x+y+z ); 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" ); diff --git a/Robust/src/Benchmarks/oooJava/micro2/test.java b/Robust/src/Benchmarks/oooJava/micro2/test.java index 4146e23c..a0515c11 100644 --- a/Robust/src/Benchmarks/oooJava/micro2/test.java +++ b/Robust/src/Benchmarks/oooJava/micro2/test.java @@ -13,7 +13,7 @@ public class test { long e2; rblock parent { - long y = 0; + //long y = 0; for( long i = 0; i < count; i++ ) { @@ -23,17 +23,23 @@ public class test { long x = 3; } - rblock child1 { + rblock child2 { if( x + 4 == -9 ) { - ++y; + //++y; } } } e1 = System.currentTimeMillis(); + long z = 1; } + // just read vars so compile doesn't throw them out + // and force parent of parent to depend on z, for + // timing + System.out.println( "ignore: "+z ); 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" ); diff --git a/Robust/src/Benchmarks/oooJava/micro3/test.java b/Robust/src/Benchmarks/oooJava/micro3/test.java index e2fb866d..45dc4d45 100644 --- a/Robust/src/Benchmarks/oooJava/micro3/test.java +++ b/Robust/src/Benchmarks/oooJava/micro3/test.java @@ -1,5 +1,6 @@ public class Foo { - int z; + public Foo() {} + int f; } @@ -7,8 +8,8 @@ public class test { public static void main( String argv[] ) { - long count = 500000; - long numFoo = 1000; + long count = 5000; + int numFoo = 1000; if( argv.length > 0 ) { count = count * Integer.parseInt( argv[0] ); @@ -18,38 +19,47 @@ public class test { 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++ ) { + + for( int i = 0; i < numFoo; i++ ) { array[i] = new Foo(); } - + for( long j = 0; j < count; j++ ) { - for( long i = 0; i < numFoo; i++ ) { + for( int i = 0; i < numFoo; i++ ) { - Foo f = array[i]; + Foo foo = array[i]; rblock child { - f.z++; + foo.f++; } } } // force a coarse grained conflict - //array[numFoo - 1].z++; + //array[numFoo - 1].f++; + e1 = System.currentTimeMillis(); + long z = 1; } + // just read vars so compile doesn't throw them out + // and force parent of parent to depend on z, for + // timing + System.out.println( "ignore: "+z ); 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" ); + } } diff --git a/Robust/src/Benchmarks/oooJava/micro4/makefile b/Robust/src/Benchmarks/oooJava/micro4/makefile new file mode 100644 index 00000000..a12742fa --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/micro4/makefile @@ -0,0 +1 @@ +include ../micro-master-makefile diff --git a/Robust/src/Benchmarks/oooJava/micro4/test.java b/Robust/src/Benchmarks/oooJava/micro4/test.java new file mode 100644 index 00000000..2acf70c3 --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/micro4/test.java @@ -0,0 +1,72 @@ +public class Foo { + public Foo() {} + int f; +} + + +public class test { + + public static void main( String argv[] ) { + + long count = 5000; + int 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( int i = 0; i < numFoo; i++ ) { + array[i] = new Foo(); + } + + for( long j = 0; j < count; j++ ) { + for( int i = 0; i < numFoo; i++ ) { + + rblock child1 { + int x = 2; + } + + Foo foo = array[i]; + + // a variable fro sib + // AND memory dependence + rblock child2 { + foo.f += x; + } + } + } + + // force a coarse grained conflict + //array[numFoo - 1].f++; + + + e1 = System.currentTimeMillis(); + long z = 1; + } + // just read vars so compile doesn't throw them out + // and force parent of parent to depend on z, for + // timing + System.out.println( "ignore: "+z ); + 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" ); + + } +}