Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
rootmarks.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_legacy
3/// Prints a summary of all ROOT benchmarks (must be run before).
4/// The ROOTMARK number printed is by reference to a Pentium IV 2.4 Ghz
5/// (with 512 MBytes memory and 120 GBytes IDE disk)
6/// taken by definition as 600 ROOTMARKS in batch mode in executing
7///
8/// root -b -q benchmarks.C
9///
10/// \macro_code
11///
12/// \author Rene Brun
13
14void rootmarks() {
15
16
17 Float_t rtall = 0;
18 Float_t cpall = 0;
19 Float_t norml = 600;
20 Float_t rtmark,cpmark;
21 Bool_t batch = gROOT->IsBatch();
22
23 printf("---------------ROOT %s benchmarks summary--------------------\n",gROOT->GetVersion());
24 gBenchmark->Summary(rtall,cpall);
25 printf("\n---------------ROOT %s benchmarks summary (in ROOTMARKS)-----\n",gROOT->GetVersion());
26 printf(" For comparison, a Pentium IV 2.4Ghz is benchmarked at 600 ROOTMARKS\n");
27 Float_t hsimple_rt = gBenchmark->GetRealTime("hsimple");
28 Float_t hsimple_ct = gBenchmark->GetCpuTime("hsimple");
29 if (hsimple_rt > 0) {
30 if (batch) {
31 rtmark = norml*(0.29/hsimple_rt);
32 cpmark = norml*(0.28/hsimple_ct);
33 } else {
34 rtmark = norml*(0.99/hsimple_rt);
35 cpmark = norml*(0.43/hsimple_ct);
36 }
37 printf("hsimple = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
38 }
39
40 Float_t hsum_rt = gBenchmark->GetRealTime("hsum");
41 Float_t hsum_ct = gBenchmark->GetCpuTime("hsum");
42 if (hsum_rt > 0) {
43 if (batch) {
44 rtmark = norml*(0.16/hsum_rt);
45 cpmark = norml*(0.15/hsum_ct);
46 } else {
47 rtmark = norml*(0.99/hsum_rt);
48 cpmark = norml*(0.24/hsum_ct);
49 }
50 printf("hsum = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
51 }
52
53 Float_t fillrandom_rt = gBenchmark->GetRealTime("fillrandom");
54 Float_t fillrandom_ct = gBenchmark->GetCpuTime("fillrandom");
55 if (fillrandom_rt > 0) {
56 if (batch) {
57 rtmark = norml*(0.02/fillrandom_rt);
58 cpmark = norml*(0.01/fillrandom_ct);
59 } else {
60 rtmark = norml*(0.48/fillrandom_rt);
61 cpmark = norml*(0.04/fillrandom_ct);
62 }
63 printf("fillrandom = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
64 }
65
66 Float_t fit1_rt = gBenchmark->GetRealTime("fit1");
67 Float_t fit1_ct = gBenchmark->GetCpuTime("fit1");
68 if (fit1_rt > 0) {
69 if (batch) {
70 rtmark = norml*(0.04/fit1_rt);
71 cpmark = norml*(0.03/fit1_ct);
72 } else {
73 rtmark = norml*(0.13/fit1_rt);
74 cpmark = norml*(0.03/fit1_ct);
75 }
76 printf("fit1 = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
77 }
78
79 Float_t tornado_rt = gBenchmark->GetRealTime("tornado");
80 Float_t tornado_ct = gBenchmark->GetCpuTime("tornado");
81 if (tornado_rt > 0) {
82 if (batch) {
83 rtmark = norml*(0.05/tornado_rt);
84 cpmark = norml*(0.04/tornado_ct);
85 } else {
86 rtmark = norml*(0.11/tornado_rt);
87 cpmark = norml*(0.03/tornado_ct);
88 }
89 printf("tornado = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
90 }
91
92 Float_t na49_rt = gBenchmark->GetRealTime("na49");
93 Float_t na49_ct = gBenchmark->GetCpuTime("na49");
94 if (na49_rt > 0) {
95 rtmark = norml*(1.39/na49_rt);
96 cpmark = norml*(1.39/na49_ct);
97 printf("na49 = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
98 }
99
100 Float_t geometry_rt = gBenchmark->GetRealTime("geometry");
101 Float_t geometry_ct = gBenchmark->GetCpuTime("geometry");
102 if (geometry_rt > 0) {
103 rtmark = norml*(0.19/geometry_rt);
104 cpmark = norml*(0.18/geometry_ct);
105 printf("geometry = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
106 }
107
108 Float_t na49view_rt = gBenchmark->GetRealTime("na49view");
109 Float_t na49view_ct = gBenchmark->GetCpuTime("na49view");
110 if (na49view_rt > 0) {
111 if (batch) {
112 rtmark = norml*(0.03/na49view_rt);
113 cpmark = norml*(0.03/na49view_ct);
114 } else {
115 rtmark = norml*(0.33/na49view_rt);
116 cpmark = norml*(0.05/na49view_ct);
117 }
118 printf("na49view = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
119 }
120
121 Float_t ntuple1_rt = gBenchmark->GetRealTime("ntuple1");
122 Float_t ntuple1_ct = gBenchmark->GetCpuTime("ntuple1");
123 if (ntuple1_rt > 0) {
124 if (batch) {
125 rtmark = norml*(0.29/ntuple1_rt);
126 cpmark = norml*(0.27/ntuple1_ct);
127 } else {
128 rtmark = norml*(1.79/ntuple1_rt);
129 cpmark = norml*(0.28/ntuple1_ct);
130 }
131 printf("ntuple1 = %7.2f RealMARKS, = %7.2f CpuMARKS\n",rtmark,cpmark);
132 }
133
134 if (rtall) {
135 Float_t rtbrun, cpbrun;
136 if (batch) {
137 rtbrun = 3.45;
138 cpbrun = 3.24;
139 } else {
140 rtbrun = 5.79;
141 cpbrun = 4.08;
142 }
143 Float_t rootmarks = norml*(rtbrun+cpbrun)/(rtall+cpall);
144 printf("\n");
145 printf("****************************************************\n");
146 printf("* Your machine is estimated at %7.2f ROOTMARKS *\n",rootmarks);
147 printf("****************************************************\n");
148 } else {
149 printf(" You must run the ROOT benchmarks before executing this command\n");
150 }
151}
bool Bool_t
Definition RtypesCore.h:63
float Float_t
Definition RtypesCore.h:57
R__EXTERN TBenchmark * gBenchmark
Definition TBenchmark.h:59
#define gROOT
Definition TROOT.h:406
virtual void Summary(Float_t &rt, Float_t &cp)
Prints a summary of all benchmarks.
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Float_t GetRealTime(const char *name)
Returns Realtime used by Benchmark name.