From: bdemsky Date: Thu, 28 Oct 2010 22:07:14 +0000 (+0000) Subject: simplify the program...still crashes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=30e6ed69eb0d956c7a4e1675fe3ff13b2ceb3c58;p=IRC.git simplify the program...still crashes --- diff --git a/Robust/src/Benchmarks/oooJava/micro4/test.java b/Robust/src/Benchmarks/oooJava/micro4/test.java index d6faa9fd..089e607a 100644 --- a/Robust/src/Benchmarks/oooJava/micro4/test.java +++ b/Robust/src/Benchmarks/oooJava/micro4/test.java @@ -5,72 +5,30 @@ public class Foo { public class test { - public static void main( String argv[] ) { - - //long count = 500; - //int numFoo = 1000; - long count = 80; + long count = 800; int numFoo = 10; - if( argv.length > 0 ) { - count = count * Integer.parseInt( argv[0] ); - } - - if( argv.length > 1 ) { - numFoo = numFoo * Integer.parseInt( argv[1] ); + Foo[] array = new Foo[numFoo]; + + for( int i = 0; i < numFoo; i++ ) { + array[i] = new Foo(); } - - - 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 - long z = 1; + + for( long j = 0; j < count; j++ ) { for( int i = 0; i < numFoo; i++ ) { - z += array[i].f; + rblock child1 { + int x = 2; + } + + Foo foo = array[i]; + + // a variable fro sib + // AND memory dependence + rblock child2 { + foo.f += x; + } } - - - e1 = System.currentTimeMillis(); } - // 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" ); - } }