From: jzhou Date: Fri, 15 Jul 2011 01:42:54 +0000 (+0000) Subject: my changes X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1aef7fcf02784cf73392e7c1ae66a9945c487934;p=IRC.git my changes --- diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.java deleted file mode 100644 index c61f7b72..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.java +++ /dev/null @@ -1,68 +0,0 @@ -package Fibheaps; - -// the fibheap class -public class TestRunner extends Thread { - - public TestRunner() {} - - public void run() { - // generate test data - int iter = 1200; //200; - int seed = 1967; - //Vector testdata = new Vector(iter); - FibHeap fh = new FibHeap(); - FibHeap fh_t = new FibHeap(); - for(int i = 0; i < iter; i++) { - int rand = (77 * seed + 1) % 1024; - //testdata.addElement(new Integer(rand)); - seed++; - fh = fh.insertFH(rand); - fh_t = fh_t.insertFH(rand); - } - // makeFH from the test data - /*FibHeap fh = new FibHeap(); - for(int i = testdata.size(); i > 0; i++) { - fh = fh.insertFH((Integer)(testdata.elementAt(i-1)).intValue()); - } - FibHeap fh_t = new FibHeap(); - for(int i = testdata.size(); i > 0; i++) { - fh_t = fh_t.insertFH((Integer)(testdata.elementAt(i-1)).intValue()); - }*/ - - int[] rfh = new int[iter]; - int[] rfh_t = new int[iter]; - - int i = 0; - while(!fh.isEmpty()) { - rfh[i] = fh.minFH(); - fh = fh.deleteMinFH(); - i++; - } - int j = 0; - while(!fh_t.isEmpty()) { - rfh_t[j] = fh_t.minFH(); - fh_t = fh_t.deleteMinFH_t(); - j++; - } - - if(i != j) { - // error! - System.exit(0xaa); - } else { - for(i = 0; i < j; i++) { - if(rfh[i] != rfh_t[i]) { - // error! - System.exit(0xbb); - } - } - } - } - - public static void main(String[] args) { - int threadnum = 62; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(); - tr.start(); - } - } -} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.p new file mode 100644 index 00000000..d5edbeea --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/Fibheaps/TestRunner.p @@ -0,0 +1,69 @@ +package Fibheaps; + +// the fibheap class +public class TestRunner extends Thread { + + public TestRunner() {} + + public void run() { + // generate test data + int iter = 1200; //200; + int seed = 1967; + //Vector testdata = new Vector(iter); + FibHeap fh = new FibHeap(); + FibHeap fh_t = new FibHeap(); + for(int i = 0; i < iter; i++) { + int rand = (77 * seed + 1) % 1024; + //testdata.addElement(new Integer(rand)); + seed++; + fh = fh.insertFH(rand); + fh_t = fh_t.insertFH(rand); + } + // makeFH from the test data + /*FibHeap fh = new FibHeap(); + for(int i = testdata.size(); i > 0; i++) { + fh = fh.insertFH((Integer)(testdata.elementAt(i-1)).intValue()); + } + FibHeap fh_t = new FibHeap(); + for(int i = testdata.size(); i > 0; i++) { + fh_t = fh_t.insertFH((Integer)(testdata.elementAt(i-1)).intValue()); + }*/ + + int[] rfh = new int[iter]; + int[] rfh_t = new int[iter]; + + int i = 0; + while(!fh.isEmpty()) { + rfh[i] = fh.minFH(); + fh = fh.deleteMinFH(); + i++; + } + int j = 0; + while(!fh_t.isEmpty()) { + rfh_t[j] = fh_t.minFH(); + fh_t = fh_t.deleteMinFH_t(); + j++; + } + + if(i != j) { + // error! + System.exit(0xaa); + } else { + for(i = 0; i < j; i++) { + if(rfh[i] != rfh_t[i]) { + // error! + System.exit(0xbb); + } + } + } + } + + public static void main(String[] args) { + int threadnum = THREADNUM; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(); + tr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.java deleted file mode 100644 index 0507ff1f..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.java +++ /dev/null @@ -1,157 +0,0 @@ -package GCBench; - -//This is adapted from a benchmark written by John Ellis and Pete Kovac -//of Post Communications. -//It was modified by Hans Boehm of Silicon Graphics. - -//This is no substitute for real applications. No actual application -//is likely to behave in exactly this way. However, this benchmark was -//designed to be more representative of real applications than other -//Java GC benchmarks of which we are aware. -//It attempts to model those properties of allocation requests that -//are important to current GC techniques. -//It is designed to be used either to obtain a single overall performance -//number, or to give a more detailed estimate of how collector -//performance varies with object lifetimes. It prints the time -//required to allocate and collect balanced binary trees of various -//sizes. Smaller trees result in shorter object lifetimes. Each cycle -//allocates roughly the same amount of memory. -//Two data structures are kept around during the entire process, so -//that the measured performance is representative of applications -//that maintain some live in-memory data. One of these is a tree -//containing many pointers. The other is a large array containing -//double precision floating point numbers. Both should be of comparable -//size. - -//The results are only really meaningful together with a specification -//of how much memory was used. It is possible to trade memory for -//better time performance. This benchmark should be run in a 32 MB -//heap, though we don't currently know how to enforce that uniformly. - -//Unlike the original Ellis and Kovac benchmark, we do not attempt -//measure pause times. This facility should eventually be added back -//in. There are several reasons for omitting it for now. The original -//implementation depended on assumptions about the thread scheduler -//that don't hold uniformly. The results really measure both the -//scheduler and GC. Pause time measurements tend to not fit well with -//current benchmark suites. As far as we know, none of the current -//commercial Java implementations seriously attempt to minimize GC pause -//times. - -//Known deficiencies: -//- No way to check on memory use -//- No cyclic data structures -//- No attempt to measure variation with object size -//- Results are sensitive to locking cost, but we dont -//check for proper locking - -public class TestRunner extends Thread { - - public static final int kStretchTreeDepth = 16; // about 4Mb - public static final int kLongLivedTreeDepth = 14; // about 1Mb - public static final int kArraySize = 250000; // about 1Mb - public static final int kMinTreeDepth = 4; - public static final int kMaxTreeDepth = 14; - - // Nodes used by a tree of a given size - int TreeSize(int i) { - return ((1 << (i + 1)) - 1); - } - - // Number of iterations to use for a given tree depth - int NumIters(int i) { - return 2 * TreeSize(kStretchTreeDepth) / TreeSize(i); - } - - // Build tree top down, assigning to older objects. - void Populate(int iDepth, Node thisNode) { - if (iDepth<=0) { - return; - } else { - iDepth--; - thisNode.left = new Node(); - thisNode.right = new Node(); - Populate (iDepth, thisNode.left); - Populate (iDepth, thisNode.right); - } - } - - // Build tree bottom-up - Node MakeTree(int iDepth) { - if (iDepth<=0) { - return new Node(); - } else { - return new Node(MakeTree(iDepth-1), - MakeTree(iDepth-1)); - } - } - - void tc1(int depth) { - Node tempTree = new Node(); - Populate(depth, tempTree); - tempTree = null; - } - - void tc2(int depth) { - Node tempTree = MakeTree(depth); - tempTree = null; - } - - void TimeConstruction(int depth) { - Node root; - int iNumIters = NumIters(depth); - Node tempTree; - - for (int i = 0; i < iNumIters; ++i) { - tc1(depth); - } - for (int i = 0; i < iNumIters; ++i) { - tc2(depth); - } - } - - public void stretch() { - Node root; - Node longLivedTree; - Node tempTree; - - // Stretch the memory space quickly - tempTree = MakeTree(kStretchTreeDepth); - tempTree = null; - } - - public void run() { - Node root; - Node longLivedTree; - - // Stretch the memory space quickly - stretch(); - - // Create a long lived object - longLivedTree = new Node(); - Populate(kLongLivedTreeDepth, longLivedTree); - - // Create long-lived array, filling half of it - float array[] = new float[kArraySize]; - for (int i = 0; i < kArraySize/2; ++i) { - array[i] = 1.0f/i; - } - - for (int d = kMinTreeDepth; d <= kMaxTreeDepth; d += 2) { - TimeConstruction(d); - } - - if (longLivedTree == null || array[1000] != 1.0f/1000) { - System.out.println(0xa0); - System.out.println((int)(array[1000]*1000000)); - } - } - - public static void main(String[] args) { - int threadnum = 62; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(); - tr.start(); - } - } -} // class JavaGC diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.p new file mode 100644 index 00000000..d9028ea9 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/GCBench/TestRunner.p @@ -0,0 +1,158 @@ +package GCBench; + +//This is adapted from a benchmark written by John Ellis and Pete Kovac +//of Post Communications. +//It was modified by Hans Boehm of Silicon Graphics. + +//This is no substitute for real applications. No actual application +//is likely to behave in exactly this way. However, this benchmark was +//designed to be more representative of real applications than other +//Java GC benchmarks of which we are aware. +//It attempts to model those properties of allocation requests that +//are important to current GC techniques. +//It is designed to be used either to obtain a single overall performance +//number, or to give a more detailed estimate of how collector +//performance varies with object lifetimes. It prints the time +//required to allocate and collect balanced binary trees of various +//sizes. Smaller trees result in shorter object lifetimes. Each cycle +//allocates roughly the same amount of memory. +//Two data structures are kept around during the entire process, so +//that the measured performance is representative of applications +//that maintain some live in-memory data. One of these is a tree +//containing many pointers. The other is a large array containing +//double precision floating point numbers. Both should be of comparable +//size. + +//The results are only really meaningful together with a specification +//of how much memory was used. It is possible to trade memory for +//better time performance. This benchmark should be run in a 32 MB +//heap, though we don't currently know how to enforce that uniformly. + +//Unlike the original Ellis and Kovac benchmark, we do not attempt +//measure pause times. This facility should eventually be added back +//in. There are several reasons for omitting it for now. The original +//implementation depended on assumptions about the thread scheduler +//that don't hold uniformly. The results really measure both the +//scheduler and GC. Pause time measurements tend to not fit well with +//current benchmark suites. As far as we know, none of the current +//commercial Java implementations seriously attempt to minimize GC pause +//times. + +//Known deficiencies: +//- No way to check on memory use +//- No cyclic data structures +//- No attempt to measure variation with object size +//- Results are sensitive to locking cost, but we dont +//check for proper locking + +public class TestRunner extends Thread { + + public static final int kStretchTreeDepth = 16; // about 4Mb + public static final int kLongLivedTreeDepth = 14; // about 1Mb + public static final int kArraySize = 250000; // about 1Mb + public static final int kMinTreeDepth = 4; + public static final int kMaxTreeDepth = 14; + + // Nodes used by a tree of a given size + int TreeSize(int i) { + return ((1 << (i + 1)) - 1); + } + + // Number of iterations to use for a given tree depth + int NumIters(int i) { + return 2 * TreeSize(kStretchTreeDepth) / TreeSize(i); + } + + // Build tree top down, assigning to older objects. + void Populate(int iDepth, Node thisNode) { + if (iDepth<=0) { + return; + } else { + iDepth--; + thisNode.left = new Node(); + thisNode.right = new Node(); + Populate (iDepth, thisNode.left); + Populate (iDepth, thisNode.right); + } + } + + // Build tree bottom-up + Node MakeTree(int iDepth) { + if (iDepth<=0) { + return new Node(); + } else { + return new Node(MakeTree(iDepth-1), + MakeTree(iDepth-1)); + } + } + + void tc1(int depth) { + Node tempTree = new Node(); + Populate(depth, tempTree); + tempTree = null; + } + + void tc2(int depth) { + Node tempTree = MakeTree(depth); + tempTree = null; + } + + void TimeConstruction(int depth) { + Node root; + int iNumIters = NumIters(depth); + Node tempTree; + + for (int i = 0; i < iNumIters; ++i) { + tc1(depth); + } + for (int i = 0; i < iNumIters; ++i) { + tc2(depth); + } + } + + public void stretch() { + Node root; + Node longLivedTree; + Node tempTree; + + // Stretch the memory space quickly + tempTree = MakeTree(kStretchTreeDepth); + tempTree = null; + } + + public void run() { + Node root; + Node longLivedTree; + + // Stretch the memory space quickly + stretch(); + + // Create a long lived object + longLivedTree = new Node(); + Populate(kLongLivedTreeDepth, longLivedTree); + + // Create long-lived array, filling half of it + float array[] = new float[kArraySize]; + for (int i = 0; i < kArraySize/2; ++i) { + array[i] = 1.0f/i; + } + + for (int d = kMinTreeDepth; d <= kMaxTreeDepth; d += 2) { + TimeConstruction(d); + } + + if (longLivedTree == null || array[1000] != 1.0f/1000) { + System.out.println(0xa0); + System.out.println((int)(array[1000]*1000000)); + } + } + + public static void main(String[] args) { + int threadnum = THREADNUM; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(); + tr.start(); + } + } +} // class JavaGC diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.java deleted file mode 100644 index 96a13210..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.java +++ /dev/null @@ -1,80 +0,0 @@ -package JGFMonteCarlo; - -public class AppDemoRunner extends Thread { - - public String header; - public String name; - public int startDate; - public int endDate; - public float dTime; - public int returnDefinition; - public float expectedReturnRate; - public float volatility; - public int nTimeSteps; - public float pathStartValue; - - int id, nRunsMC, group; - //ToInitAllTasks toinitalltasks; - public Vector results; - - public AppDemoRunner(int id, - int nRunsMC, - int group, - AppDemo ad - /*ToInitAllTasks initalltask*/) { - this.id = id; - this.nRunsMC=nRunsMC; - this.group = group; - this.results = new Vector(); - - //this.header = initalltask.header; - this.name = ad.name; - this.startDate = ad.startDate; - this.endDate = ad.endDate; - this.dTime = ad.dTime; - this.returnDefinition = ad.returnDefinition; - this.expectedReturnRate = ad.expectedReturnRate; - this.volatility = ad.volatility; - this.nTimeSteps = ad.nTimeStepsMC; - this.pathStartValue = ad.pathStartValue; - } - - public void run() { - // Now do the computation. - int ilow, iupper, slice; - int gp = this.group; - int index = this.id; - int nruns = this.nRunsMC; - - slice = (nruns + gp-1)/gp; - - ilow = index*slice; - iupper = (index+1)*slice; - if (index==gp-1) { - iupper=nruns; - } - - for(int iRun=ilow; iRun < iupper; iRun++ ) { - //String header="MC run "+String.valueOf(iRun); - PriceStock ps = new PriceStock(); - ps.setInitAllTasks(this); - ps.setTask(/*header, */(long)iRun*11); - ps.run(); - results.addElement(ps.getResult()); - } - } - - public static void main(String[] args) { - int datasize = 10000; //should be times of 2 - int nruns = 62 * 62; //16 * 16; - int group = 62; // 16; - - AppDemo ad = new AppDemo(datasize, nruns, group); - ad.initSerial(); - - for(int i = 0; i < group; i++) { - AppDemoRunner adr = new AppDemoRunner(i, nruns, group, ad); - adr.start(); - } - } -} \ No newline at end of file diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.p new file mode 100644 index 00000000..e62c6543 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/JGFMonteCarlo/AppDemoRunner.p @@ -0,0 +1,82 @@ +package JGFMonteCarlo; + +public class AppDemoRunner extends Thread { + + public String header; + public String name; + public int startDate; + public int endDate; + public float dTime; + public int returnDefinition; + public float expectedReturnRate; + public float volatility; + public int nTimeSteps; + public float pathStartValue; + + int id, nRunsMC, group; + //ToInitAllTasks toinitalltasks; + public Vector results; + + public AppDemoRunner(int id, + int nRunsMC, + int group, + AppDemo ad + /*ToInitAllTasks initalltask*/) { + this.id = id; + this.nRunsMC=nRunsMC; + this.group = group; + this.results = new Vector(); + + //this.header = initalltask.header; + this.name = ad.name; + this.startDate = ad.startDate; + this.endDate = ad.endDate; + this.dTime = ad.dTime; + this.returnDefinition = ad.returnDefinition; + this.expectedReturnRate = ad.expectedReturnRate; + this.volatility = ad.volatility; + this.nTimeSteps = ad.nTimeStepsMC; + this.pathStartValue = ad.pathStartValue; + } + + public void run() { + // Now do the computation. + int ilow, iupper, slice; + int gp = this.group; + int index = this.id; + int nruns = this.nRunsMC; + + slice = (nruns + gp-1)/gp; + + ilow = index*slice; + iupper = (index+1)*slice; + if (index==gp-1) { + iupper=nruns; + } + + for(int iRun=ilow; iRun < iupper; iRun++ ) { + //String header="MC run "+String.valueOf(iRun); + PriceStock ps = new PriceStock(); + ps.setInitAllTasks(this); + ps.setTask(/*header, */(long)iRun*11); + ps.run(); + results.addElement(ps.getResult()); + } + } + + public static void main(String[] args) { + int datasize = 10000; //should be times of 2 + //int nruns = 62 * 62; //16 * 16; + int group = THREADNUM; // 16; + int nruns = group * group; + + System.setgcprofileflag(); + AppDemo ad = new AppDemo(datasize, nruns, group); + ad.initSerial(); + + for(int i = 0; i < group; i++) { + AppDemoRunner adr = new AppDemoRunner(i, nruns, group, ad); + adr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.java deleted file mode 100644 index 9189df39..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.java +++ /dev/null @@ -1,46 +0,0 @@ -package MTree; - -public class TestRunner extends Thread { - - int m_index; - int m_size; - int m_nodenum; - Node m_tree; // The root of a BST - - public TestRunner(int index, - int size, - int nodenum) { - this.m_index = index; - this.m_size = size; - this.m_nodenum = nodenum; - this.m_tree = new Node(); - } - - public void run() { - // Randomly generate new (key, value) pair and insert into the tree - // If have collision, simply throw away the old node - // The tree can hold m_size nodes at most, if it has reached the - // limitation of m_size, then replace the node whose key is the - // closest to the new key. - Random rand = new Random(m_index); - while(this.m_nodenum-- > 0) { - // Generate a new (key, value) pair - int key = Math.abs(rand.nextInt()); - int value = Math.abs(rand.nextInt()); - if(this.m_tree.insert(key, value, !(this.m_size > 0))) { - // insert a new node - this.m_size--; - } - } - } - - public static void main(String[] args) { - int threadnum = 62; // 56; - int size = 40000; - int nodenum = size*10; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(i, size, nodenum); - tr.start(); - } - } -} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.p new file mode 100644 index 00000000..be5f2d4b --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/MTree/TestRunner.p @@ -0,0 +1,47 @@ +package MTree; + +public class TestRunner extends Thread { + + int m_index; + int m_size; + int m_nodenum; + Node m_tree; // The root of a BST + + public TestRunner(int index, + int size, + int nodenum) { + this.m_index = index; + this.m_size = size; + this.m_nodenum = nodenum; + this.m_tree = new Node(); + } + + public void run() { + // Randomly generate new (key, value) pair and insert into the tree + // If have collision, simply throw away the old node + // The tree can hold m_size nodes at most, if it has reached the + // limitation of m_size, then replace the node whose key is the + // closest to the new key. + Random rand = new Random(m_index); + while(this.m_nodenum-- > 0) { + // Generate a new (key, value) pair + int key = Math.abs(rand.nextInt()); + int value = Math.abs(rand.nextInt()); + if(this.m_tree.insert(key, value, !(this.m_size > 0))) { + // insert a new node + this.m_size--; + } + } + } + + public static void main(String[] args) { + int threadnum = THREADNUM; // 56; + int size = 40000; + int nodenum = size*10; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(i, size, nodenum); + tr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.java deleted file mode 100644 index 2c39a7c4..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.java +++ /dev/null @@ -1,91 +0,0 @@ -package RayTracer; - -/************************************************************************** - * * Java Grande Forum Benchmark Suite - Version 2.0 * * produced by * * Java - * Grande Benchmarking Project * * at * * Edinburgh Parallel Computing Centre * - * * email: epcc-javagrande@epcc.ed.ac.uk * * * This version copyright (c) The - * University of Edinburgh, 1999. * All rights reserved. * * - **************************************************************************/ - -public class TestRunner extends RayTracer { - - int numCore; - public int id; - - public TestRunner(int id, - int numCore, - int size, - Scene scene) { - super(); - this.id = id; - this.numCore = numCore; - this.size = size; - - // create the objects to be rendered - this.scene = scene; //createScene(); - - // set image size - width=size; - height=size; - // get lights, objects etc. from scene. - setScene(this.scene); - - numobjects = this.scene.getObjects(); - /*this.image=new int[size][]; - - // get lights, objects etc. from scene. - setScene(scene); - - numobjects = scene.getObjects();*/ - } - - public void init() { - this.image=new int[this.size/this.numCore][]; - } - - public void JGFvalidate() { - // long refval[] = {2676692,29827635}; - // long refval[] = new long[2]; - // refval[0] = 2676692; - // refval[1] = 29827635; - // long dev = checksum - refval[size]; - // if (dev != 0) { - // System.out.println("Validation failed"); - // System.out.println("Pixel checksum = " + checksum); - // System.out.println("Reference value = " + refval[size]); - // } - } - - public void JGFtidyup() { - // scene = null; - // lights = null; - // prim = null; - // tRay = null; - // inter = null; - // System.gc(); - } - - public void run() { - this.init(); - - int heightPerCore=height/numCore; - int startidx=heightPerCore * this.id; - int endidx=startidx + heightPerCore; - Interval interval = new Interval(0, width, height, startidx, endidx, 1); - render(interval); - - //System.out.println("CHECKSUM="+checksum); - - } - public static void main(String[] args) { - int threadnum = 62; // 56; - int size = threadnum * 25; - Composer comp = new Composer(threadnum, size); - RayTracer rt = new RayTracer(); - Scene scene = rt.createScene(); - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(i, threadnum, size, scene); - tr.start(); - } - } -} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.p new file mode 100644 index 00000000..e9b726ce --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/RayTracer/TestRunner.p @@ -0,0 +1,92 @@ +package RayTracer; + +/************************************************************************** + * * Java Grande Forum Benchmark Suite - Version 2.0 * * produced by * * Java + * Grande Benchmarking Project * * at * * Edinburgh Parallel Computing Centre * + * * email: epcc-javagrande@epcc.ed.ac.uk * * * This version copyright (c) The + * University of Edinburgh, 1999. * All rights reserved. * * + **************************************************************************/ + +public class TestRunner extends RayTracer { + + int numCore; + public int id; + + public TestRunner(int id, + int numCore, + int size, + Scene scene) { + super(); + this.id = id; + this.numCore = numCore; + this.size = size; + + // create the objects to be rendered + this.scene = scene; //createScene(); + + // set image size + width=size; + height=size; + // get lights, objects etc. from scene. + setScene(this.scene); + + numobjects = this.scene.getObjects(); + /*this.image=new int[size][]; + + // get lights, objects etc. from scene. + setScene(scene); + + numobjects = scene.getObjects();*/ + } + + public void init() { + this.image=new int[this.size/this.numCore][]; + } + + public void JGFvalidate() { + // long refval[] = {2676692,29827635}; + // long refval[] = new long[2]; + // refval[0] = 2676692; + // refval[1] = 29827635; + // long dev = checksum - refval[size]; + // if (dev != 0) { + // System.out.println("Validation failed"); + // System.out.println("Pixel checksum = " + checksum); + // System.out.println("Reference value = " + refval[size]); + // } + } + + public void JGFtidyup() { + // scene = null; + // lights = null; + // prim = null; + // tRay = null; + // inter = null; + // System.gc(); + } + + public void run() { + this.init(); + + int heightPerCore=height/numCore; + int startidx=heightPerCore * this.id; + int endidx=startidx + heightPerCore; + Interval interval = new Interval(0, width, height, startidx, endidx, 1); + render(interval); + + //System.out.println("CHECKSUM="+checksum); + + } + public static void main(String[] args) { + int threadnum = THREADNUM; // 56; + int size = threadnum * 25; + System.setgcprofileflag(); + Composer comp = new Composer(threadnum, size); + RayTracer rt = new RayTracer(); + Scene scene = rt.createScene(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(i, threadnum, size, scene); + tr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.java deleted file mode 100644 index de3ffcbd..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.java +++ /dev/null @@ -1,125 +0,0 @@ -package bh; -/*import java.util.Enumeration; -import java.lang.Math;*/ - -/** - * A Java implementation of the bh Olden benchmark. - * The Olden benchmark implements the Barnes-Hut benchmark - * that is decribed in : - *

