a test that actually worked fine, but shows bad convergence behavior
authorjjenista <jjenista>
Sat, 11 Jun 2011 18:41:55 +0000 (18:41 +0000)
committerjjenista <jjenista>
Sat, 11 Jun 2011 18:41:55 +0000 (18:41 +0000)
Robust/src/Tests/disjoint/subclass-reach/makefile [new file with mode: 0644]
Robust/src/Tests/disjoint/subclass-reach/test.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/disjoint/subclass-reach/makefile b/Robust/src/Tests/disjoint/subclass-reach/makefile
new file mode 100644 (file)
index 0000000..fc1d519
--- /dev/null
@@ -0,0 +1,59 @@
+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_runfree \
+       -coreprof-enable cpe_count_poolalloc \
+       -coreprof-enable cpe_count_poolreuse \
+       -coreprof-enable cpe_workschedgrab \
+       -coreprof-enable cpe_taskdispatch \
+       -coreprof-enable cpe_taskexecute \
+       -coreprof-enable cpe_taskretire
+#      -coreprof-enable cpe_taskstallvar \
+#      -coreprof-enable cpe_taskstallmem
+
+
+DISJOINT= -disjoint -disjoint-k 1 -enable-assertions #-disjoint-desire-determinism
+
+USEOOO= -ooojava 24 2      -ooodebug -squeue
+USERCR= -ooojava 23 2 -rcr -ooodebug -squeue 
+
+BSFLAGS= -justanalyze -mainclass $(PROGRAM) -heapsize-mb 1024 -garbagestats -noloop -joptimize -debug #-ooodebug-disable-task-mem-pool -64bit
+
+
+all: ooo
+
+
+single:
+       $(BUILDSCRIPT) $(BSFLAGS) -thread -o $(PROGRAM)s -builddir sing $(SOURCE_FILES) 
+
+
+ooo: $(PROGRAM)p.bin
+
+$(PROGRAM)p.bin: $(SOURCE_FILES) makefile
+       $(BUILDSCRIPT) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par  $(SOURCE_FILES) 
+
+rcr: $(PROGRAM)r.bin
+
+$(PROGRAM)r.bin: $(SOURCE_FILES) makefile
+       $(BUILDSCRIPT) $(BSFLAGS) $(USECOREPROF) $(USERCR) $(DISJOINT) -o $(PROGRAM)r -builddir rcr  $(SOURCE_FILES) 
+
+
+clean:
+       rm -f  $(PROGRAM)p.bin $(PROGRAM)r.bin $(PROGRAM)s.bin
+       rm -fr par rcr sing
+       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
diff --git a/Robust/src/Tests/disjoint/subclass-reach/test.java b/Robust/src/Tests/disjoint/subclass-reach/test.java
new file mode 100644 (file)
index 0000000..19cd8ca
--- /dev/null
@@ -0,0 +1,61 @@
+public class Jibba {
+  public Foo f;
+}
+
+public class Foo {
+  public int z;
+}
+
+public class Bar extends Foo {
+  public Jibba j;
+}
+
+
+
+public class Test {
+
+  static public void main( String args[] ) {
+    innerMain( args.length );
+  }
+
+  /////////////////////////////////////
+  // 
+  //  I thought a bug exhibited in Barnes-Hut
+  //  might be this:
+  //
+  //  Jibba x references a Foo y;
+  //  y is also a Bar, and the Bar part has
+  //     a field that references x.
+  //
+  //  These two objects should have reach
+  //  states showing they reach each other.
+  //
+  //  TURNS OUT THIS WORKS JUST FINE.
+  //
+  /////////////////////////////////////
+
+  static public void innerMain( int x ) {
+
+    Bar b = disjoint BAR new Bar();
+    Foo f = (Foo) b;
+
+    Jibba j = disjoint JIBBA new Jibba();
+    
+    b.j = j;
+    j.f = f;
+
+    genreach shouldBeCyclic;
+
+    doNothingImportant( j );
+
+    genreach andAfterCall;
+
+    System.out.println( ""+b+j );
+  }
+
+
+  static public void doNothingImportant( Jibba j ) {
+    // just a method to create context and pass it back
+    j.f.z = 1;
+  }
+}