start of new file
[IRC.git] / Robust / src / Benchmarks / Prefetch / LUFact / dsm / JGFLUFactBenchSizeA.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 public class JGFLUFactBenchSizeA { 
21
22   public static void main(String argv[]){
23     int nthreads;
24     if(argv.length != 0 ) { 
25       nthreads = Integer.parseInt(argv[0]); 
26     } else { 
27       System.printString("The no of threads has not been specified, defaulting to 1\n");
28       System.printString("  \n");
29       nthreads = 1;
30     }
31
32     JGFInstrumentor instr = new JGFInstrumentor();
33     JGFInstrumentor.printHeader(2,0,nthreads);
34     JGFLUFactBench lub;
35     atomic {
36       lub = global new JGFLUFactBench(nthreads); 
37     }
38
39     int size = 0;
40     JGFInstrumentor.addTimer("Section2:LUFact:Kernel", "Mflops", size, instr.timers);
41     atomic {
42       lub.JGFsetsize(size); 
43       lub.JGFinitialise();
44     }
45     JGFLUFactBench.JGFkernel(lub);
46     int retval;
47     atomic {
48       retval = lub.JGFvalidate();
49     }
50     if(retval == 1) {
51       System.printString("Validation failed\n");
52     }
53
54     double ops;
55     atomic {
56       ops = lub.ops;
57     }
58     JGFInstrumentor.addOpsToTimer("Section2:LUFact:Kernel", ((long)ops)/1.0e06, instr.timers);
59     JGFInstrumentor.printTimer("Section2:LUFact:Kernel", instr.timers); 
60   }
61 }
62