From: jjenista Date: Sat, 11 Jun 2011 23:12:33 +0000 (+0000) Subject: a mini version of barnes hut X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=239d6b59c52748799f3b664ee467e11293671783;p=IRC.git a mini version of barnes hut --- diff --git a/Robust/src/Tests/disjoint/bh-mini/makefile b/Robust/src/Tests/disjoint/bh-mini/makefile new file mode 100644 index 00000000..fc1d519f --- /dev/null +++ b/Robust/src/Tests/disjoint/bh-mini/makefile @@ -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 index 00000000..1b0c9e41 --- /dev/null +++ b/Robust/src/Tests/disjoint/bh-mini/test.java @@ -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 ); + } + } +}