start of new file
[IRC.git] / Robust / src / Benchmarks / Prefetch / SOR / dsm / JGFSORBenchSizeA.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
22 public class JGFSORBenchSizeA{ 
23
24   public static void main(String argv[]){
25
26     int nthreads;
27     if(argv.length != 0 ) {
28       nthreads = Integer.parseInt(argv[0]);
29     } else {
30       System.printString("The no of threads has not been specified, defaulting to 1\n");
31       System.printString("  \n");
32       nthreads = 1;
33     }
34
35     JGFInstrumentor instr = new JGFInstrumentor();
36     JGFInstrumentor.printHeader(2,0,nthreads);
37
38     JGFSORBench sor;
39     atomic {
40       sor = global new JGFSORBench(nthreads); 
41     }
42
43     int size = 0;
44     JGFInstrumentor.addTimer("Section2:SOR:Kernel", "Iterations",size, instr.timers);
45
46     atomic {
47       sor.JGFsetsize(size); 
48     }
49     JGFSORBench.JGFkernel(sor); 
50     int retval;
51     atomic {
52       retval = sor.JGFvalidate(); 
53     }
54     if(retval!=0) {
55       System.printString("Validation failed\n");
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     System.printString("Finished\n");
66   }
67 }