- * J. Barnes and P. Hut, "A hierarchical o(NlogN) force-calculation algorithm", - * Nature, 324:446-449, Dec. 1986 - * - *

- * The original code in the Olden benchmark suite is derived from the - * - * source distributed by Barnes. - **/ -public class TestRunner extends Thread -{ - - /** - * The user specified number of bodies to create. - **/ - public int nbody; // = 0; - - /** - * The maximum number of time steps to take in the simulation - **/ - public int nsteps; // = 10; - - /** - * Should we print information messsages - **/ - //private static boolean printMsgs = false; - /** - * Should we print detailed results - **/ - //private static boolean printResults = false; - - public double DTIME; // = 0.0125; - public double TSTOP; // = 2.0; - - public TestRunner(int nbody) { - this.nbody = nbody; - this.nsteps = 10; - this.DTIME = 0.0125; - this.TSTOP = 2.0; - } - - public void run() - { - //parseCmdLine(args); - - /*if (printMsgs) - System.out.println("nbody = " + nbody);*/ - - //long start0 = System.currentTimeMillis(); - Tree root = new Tree(this.DTIME); - root.createTestData(nbody); - /*long end0 = System.currentTimeMillis(); - if (printMsgs) - System.out.println("Bodies created"); - - long start1 = System.currentTimeMillis();*/ - double tnow = 0.0; - int i = 0; - while ((tnow < (TSTOP + 0.1f*DTIME)) && (i < nsteps)) { - root.stepSystem(i++); - tnow += DTIME; - } - /*long end1 = System.currentTimeMillis(); - - if (printResults) { - int j = 0; - for (Enumeration e = root.bodies(); e.hasMoreElements(); ) { - Body b = (Body)e.nextElement(); - System.out.println("body " + j++ + " -- " + b.pos); - } - } - - if (printMsgs) { - System.out.println("Build Time " + (end0 - start0)/1000.0); - System.out.println("Compute Time " + (end1 - start1)/1000.0); - System.out.println("Total Time " + (end1 - start0)/1000.0); - } - System.out.println("Done!");*/ - } - - /** - * Random number generator used by the orignal BH benchmark. - * @param seed the seed to the generator - * @return a random number - **/ - public double myRand(double seed) - { - double t = 16807.0*seed + 1; - - seed = t - 2147483647.0 * Math.floor(t / 2147483647.0f); - return seed; - } - - /** - * Generate a doubleing point random number. Used by - * the original BH benchmark. - * - * @param xl lower bound - * @param xh upper bound - * @param r seed - * @return a doubleing point randon number - **/ - public double xRand(double xl, double xh, double r) - { - double res = xl + (xh-xl)*r/2147483647.0; - return res; - } - - public static void main(String[] args) { - int threadnum = 62; - int nbody = 700; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(nbody); - tr.start(); - } - } -} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.p new file mode 100644 index 00000000..9db00d0e --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/bh/TestRunner.p @@ -0,0 +1,126 @@ +package bh; +/*import java.util.Enumeration; +import java.lang.Math;*/ + +/** + * A Java implementation of the bh Olden benchmark. + * The Olden benchmark implements the Barnes-Hut benchmark + * that is decribed in : + *

+ * J. Barnes and P. Hut, "A hierarchical o(NlogN) force-calculation algorithm", + * Nature, 324:446-449, Dec. 1986 + * + *

+ * The original code in the Olden benchmark suite is derived from the + * + * source distributed by Barnes. + **/ +public class TestRunner extends Thread +{ + + /** + * The user specified number of bodies to create. + **/ + public int nbody; // = 0; + + /** + * The maximum number of time steps to take in the simulation + **/ + public int nsteps; // = 10; + + /** + * Should we print information messsages + **/ + //private static boolean printMsgs = false; + /** + * Should we print detailed results + **/ + //private static boolean printResults = false; + + public double DTIME; // = 0.0125; + public double TSTOP; // = 2.0; + + public TestRunner(int nbody) { + this.nbody = nbody; + this.nsteps = 10; + this.DTIME = 0.0125; + this.TSTOP = 2.0; + } + + public void run() + { + //parseCmdLine(args); + + /*if (printMsgs) + System.out.println("nbody = " + nbody);*/ + + //long start0 = System.currentTimeMillis(); + Tree root = new Tree(this.DTIME); + root.createTestData(nbody); + /*long end0 = System.currentTimeMillis(); + if (printMsgs) + System.out.println("Bodies created"); + + long start1 = System.currentTimeMillis();*/ + double tnow = 0.0; + int i = 0; + while ((tnow < (TSTOP + 0.1f*DTIME)) && (i < nsteps)) { + root.stepSystem(i++); + tnow += DTIME; + } + /*long end1 = System.currentTimeMillis(); + + if (printResults) { + int j = 0; + for (Enumeration e = root.bodies(); e.hasMoreElements(); ) { + Body b = (Body)e.nextElement(); + System.out.println("body " + j++ + " -- " + b.pos); + } + } + + if (printMsgs) { + System.out.println("Build Time " + (end0 - start0)/1000.0); + System.out.println("Compute Time " + (end1 - start1)/1000.0); + System.out.println("Total Time " + (end1 - start0)/1000.0); + } + System.out.println("Done!");*/ + } + + /** + * Random number generator used by the orignal BH benchmark. + * @param seed the seed to the generator + * @return a random number + **/ + public double myRand(double seed) + { + double t = 16807.0*seed + 1; + + seed = t - 2147483647.0 * Math.floor(t / 2147483647.0f); + return seed; + } + + /** + * Generate a doubleing point random number. Used by + * the original BH benchmark. + * + * @param xl lower bound + * @param xh upper bound + * @param r seed + * @return a doubleing point randon number + **/ + public double xRand(double xl, double xh, double r) + { + double res = xl + (xh-xl)*r/2147483647.0; + return res; + } + + public static void main(String[] args) { + int threadnum = THREADNUM; + int nbody = 700; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(nbody); + tr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.java deleted file mode 100644 index 9a91b4cc..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.java +++ /dev/null @@ -1,248 +0,0 @@ -package lcss; - -public class TestRunner extends Thread { - - int[] testargs; - - public TestRunner(int[] args) { - this.testargs = args; - } - - private Vector algb2(int x, - int p, - int q, - Vector ys, - Vector yst, - Vector yst1) { - Vector result = null; - if(ys.size() == 0) { - // algb2 _ _ [] = [] - result = new Vector(); - } else { - // algb2 k0j1 k1j1 ((y,k0j):ys) - int y = ((Integer)ys.elementAt(0)).intValue(); - int yt = ((Integer)yst.elementAt(0)).intValue(); - Vector ys2 = new Vector(); - for(int i = 1; i < ys.size(); i++) { - ys2.addElement(ys.elementAt(i)); - } - Vector yst2 = new Vector(); - for(int i = 1; i < yst.size(); i++) { - yst2.addElement(yst.elementAt(i)); - } - - // = let kjcurr = if x == y then k0j1+1 else max k1j1 k0j - // in (y,kjcurr) : algb2 k0j kjcurr ys - int k = 0; - if(x == y) { - k = p + 1; - } else { - k = (q > yt) ? q : yt; - } - result = this.algb2(x, yt, k, ys2, yst2, yst1); - result.insertElementAt(new Integer(y), 0); - yst1.insertElementAt(new Integer(k), 0); - } - return result; - } - - private Vector algb1(Vector xs, - Vector ys, - Vector yst) { - Vector result = null; - if(xs.size() == 0) { - // algb1 [] ys' = map snd ys' - result = yst; - } else { - // algb1 (x:xs) ys' - // = algb1 xs (algb2 0 0 ys') - int x = ((Integer)xs.elementAt(0)).intValue(); - Vector xs1 = new Vector(); - for(int i = 1; i < xs.size(); i++) { - xs1.addElement(xs.elementAt(i)); - } - - Vector yst1 = new Vector(); - Vector ys1 = this.algb2(x, 0, 0, ys, yst, yst1); - - result = this.algb1(xs1, ys1, yst1); - } - return result; - } - - private Vector algb(Vector xs, - Vector ys) { - // algb xs ys - // = 0 : algb1 xs [ (y,0) | y <- ys ] - Vector yst = new Vector(); - for(int i = 0; i < ys.size(); i++) { - yst.addElement(new Integer(0)); - } - Vector result = this.algb1(xs, ys, yst); - result.insertElementAt(new Integer(0), 0); - return result; - } - - private int findk(int k, - int km, - int m, - Vector v, - Vector vt) { - int result = 0; - if(v.size() == 0) { - // findk k km m [] = km - result = km; - } else { - // findk k km m ((x,y):xys) - int x = ((Integer)v.elementAt(0)).intValue(); - int y = ((Integer)vt.elementAt(0)).intValue(); - Vector v1 = new Vector(); - for(int i = 1; i < v.size(); i++) { - v1.addElement(v.elementAt(i)); - } - Vector vt1 = new Vector(); - for(int i = 1; i < vt.size(); i++) { - vt1.addElement(vt.elementAt(i)); - } - - if(x + y >= m) { - // | x+y >= m = findk (k+1) k (x+y) xys - result = this.findk(k+1, k, x+y, v1, vt1); - } else { - // | otherwise = findk (k+1) km m xys - result = this.findk(k+1, km, m, v1, vt1); - } - } - return result; - } - - private Vector algc(int m, - int n, - Vector xs, - Vector ys, - Vector r) { - Vector result = null; - if(ys.size() == 0) { - // algc m n xs [] = id - result = r; - } else if(xs.size() == 1) { - // algc m n [x] ys = if x `elem` ys then (x:) else id - result = r; - - int x = ((Integer)xs.elementAt(0)).intValue(); - // if x `elem` ys - boolean iscontains = false; - for(int i = 0; i < ys.size(); i++) { - if(((Integer)ys.elementAt(i)).intValue() == x) { - iscontains = true; - i = ys.size(); // break; - } - } - if(iscontains) { - // then (x:) - r.insertElementAt(new Integer(x), 0); - } - } else { - // algc m n xs ys - // = algc m2 k xs1 (take k ys) . algc (m-m2) (n-k) xs2 (drop k ys) - // where - // m2 = m `div` 2 - int m2 = m/2; - - // xs1 = take m2 xs - Vector xs1 = new Vector(); - int i = 0; - for(i = 0; i < m2; i++) { - xs1.addElement(xs.elementAt(i)); - } - - // xs2 = drop m2 xs - Vector xs2 = new Vector(); - for(; i < xs.size(); i++) { - xs2.addElement(xs.elementAt(i)); - } - - // l1 = algb xs1 ys - Vector l1 = this.algb(xs1, ys); - - // l2 = reverse (algb (reverse xs2) (reverse ys)) - Vector rxs2 = new Vector(); - for(i = xs2.size(); i > 0; i--) { - rxs2.addElement(xs2.elementAt(i - 1)); - } - Vector rys = new Vector(); - for(i = ys.size(); i > 0; i--) { - rys.addElement(ys.elementAt(i - 1)); - } - Vector rl2 = algb(rxs2, rys); - Vector l2 = new Vector(); - for(i = rl2.size(); i > 0; i--) { - l2.addElement(rl2.elementAt(i - 1)); - } - - // k = findk 0 0 (-1) (zip l1 l2) - int k = this.findk(0, 0, (-1), l1, l2); - - // algc m n xs ys - // = algc m2 k xs1 (take k ys) . algc (m-m2) (n-k) xs2 (drop k ys) - Vector ysk = new Vector(); - // (take k ys) - for(i = 0; i < k; i++) { - ysk.addElement(ys.elementAt(i)); - } - Vector ysd = new Vector(); - // (drop k ys) - for(; i < ys.size(); i++) { - ysd.addElement(ys.elementAt(i)); - } - Vector interresult = this.algc(m-m2, n-k, xs2, ysd, r); - result = this.algc(m2, k, xs1, ysk, interresult); - } - return result; - } - - public void run() { - Vector xs = new Vector(); - Vector ys = new Vector(); - - int x1 = this.testargs[0]; - int x2 = this.testargs[1]; - int xfinal = this.testargs[2]; - int xdelta = x2-x1; - int y1 = this.testargs[3]; - int y2 = this.testargs[4]; - int yfinal = this.testargs[5]; - int ydelta = y2-y1; - xs.addElement(new Integer(x1)); - for(int i = x2; i <= xfinal; ) { - xs.addElement(new Integer(i)); - i += xdelta; - } - ys.addElement(new Integer(y1)); - for(int i = y2; i <= yfinal; ) { - ys.addElement(new Integer(i)); - i += ydelta; - } - - Vector r = new Vector(); - - Vector result = this.algc(xs.size(), ys.size(), xs, ys, r); - for(int i = 0; i < result.size(); i++) { - int tmp = ((Integer)result.elementAt(i)).intValue(); - } - } - public static void main(String argv[]){ - int threadnum = 62; - int[] args = new int[6]; - args[0] = 1; - args[1] = 2; - args[2] = 160; - args[3] = 80; - args[4] = 81; - args[5] = 240; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(args); - tr.start(); - } - } -} \ No newline at end of file diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.p new file mode 100644 index 00000000..894b9117 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/lcss/TestRunner.p @@ -0,0 +1,249 @@ +package lcss; + +public class TestRunner extends Thread { + + int[] testargs; + + public TestRunner(int[] args) { + this.testargs = args; + } + + private Vector algb2(int x, + int p, + int q, + Vector ys, + Vector yst, + Vector yst1) { + Vector result = null; + if(ys.size() == 0) { + // algb2 _ _ [] = [] + result = new Vector(); + } else { + // algb2 k0j1 k1j1 ((y,k0j):ys) + int y = ((Integer)ys.elementAt(0)).intValue(); + int yt = ((Integer)yst.elementAt(0)).intValue(); + Vector ys2 = new Vector(); + for(int i = 1; i < ys.size(); i++) { + ys2.addElement(ys.elementAt(i)); + } + Vector yst2 = new Vector(); + for(int i = 1; i < yst.size(); i++) { + yst2.addElement(yst.elementAt(i)); + } + + // = let kjcurr = if x == y then k0j1+1 else max k1j1 k0j + // in (y,kjcurr) : algb2 k0j kjcurr ys + int k = 0; + if(x == y) { + k = p + 1; + } else { + k = (q > yt) ? q : yt; + } + result = this.algb2(x, yt, k, ys2, yst2, yst1); + result.insertElementAt(new Integer(y), 0); + yst1.insertElementAt(new Integer(k), 0); + } + return result; + } + + private Vector algb1(Vector xs, + Vector ys, + Vector yst) { + Vector result = null; + if(xs.size() == 0) { + // algb1 [] ys' = map snd ys' + result = yst; + } else { + // algb1 (x:xs) ys' + // = algb1 xs (algb2 0 0 ys') + int x = ((Integer)xs.elementAt(0)).intValue(); + Vector xs1 = new Vector(); + for(int i = 1; i < xs.size(); i++) { + xs1.addElement(xs.elementAt(i)); + } + + Vector yst1 = new Vector(); + Vector ys1 = this.algb2(x, 0, 0, ys, yst, yst1); + + result = this.algb1(xs1, ys1, yst1); + } + return result; + } + + private Vector algb(Vector xs, + Vector ys) { + // algb xs ys + // = 0 : algb1 xs [ (y,0) | y <- ys ] + Vector yst = new Vector(); + for(int i = 0; i < ys.size(); i++) { + yst.addElement(new Integer(0)); + } + Vector result = this.algb1(xs, ys, yst); + result.insertElementAt(new Integer(0), 0); + return result; + } + + private int findk(int k, + int km, + int m, + Vector v, + Vector vt) { + int result = 0; + if(v.size() == 0) { + // findk k km m [] = km + result = km; + } else { + // findk k km m ((x,y):xys) + int x = ((Integer)v.elementAt(0)).intValue(); + int y = ((Integer)vt.elementAt(0)).intValue(); + Vector v1 = new Vector(); + for(int i = 1; i < v.size(); i++) { + v1.addElement(v.elementAt(i)); + } + Vector vt1 = new Vector(); + for(int i = 1; i < vt.size(); i++) { + vt1.addElement(vt.elementAt(i)); + } + + if(x + y >= m) { + // | x+y >= m = findk (k+1) k (x+y) xys + result = this.findk(k+1, k, x+y, v1, vt1); + } else { + // | otherwise = findk (k+1) km m xys + result = this.findk(k+1, km, m, v1, vt1); + } + } + return result; + } + + private Vector algc(int m, + int n, + Vector xs, + Vector ys, + Vector r) { + Vector result = null; + if(ys.size() == 0) { + // algc m n xs [] = id + result = r; + } else if(xs.size() == 1) { + // algc m n [x] ys = if x `elem` ys then (x:) else id + result = r; + + int x = ((Integer)xs.elementAt(0)).intValue(); + // if x `elem` ys + boolean iscontains = false; + for(int i = 0; i < ys.size(); i++) { + if(((Integer)ys.elementAt(i)).intValue() == x) { + iscontains = true; + i = ys.size(); // break; + } + } + if(iscontains) { + // then (x:) + r.insertElementAt(new Integer(x), 0); + } + } else { + // algc m n xs ys + // = algc m2 k xs1 (take k ys) . algc (m-m2) (n-k) xs2 (drop k ys) + // where + // m2 = m `div` 2 + int m2 = m/2; + + // xs1 = take m2 xs + Vector xs1 = new Vector(); + int i = 0; + for(i = 0; i < m2; i++) { + xs1.addElement(xs.elementAt(i)); + } + + // xs2 = drop m2 xs + Vector xs2 = new Vector(); + for(; i < xs.size(); i++) { + xs2.addElement(xs.elementAt(i)); + } + + // l1 = algb xs1 ys + Vector l1 = this.algb(xs1, ys); + + // l2 = reverse (algb (reverse xs2) (reverse ys)) + Vector rxs2 = new Vector(); + for(i = xs2.size(); i > 0; i--) { + rxs2.addElement(xs2.elementAt(i - 1)); + } + Vector rys = new Vector(); + for(i = ys.size(); i > 0; i--) { + rys.addElement(ys.elementAt(i - 1)); + } + Vector rl2 = algb(rxs2, rys); + Vector l2 = new Vector(); + for(i = rl2.size(); i > 0; i--) { + l2.addElement(rl2.elementAt(i - 1)); + } + + // k = findk 0 0 (-1) (zip l1 l2) + int k = this.findk(0, 0, (-1), l1, l2); + + // algc m n xs ys + // = algc m2 k xs1 (take k ys) . algc (m-m2) (n-k) xs2 (drop k ys) + Vector ysk = new Vector(); + // (take k ys) + for(i = 0; i < k; i++) { + ysk.addElement(ys.elementAt(i)); + } + Vector ysd = new Vector(); + // (drop k ys) + for(; i < ys.size(); i++) { + ysd.addElement(ys.elementAt(i)); + } + Vector interresult = this.algc(m-m2, n-k, xs2, ysd, r); + result = this.algc(m2, k, xs1, ysk, interresult); + } + return result; + } + + public void run() { + Vector xs = new Vector(); + Vector ys = new Vector(); + + int x1 = this.testargs[0]; + int x2 = this.testargs[1]; + int xfinal = this.testargs[2]; + int xdelta = x2-x1; + int y1 = this.testargs[3]; + int y2 = this.testargs[4]; + int yfinal = this.testargs[5]; + int ydelta = y2-y1; + xs.addElement(new Integer(x1)); + for(int i = x2; i <= xfinal; ) { + xs.addElement(new Integer(i)); + i += xdelta; + } + ys.addElement(new Integer(y1)); + for(int i = y2; i <= yfinal; ) { + ys.addElement(new Integer(i)); + i += ydelta; + } + + Vector r = new Vector(); + + Vector result = this.algc(xs.size(), ys.size(), xs, ys, r); + for(int i = 0; i < result.size(); i++) { + int tmp = ((Integer)result.elementAt(i)).intValue(); + } + } + public static void main(String argv[]){ + int threadnum = THREADNUM; + int[] args = new int[6]; + args[0] = 1; + args[1] = 2; + args[2] = 160; + args[3] = 80; + args[4] = 81; + args[5] = 240; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(args); + tr.start(); + } + } +} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.java deleted file mode 100644 index ce70adc4..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.java +++ /dev/null @@ -1,115 +0,0 @@ -package tsp; - -//import java.io.*; - -/** - * A Java implementation of the tsp Olden benchmark, the traveling - * salesman problem. - *

- * - * R. Karp, "Probabilistic analysis of partitioning algorithms for the - * traveling-salesman problem in the plane." Mathematics of Operations Research - * 2(3):209-224, August 1977 - * - **/ -public class TestRunner extends Thread -{ - - /** - * Number of cities in the problem. - **/ - public int cities; - /** - * Set to true if the result should be printed - **/ - //private static boolean printResult = false; - /** - * Set to true to print informative messages - **/ - //private static boolean printMsgs = false; - - public TestRunner(int cities) { - this.cities = cities; - } - - /** - * The main routine which creates a tree and traverses it. - * @param args the arguments to the program - **/ - public void run() - { - /*parseCmdLine(args); - - if (printMsgs) - System.out.println("Building tree of size " + cities); - - long start0 = System.currentTimeMillis();*/ - Tree_tsp t = Tree_tsp.buildTree(this.cities, false, 0.0f, 1.0f, 0.0f, 1.0f); - /*long end0 = System.currentTimeMillis(); - - long start1 = System.currentTimeMillis();*/ - t.tsp(150); - /*long end1 = System.currentTimeMillis(); - - if (printResult) { - // if the user specifies, print the final result - t.printVisitOrder(); - } - - if (printMsgs) { - System.out.println("Tsp build time " + (end0 - start0)/1000.0); - System.out.println("Tsp time " + (end1 - start1)/1000.0); - System.out.println("Tsp total time " + (end1 - start0)/1000.0); - } - System.out.println("Done!");*/ - } - - /** - * Parse the command line options. - * @param args the command line options. - **/ - /*private static final void parseCmdLine(String args[]) - { - int i = 0; - String arg; - - while (i < args.length && args[i].startsWith("-")) { - arg = args[i++]; - - if (arg.equals("-c")) { - if (i < args.length) - cities = new Integer(args[i++]).intValue(); - else throw new Error("-c requires the size of tree"); - } else if (arg.equals("-p")) { - printResult = true; - } else if (arg.equals("-m")) { - printMsgs = true; - } else if (arg.equals("-h")) { - usage(); - } - } - if (cities == 0) usage(); - }*/ - - /** - * The usage routine which describes the program options. - **/ - /*private static final void usage() - { - System.err.println("usage: java TSP -c [-p] [-m] [-h]"); - System.err.println(" -c number of cities (rounds up to the next power of 2 minus 1)"); - System.err.println(" -p (print the final result)"); - System.err.println(" -m (print informative messages)"); - System.err.println(" -h (print this message)"); - System.exit(0); - }*/ - public static void main(String[] args) { - int threadnum = 62; - int ncities = 4080*2; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(ncities); - tr.start(); - } - } -} - diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.p new file mode 100644 index 00000000..f6701483 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/tsp/TestRunner.p @@ -0,0 +1,116 @@ +package tsp; + +//import java.io.*; + +/** + * A Java implementation of the tsp Olden benchmark, the traveling + * salesman problem. + *

+ * + * R. Karp, "Probabilistic analysis of partitioning algorithms for the + * traveling-salesman problem in the plane." Mathematics of Operations Research + * 2(3):209-224, August 1977 + * + **/ +public class TestRunner extends Thread +{ + + /** + * Number of cities in the problem. + **/ + public int cities; + /** + * Set to true if the result should be printed + **/ + //private static boolean printResult = false; + /** + * Set to true to print informative messages + **/ + //private static boolean printMsgs = false; + + public TestRunner(int cities) { + this.cities = cities; + } + + /** + * The main routine which creates a tree and traverses it. + * @param args the arguments to the program + **/ + public void run() + { + /*parseCmdLine(args); + + if (printMsgs) + System.out.println("Building tree of size " + cities); + + long start0 = System.currentTimeMillis();*/ + Tree_tsp t = Tree_tsp.buildTree(this.cities, false, 0.0f, 1.0f, 0.0f, 1.0f); + /*long end0 = System.currentTimeMillis(); + + long start1 = System.currentTimeMillis();*/ + t.tsp(150); + /*long end1 = System.currentTimeMillis(); + + if (printResult) { + // if the user specifies, print the final result + t.printVisitOrder(); + } + + if (printMsgs) { + System.out.println("Tsp build time " + (end0 - start0)/1000.0); + System.out.println("Tsp time " + (end1 - start1)/1000.0); + System.out.println("Tsp total time " + (end1 - start0)/1000.0); + } + System.out.println("Done!");*/ + } + + /** + * Parse the command line options. + * @param args the command line options. + **/ + /*private static final void parseCmdLine(String args[]) + { + int i = 0; + String arg; + + while (i < args.length && args[i].startsWith("-")) { + arg = args[i++]; + + if (arg.equals("-c")) { + if (i < args.length) + cities = new Integer(args[i++]).intValue(); + else throw new Error("-c requires the size of tree"); + } else if (arg.equals("-p")) { + printResult = true; + } else if (arg.equals("-m")) { + printMsgs = true; + } else if (arg.equals("-h")) { + usage(); + } + } + if (cities == 0) usage(); + }*/ + + /** + * The usage routine which describes the program options. + **/ + /*private static final void usage() + { + System.err.println("usage: java TSP -c [-p] [-m] [-h]"); + System.err.println(" -c number of cities (rounds up to the next power of 2 minus 1)"); + System.err.println(" -p (print the final result)"); + System.err.println(" -m (print informative messages)"); + System.err.println(" -h (print this message)"); + System.exit(0); + }*/ + public static void main(String[] args) { + int threadnum = THREADNUM; + int ncities = 4080*2; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(ncities); + tr.start(); + } + } +} + diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.java b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.java deleted file mode 100644 index 52de99ca..00000000 --- a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.java +++ /dev/null @@ -1,54 +0,0 @@ -package voronoi; - -/** - * - * A Java implementation of the voronoi Olden benchmark. Voronoi - * generates a random set of points and computes a Voronoi diagram for - * the points. - *

- * - * L. Guibas and J. Stolfi. "General Subdivisions and Voronoi Diagrams" - * ACM Trans. on Graphics 4(2):74-123, 1985. - * - *

- * The Java version of voronoi (slightly) differs from the C version - * in several ways. The C version allocates an array of 4 edges and - * uses pointer addition to implement quick rotate operations. The - * Java version does not use pointer addition to implement these - * operations. - **/ -public class TestRunner extends Thread -{ - - /** - * The number of points in the diagram - **/ - private int points; - - public TestRunner(int npoints) { - this.points = npoints; - } - - /** - * The main routine which creates the points and then performs - * the delaunay triagulation. - * @param args the command line parameters - **/ - public void run() - { - Vertex v = new Vertex(); - v.seed = 1023; - Vertex extra = v.createPoints(1, new MyDouble(1.0f), points); - Vertex point = v.createPoints(points-1, new MyDouble(extra.X()), points-1); - Edge edge = point.buildDelaunayTriangulation(extra); - } - - public static void main(String[] args) { - int threadnum = 62; - int npoints = 32000; - for(int i = 0; i < threadnum; ++i) { - TestRunner tr = new TestRunner(npoints); - tr.start(); - } - } -} diff --git a/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.p b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.p new file mode 100644 index 00000000..8d2f3871 --- /dev/null +++ b/Robust/src/Benchmarks/Scheduling/GC/NON_BAMBOO/voronoi/TestRunner.p @@ -0,0 +1,55 @@ +package voronoi; + +/** + * + * A Java implementation of the voronoi Olden benchmark. Voronoi + * generates a random set of points and computes a Voronoi diagram for + * the points. + *

+ * + * L. Guibas and J. Stolfi. "General Subdivisions and Voronoi Diagrams" + * ACM Trans. on Graphics 4(2):74-123, 1985. + * + *

+ * The Java version of voronoi (slightly) differs from the C version + * in several ways. The C version allocates an array of 4 edges and + * uses pointer addition to implement quick rotate operations. The + * Java version does not use pointer addition to implement these + * operations. + **/ +public class TestRunner extends Thread +{ + + /** + * The number of points in the diagram + **/ + private int points; + + public TestRunner(int npoints) { + this.points = npoints; + } + + /** + * The main routine which creates the points and then performs + * the delaunay triagulation. + * @param args the command line parameters + **/ + public void run() + { + Vertex v = new Vertex(); + v.seed = 1023; + Vertex extra = v.createPoints(1, new MyDouble(1.0f), points); + Vertex point = v.createPoints(points-1, new MyDouble(extra.X()), points-1); + Edge edge = point.buildDelaunayTriangulation(extra); + } + + public static void main(String[] args) { + int threadnum = THREADNUM; + int npoints = 32000; + System.setgcprofileflag(); + for(int i = 0; i < threadnum; ++i) { + TestRunner tr = new TestRunner(npoints); + tr.start(); + } + } +} diff --git a/Robust/src/Runtime/bamboo/multicorehelper.c b/Robust/src/Runtime/bamboo/multicorehelper.c index 43f619f1..abf28159 100644 --- a/Robust/src/Runtime/bamboo/multicorehelper.c +++ b/Robust/src/Runtime/bamboo/multicorehelper.c @@ -74,8 +74,49 @@ unsigned int gc_block2core[64] = { 3, 7, 11, 15, 19, 23, 27, 31, 30, 26, 22, 18, 14, 10, 6, 2, 1, 5, 9, 13, 17, 21, 25, 29, 28, 24, 20, 16, 12, 8, 4, 0 }; +#elif defined GC_40 +// NUMCORES4GC = 40 +unsigned int gc_core2block[80] = { + 0,79, 15,64, 16,63, 31,48, 32,47, + 1,78, 14,65, 17,62, 30,49, 33,46, + 2,77, 13,66, 18,61, 29,50, 34,45, + 3,76, 12,67, 19,60, 28,51, 35,44, + 4,75, 11,68, 20,59, 27,52, 36,43, + 5,74, 10,69, 21,58, 26,53, 37,42, + 6,73, 9,70, 22,57, 25,54, 38,41, + 7,72, 8,71, 23,56, 24,55, 39,40 +}; + +unsigned int gc_block2core[80] = { + 0, 5, 10, 15, 20, 25, 30, 35, 36, 31, 26, 21, 16, 11, 6, 1, + 2, 7, 12, 17, 22, 27, 32, 37, 38, 33, 28, 23, 18, 13, 8, 3, + 4, 9, 14, 19, 24, 29, 34, 39, 39, 34, 29, 24, 19, 14, 9, 4, + 3, 8, 13, 18, 23, 28, 33, 38, 37, 32, 27, 22, 17, 12, 7, 2, + 1, 6, 11, 16, 21, 26, 31, 36, 35, 30, 25, 20, 15, 10, 5, 0 +}; +#elif defined GC_44 +// NUMCORES4GC = 44 +unsigned int gc_core2block[88] = { + 0,87, 15,72, 16,71, 31,56, 32,55, 43,44, + 1,86, 14,73, 17,70, 30,57, 33,54, 42,45, + 2,85, 13,74, 18,69, 29,58, 34,53, 41,46, + 3,84, 12,75, 19,68, 28,59, 35,52, 40,47 + 4,83, 11,76, 20,67, 27,60, 36,51, + 5,82, 10,77, 21,66, 26,61, 37,50, + 6,81, 9,78, 22,65, 25,62, 38,49, + 7,80, 8,79, 23,64, 24,63, 39,48 +}; + +unsigned int gc_block2core[96] = { + 0, 6, 12, 18, 24, 29, 34, 39, 40, 35, 30, 25, 19, 13, 7, 1, + 2, 8, 14, 20, 26, 31, 38, 44, 45, 39, 33, 27, 21, 15, 9, 3, + 4, 10, 16, 22, 28, 34, 40, 46, 47, 41, 35, 29, 23, 17, 11, 5, + 5, 11, 17, 23, 29, 35, 41, 47, 46, 40, 34, 28, 22, 16, 10, 4, + 3, 9, 15, 21, 27, 33, 39, 45, 44, 38, 32, 26, 20, 14, 8, 2, + 1, 7, 13, 19, 25, 31, 37, 43, 42, 36, 30, 24, 18, 12, 6, 0 +}; #elif defined GC_48 -// NUMCORES4GC = 50 +// NUMCORES4GC = 48 unsigned int gc_core2block[96] = { 0,95, 15,80, 16,79, 31,64, 32,63, 47,48, 1,94, 14,81, 17,78, 30,65, 33,62, 46,49, diff --git a/Robust/src/Runtime/bamboo/multicoremem.h b/Robust/src/Runtime/bamboo/multicoremem.h index 21fb53df..585a2d93 100644 --- a/Robust/src/Runtime/bamboo/multicoremem.h +++ b/Robust/src/Runtime/bamboo/multicoremem.h @@ -21,83 +21,12 @@ #endif // MULTICORE_GC #endif // TILERA_BME -#ifdef BAMBOO_MEMPROF -#define GC_BAMBOO_NUMCORES 56 -#else -#ifdef MGC -#define GC_BAMBOO_NUMCORES (NUMCORES) -#else -#define GC_BAMBOO_NUMCORES 62 -#endif -#endif - #define BAMBOO_SHARED_RUNTIME_PAGE_SIZE ((unsigned int)(1<<24)) //16M -#define BAMBOO_PAGE_SIZE ((unsigned int)(64 * 1024)) // 64K -#define BAMBOO_PAGE_SIZE_BITS (16) -#ifdef GC_LARGEPAGESIZE -#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024)) -#define BAMBOO_PAGE_SIZE_BITS (18) -#elif defined GC_LARGEPAGESIZE2 -#define BAMBOO_PAGE_SIZE ((unsigned int)(4 * 64 * 1024)) // 64K -#define BAMBOO_PAGE_SIZE_BITS (18) -#endif - -#ifdef GC_DEBUG -#include "structdefs.h" -#define BAMBOO_NUM_BLOCKS (NUMCORES4GC*(2+3)) -#define BAMBOO_PAGE_SIZE (64 * 64) -#define BAMBOO_PAGE_SIZE_BITS (12) -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) *(BAMBOO_NUM_BLOCKS))) - -#elif defined GC_CACHE_ADAPT -#ifdef GC_LARGESHAREDHEAP -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+24))) -#elif defined MGC -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*72)) // 72M per core -#else -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+14))) -#endif -#ifdef GC_LARGEPAGESIZE -#define BAMBOO_SMEM_SIZE ((unsigned int)(4 * (BAMBOO_PAGE_SIZE))) -#elif defined GC_SMALLPAGESIZE -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#elif defined GC_SMALLPAGESIZE2 -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#elif defined GC_LARGEPAGESIZE2 -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#elif defined MGC -#define BAMBOO_SMEM_SIZE ((unsigned int)(16*(BAMBOO_PAGE_SIZE))) // 1M -#else -#define BAMBOO_SMEM_SIZE ((unsigned int)(4 * (BAMBOO_PAGE_SIZE))) -#endif // GC_LARGEPAGESIZE +// include the header file that defines the BAMBOO_NUM_BLOCKS, BAMBOO_PAGE_SIZE, BAMBOO_PAGE_SIZE_BITS and BAMBOO_SMEM_SIZE +#include "multicorememsize.h" #define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) * (BAMBOO_NUM_BLOCKS))) -#else // GC_DEBUG -#ifdef GC_LARGESHAREDHEAP -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+5))) -#elif defined MGC -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*72)) // 72M per core -#else -#define BAMBOO_NUM_BLOCKS ((unsigned int)((GC_BAMBOO_NUMCORES)*(2+2))) //(15 * 1024) //(64 * 4 * 0.75) //(1024 * 1024 * 3.5) 3G -#endif -#ifdef GC_LARGEPAGESIZE -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE*16)) -#elif defined GC_SMALLPAGESIZE -#define BAMBOO_PAGE_SIZE ((unsigned int)(256 * 1024)) // (4096) -#define BAMBOO_PAGE_SIZE_BITS (18) -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#elif defined GC_SMALLPAGESIZE2 -#define BAMBOO_PAGE_SIZE ((unsigned int)(256 * 1024)) // (4096) 64 -#define BAMBOO_PAGE_SIZE_BITS (18) -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE)) -#else -#define BAMBOO_SMEM_SIZE ((unsigned int)(BAMBOO_PAGE_SIZE*16)) -#endif // GC_LARGEPAGESIZE -#define BAMBOO_SHARED_MEM_SIZE ((unsigned int)((BAMBOO_SMEM_SIZE) * (BAMBOO_NUM_BLOCKS))) //(1024 * 1024 * 240) //((unsigned long long int)(3.0 * 1024 * 1024 * 1024)) // 3G -#endif // GC_DEBUG - #if defined(MULTICORE_GC)||defined(PMC_GC) #if defined(GC_SMALLPAGESIZE)||defined(PMC_GC) // memory for globals