From: jjenista Date: Thu, 14 Oct 2010 21:48:30 +0000 (+0000) Subject: micro benchmarks for OoOJava task dispatch improvement, but behavior or ooo version... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d379bf55be7bada49e9ce9c12d30452634c24a1c;p=IRC.git micro benchmarks for OoOJava task dispatch improvement, but behavior or ooo version just looks wrong... --- diff --git a/Robust/src/Benchmarks/oooJava/micro-master-makefile b/Robust/src/Benchmarks/oooJava/micro-master-makefile new file mode 100644 index 00000000..e77ffe51 --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/micro-master-makefile @@ -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 diff --git a/Robust/src/Benchmarks/oooJava/micro/makefile b/Robust/src/Benchmarks/oooJava/micro/makefile index b6b2f6cf..a12742fa 100644 --- a/Robust/src/Benchmarks/oooJava/micro/makefile +++ b/Robust/src/Benchmarks/oooJava/micro/makefile @@ -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 diff --git a/Robust/src/Benchmarks/oooJava/micro/test.java b/Robust/src/Benchmarks/oooJava/micro/test.java index b8803cd5..753c8f77 100644 --- a/Robust/src/Benchmarks/oooJava/micro/test.java +++ b/Robust/src/Benchmarks/oooJava/micro/test.java @@ -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;i0){ - count=count * Integer.parseInt(argv[0]); - } - - long s=System.currentTimeMillis(); - - for(long i=0;i 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" ); + } } diff --git a/Robust/src/Benchmarks/oooJava/micro3/makefile b/Robust/src/Benchmarks/oooJava/micro3/makefile index 57711751..a12742fa 100644 --- a/Robust/src/Benchmarks/oooJava/micro3/makefile +++ b/Robust/src/Benchmarks/oooJava/micro3/makefile @@ -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 diff --git a/Robust/src/Benchmarks/oooJava/micro3/test.java b/Robust/src/Benchmarks/oooJava/micro3/test.java index 731a2672..e2fb866d 100644 --- a/Robust/src/Benchmarks/oooJava/micro3/test.java +++ b/Robust/src/Benchmarks/oooJava/micro3/test.java @@ -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 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" ); + } }