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