a mini version of barnes hut
authorjjenista <jjenista>
Sat, 11 Jun 2011 23:12:33 +0000 (23:12 +0000)
committerjjenista <jjenista>
Sat, 11 Jun 2011 23:12:33 +0000 (23:12 +0000)
Robust/src/Tests/disjoint/bh-mini/makefile [new file with mode: 0644]
Robust/src/Tests/disjoint/bh-mini/test.java [new file with mode: 0644]

diff --git a/Robust/src/Tests/disjoint/bh-mini/makefile b/Robust/src/Tests/disjoint/bh-mini/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/bh-mini/test.java b/Robust/src/Tests/disjoint/bh-mini/test.java
new file mode 100644 (file)
index 0000000..1b0c9e4
--- /dev/null
@@ -0,0 +1,92 @@
+///////////////////////////////////
+//
+//  This tiny version of Barnes-Hut
+//  might have enough of the elements
+//  to exhibit the same reachability state
+//  bug as the full benchmark, but wackily
+//  it either analyzes longer than I'm
+//  willing to wait (over an hour!) or
+//  it exhausts the memory on dc-11.
+//
+///////////////////////////////////
+
+
+public class ArrayIndexedNode {
+  public ArrayIndexedNode[] neighbors;
+  public OctTreeNodeData data;
+}
+
+public class OctTreeNodeData {
+  public int z;
+}
+
+public class OctTreeLeafNodeData extends OctTreeNodeData {
+  public ArrayIndexedNode root;
+}
+
+
+public class ArrayIndexedGraph {
+  public ArrayIndexedNode createNode( OctTreeNodeData d ) {
+    ArrayIndexedNode node = disjoint AIN new ArrayIndexedNode();
+    node.data = d;
+    node.neighbors = new ArrayIndexedNode[1];
+    return node;
+  }
+}
+
+
+public class Test {
+
+  static public void main( String args[] ) {
+    innerMain( args.length );
+  }
+
+
+  static int numBodies = 3;
+
+
+  static public void innerMain( int x ) {
+
+    OctTreeLeafNodeData bodies[] = new OctTreeLeafNodeData[numBodies];
+    for( int i = 0; i < numBodies; ++i ) {
+      bodies[i] = disjoint BODY new OctTreeLeafNodeData();
+      bodies[i].z = 0;
+    }
+
+    genreach b0;
+
+
+    for( int step = 0; step < 1; ++step ) {
+
+      genreach b1;
+
+      ArrayIndexedGraph octree = new ArrayIndexedGraph();
+
+      ArrayIndexedNode root = octree.createNode( new OctTreeNodeData() );
+
+      genreach b2;
+
+      for( int i = 0; i < numBodies; ++i ) {
+        insert( octree, root, bodies[i] );
+        bodies[i].root = root;
+      }
+
+      genreach b3;
+
+    }
+
+  }
+
+
+  static public void insert( ArrayIndexedGraph   octree,
+                             ArrayIndexedNode    root,
+                             OctTreeLeafNodeData b 
+                             ) {
+    ArrayIndexedNode newNode = octree.createNode( b );
+    root.neighbors[0] = newNode;
+    if( false ) {
+      insert( octree, newNode, b );
+    }
+  }
+}