Fixed issues with compilation.
[IRC.git] / Robust / src / Benchmarks / Scheduling / GC / NON_BAMBOO / RayTracer / TestRunner.java
1 package RayTracer;
2
3 /**************************************************************************
4  * * Java Grande Forum Benchmark Suite - Version 2.0 * * produced by * * Java
5  * Grande Benchmarking Project * * at * * Edinburgh Parallel Computing Centre *
6  * * email: epcc-javagrande@epcc.ed.ac.uk * * * This version copyright (c) The
7  * University of Edinburgh, 1999. * All rights reserved. * *
8  **************************************************************************/
9
10 public class TestRunner extends RayTracer {
11
12   int numCore;
13   public int id;
14
15   public TestRunner(int id, 
16       int numCore,
17       int size,
18       Scene scene) {
19     super();
20     this.id = id;
21     this.numCore = numCore;
22     this.size = size;
23
24     // create the objects to be rendered
25     this.scene = scene; //createScene();
26
27     // set image size
28     width=size;
29     height=size;
30     // get lights, objects etc. from scene.
31     setScene(this.scene);
32
33     numobjects = this.scene.getObjects();
34     /*this.image=new int[size][];
35
36     // get lights, objects etc. from scene.
37     setScene(scene);
38
39     numobjects = scene.getObjects();*/
40   }
41
42   public void init() {
43     this.image=new int[this.size/this.numCore][];
44   }
45
46   public void JGFvalidate() {
47     // long refval[] = {2676692,29827635};
48     //  long refval[] = new long[2];
49     //  refval[0] = 2676692;
50     //  refval[1] = 29827635;
51     //  long dev = checksum - refval[size];
52     //  if (dev != 0) {
53     //  System.out.println("Validation failed");
54     //  System.out.println("Pixel checksum = " + checksum);
55     //  System.out.println("Reference value = " + refval[size]);
56     //  }
57   }
58
59   public void JGFtidyup() {
60     //  scene = null;
61     //  lights = null;
62     //  prim = null;
63     //  tRay = null;
64     //  inter = null;
65     // System.gc();
66   }
67
68   public void run() {
69     this.init();
70
71     int heightPerCore=height/numCore;
72     int startidx=heightPerCore * this.id;
73     int endidx=startidx + heightPerCore;
74     Interval interval = new Interval(0, width, height, startidx, endidx, 1);
75     render(interval);
76
77     //System.out.println("CHECKSUM="+checksum);
78
79   }
80   public static void main(String[] args) {
81     int threadnum = 62; // 56;
82     int size = threadnum * 25;
83     Composer comp = new Composer(threadnum, size);
84     RayTracer rt = new RayTracer();
85     Scene scene = rt.createScene();
86     for(int i = 0; i < threadnum; ++i) {
87       TestRunner tr = new TestRunner(i, threadnum, size, scene);
88       tr.start();
89     }
90   }
91 }