Moldyn benchmark.
[IRC.git] / Robust / src / Benchmarks / oooJava / moldyn / backup_working / JGFMolDynBenchSizeB.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 JGFMolDynBenchSizeB { 
21
22     public static void main(String argv[]){
23     int nthreads;
24     int workload;
25     if(argv.length != 0 ) {
26       nthreads = Integer.parseInt(argv[0]);
27       workload=Integer.parseInt(argv[1]);
28     } else {
29       System.printString("The no of threads has not been specified, defaulting to 1\n");
30       System.printString("  " + "\n");
31       nthreads = 1;
32     }
33
34 //    JGFInstrumentor instr = new JGFInstrumentor();
35 //    JGFInstrumentor.printHeader(3,1,nthreads);
36
37     JGFMolDynBench mold;
38     mold = new JGFMolDynBench(nthreads,workload); 
39     int size = 1;
40 //    JGFInstrumentor.addTimer("Section3:MolDyn:Total", "Solutions",size, instr.timers);
41 //    JGFInstrumentor.addTimer("Section3:MolDyn:Run", "Interactions",size, instr.timers);
42
43     mold.JGFsetsize(size); 
44
45 //    JGFInstrumentor.startTimer("Section3:MolDyn:Total", instr.timers);
46
47     JGFMolDynBench tmp;
48     mold.JGFinitialise(); 
49     JGFMolDynBench.JGFapplication(mold); 
50
51     /* Validate data */
52     double[] refval = new double[2];
53     refval[0] = 1731.4306625334357;
54     refval[1] = 7397.392307839352;
55     double dval;
56     dval = mold.ek[0];
57     double dev = Math.fabs(dval - refval[size]);
58     long l = (long) refval[size] *1000000;
59     long r = (long) dval * 1000000;
60     if (l != r ){
61       System.printString("Validation failed\n");
62       System.printString("Kinetic Energy = " + (long)dval + "  " + (long)dev + "  " + size + "\n");
63     }
64
65 //    JGFInstrumentor.stopTimer("Section3:MolDyn:Total", instr.timers);
66     double interactions;
67     interactions = mold.interactions;
68
69 //    JGFInstrumentor.addOpsToTimer("Section3:MolDyn:Run", (double) interactions, instr.timers);
70 //    JGFInstrumentor.addOpsToTimer("Section3:MolDyn:Total", 1, instr.timers);
71
72 //    JGFInstrumentor.printTimer("Section3:MolDyn:Run", instr.timers); 
73 //    JGFInstrumentor.printTimer("Section3:MolDyn:Total", instr.timers); 
74 //    System.printString("Finished\n");
75   }
76 }
77