From a24fe82ca3131c345e9350c680362e1c4ff64772 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 1 Nov 2010 19:41:43 +0000 Subject: [PATCH] a version of micro4 that collects the results and shows sequential behavior is preserved, brians fix is awesome --- .../src/Benchmarks/oooJava/micro4.5/makefile | 1 + .../src/Benchmarks/oooJava/micro4.5/test.java | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 Robust/src/Benchmarks/oooJava/micro4.5/makefile create mode 100644 Robust/src/Benchmarks/oooJava/micro4.5/test.java diff --git a/Robust/src/Benchmarks/oooJava/micro4.5/makefile b/Robust/src/Benchmarks/oooJava/micro4.5/makefile new file mode 100644 index 00000000..a12742fa --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/micro4.5/makefile @@ -0,0 +1 @@ +include ../micro-master-makefile diff --git a/Robust/src/Benchmarks/oooJava/micro4.5/test.java b/Robust/src/Benchmarks/oooJava/micro4.5/test.java new file mode 100644 index 00000000..26f2ada9 --- /dev/null +++ b/Robust/src/Benchmarks/oooJava/micro4.5/test.java @@ -0,0 +1,42 @@ +public class Foo { + public Foo() {} + int f; +} + + +public class test { + public static void main( String argv[] ) { + long count = 800; + int numFoo = 10; + + 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; + } + } + } + + long total = 0; + for( long j = 0; j < count; j++ ) { + for( int i = 0; i < numFoo; i++ ) { + total += array[i].f; + } + } + System.out.println( "t="+total ); + } +} -- 2.34.1