a version of micro4 that collects the results and shows sequential behavior is preser...
authorjjenista <jjenista>
Mon, 1 Nov 2010 19:41:43 +0000 (19:41 +0000)
committerjjenista <jjenista>
Mon, 1 Nov 2010 19:41:43 +0000 (19:41 +0000)
Robust/src/Benchmarks/oooJava/micro4.5/makefile [new file with mode: 0644]
Robust/src/Benchmarks/oooJava/micro4.5/test.java [new file with mode: 0644]

diff --git a/Robust/src/Benchmarks/oooJava/micro4.5/makefile b/Robust/src/Benchmarks/oooJava/micro4.5/makefile
new file mode 100644 (file)
index 0000000..a12742f
--- /dev/null
@@ -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 (file)
index 0000000..26f2ada
--- /dev/null
@@ -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 );
+  }
+}