start of new file
[IRC.git] / Robust / src / Benchmarks / Prefetch / SOR / dsm / JGFSORBenchSizeB.java
1 /**************************************************************************
2 *                                                                         *
3 *         Java Grande Forum Benchmark Suite - Thread Version 1.0          *
4 *                                                                         *
5 *                            produced by                                  *
6 *                                                                         *
7 *                  Java Grande Benchmarking Project                       *
8 *                                                                         *
9 *                                at                                       *
10 *                                                                         *
11 *                Edinburgh Parallel Computing Centre                      *
12 *                                                                         * 
13 *                email: epcc-javagrande@epcc.ed.ac.uk                     *
14 *                                                                         *
15 *                                                                         *
16 *      This version copyright (c) The University of Edinburgh, 2001.      *
17 *                         All rights reserved.                            *
18 *                                                                         *
19 **************************************************************************/
20
21 public class JGFSORBenchSizeB{ 
22
23   public static void main(String argv[]){
24     int nthreads;
25
26     if(argv.length != 0 ) {
27       nthreads = Integer.parseInt(argv[0]);
28     } else {
29       System.out.println("The no of threads has not been specified, defaulting to 1");
30       System.out.println("  ");
31       nthreads = 1;
32     }
33
34     JGFInstrumentor instr = new JGFInstrumentor();
35     JGFInstrumentor.printHeader(2,1,nthreads);
36
37     JGFSORBench sor;
38     atomic {
39       sor = global new JGFSORBench(nthreads); 
40     }
41
42     int size = 1;
43     JGFInstrumentor.addTimer("Section2:SOR:Kernel", "Iterations",size, instr.timers);
44
45     atomic {
46       sor.JGFsetsize(size); 
47     }
48     JGFSORBench.JGFkernel(sor); 
49     System.printString("End of JGFkernel\n");
50     int retval;
51     atomic {
52       retval = sor.JGFvalidate(); 
53     }
54     if(retval!=0) {
55       System.printString("Validation failed");
56     }
57
58     int jacobi;
59     atomic {
60       jacobi = sor.JACOBI_NUM_ITER;
61     }
62
63     JGFInstrumentor.addOpsToTimer("Section2:SOR:Kernel", (double) jacobi, instr.timers);
64     JGFInstrumentor.printTimer("Section2:SOR:Kernel", instr.timers); 
65   }
66 }