stressHepix.cxx

Go to the documentation of this file.
00001 // @(#)root/test:$Id: stressHepix.cxx 30598 2009-10-07 07:09:02Z brun $
00002 // Author: Rene Brun   12/09/2006
00003 
00004 ///////////////////////////////////////////////////////////////////////////////
00005 //
00006 //    R O O T   S T R E S S H E P I X  G L O B A L  B E N C H M A R K
00007 //    ===============================================================
00008 //
00009 // HEPiX-HEPNT is an organization comprised of UNIX and Windows support staff
00010 // in the High Energy Physics community.
00011 // One of the HEPIX activities is to gather knowledge about new hardware
00012 // and software and to recommend common solutions (eg Scientific Linux)
00013 //   see: http://wwwhepix.web.cern.ch/wwwhepix/
00014 //
00015 // This benchmark suite has been implemented following several requests
00016 // from HEPIX members interested by a collection of benchmarks representative
00017 // of typical applications.
00018 //
00019 // stressHepix is a single benchmark inclusing several standard ROOT benchmarks
00020 // with a mixture of CPU intensive tests and I/O tests.
00021 // The output of stressHepix is one single number (the ROOTMARK).
00022 // A Pentium IV 2.8GHz running Linux SLC3 and gcc3.2.3 runs this benchmark
00023 // with a reference at 800 ROOTMARKs.
00024 // To build the executable for this benchmark, do
00025 //   cd $ROOTSYS/test
00026 //   make
00027 //
00028 // The default configuration of ROOT is enough.
00029 // The ouput of this benchmark looks like:
00030 //
00031 /// stressHepix
00032 ///
00033 ///
00034 ///Starting stressHepix benchmark (details will be in stressHepix.log)
00035 ///Takes 442 CP seconds on a  500 rootmarks machine (IBM Thinkpad centrino 1.4GHz VC++7.1)
00036 ///Takes 278 CP seconds on a  800 rootmarks reference machine (P IV 2.8 GHz, SLC3 gcc3.2.3)
00037 ///Takes 239 CP seconds on a  924 rootmarks machine (MacBook 2.0GHz gcc4.0.1)
00038 ///Takes 209 CP seconds on a 1056 rootmarks machine (MacBook 2.0GHz icc9.1)
00039 ///Takes 147 CP seconds on a 1512 rootmarks machine (MacPro 3.0GHz gcc4.0.1)
00040 ///Takes 142 CP seconds on a 1550 rootmarks machine (AMD64/280, FC5 gcc4.1)
00041 ///Takes 121 CP seconds on a 1828 rootmarks machine (MacPro 3.0GHz icc9.1)
00042 ///
00043 ///Running : stressFit Minuit  2000, (takes 11 RT seconds on the ref machine)
00044 ///Running : stressLinear, (takes 26 RT seconds on the ref machine)
00045 ///Running : stressGeometry, (takes 77 RT seconds on the ref machine)
00046 ///Running : stressSpectrum 1000, (takes 116 RT seconds on the ref machine)
00047 ///Running : stress -b 3000, (takes 138 RT seconds on the ref machine)
00048 ///
00049 ///
00050 ///****************************************************************************
00051 ///*                                                                          *
00052 ///*               S T R E S S   H E P I X  S U M M A R Y                     *
00053 ///*                                                                          *
00054 ///*       ROOTMARKS = 789.3   *  Root5.13/03   20060830/1441
00055 ///*                                                                          *
00056 ///*  Real Time =  401.1 seconds, CpuTime =  281.8 seconds
00057 ///*  Linux pcbrun 2.4.21-47.EL.cernsmp #1 SMP Mon Jul 24 15:33:5
00058 ///****************************************************************************
00059 //
00060 // If you run this benchmark on a new platform, please report the results
00061 // at rootdev@root.cern.ch. Send the output shown above and also the
00062 // log file stressHepix.log that contains more details about the individual
00063 // tests. Your results will be shown at http://root.cern.ch/root/Benchmark.html
00064 //
00065 ///////////////////////////////////////////////////////////////////////////////
00066 
00067 #include <TROOT.h>
00068 #include "TApplication.h"
00069 #include <TSystem.h>
00070 #include <TStopwatch.h>
00071 
00072 
00073 void runTest(const char *atest, int estimate)
00074 {
00075    if (estimate > 0)
00076       printf("Running : %s, (takes %d RT seconds on the ref machine)\n",atest,estimate);
00077    TString cmdname(gROOT->GetApplication()->Argv(0));
00078    TString prefix(".");
00079    Ssiz_t offset;
00080 #ifdef WIN32
00081    if ((offset = cmdname.Last('\\')) != kNPOS) {
00082       cmdname.Resize(offset);
00083       prefix = cmdname;
00084    }
00085    gSystem->Exec(Form("%s\\%s >>stressHepix.log",prefix.Data(),atest));
00086 #else
00087    if ((offset = cmdname.Last('/')) != kNPOS) {
00088       cmdname.Resize(offset);
00089       prefix = cmdname;
00090    }
00091    gSystem->Exec(Form("%s/%s >>stressHepix.log",prefix.Data(),atest));
00092 #endif
00093 }
00094 
00095 int main(int argc, char **argv)
00096 {
00097    TApplication theApp("App", &argc, argv);
00098    printf("\n\nStarting stressHepix benchmark (details will be in stressHepix.log)\n");
00099    printf("Takes 742 CP seconds on a  500 rootmarks machine (IBM Thinkpad centrino 1.4GHz VC++7.1)\n");
00100    printf("Takes 348 CP seconds on a  800 rootmarks reference machine (P IV 2.8 GHz, SLC4 gcc3.4)\n");
00101    printf("Takes 162 CP seconds on a 1710 rootmarks machine (MacPro 2.0GHz gcc4.0.1)\n");
00102    if (gSystem->AccessPathName("atlas.root")) {
00103       printf("\nPreparing geometry files from http://root.cern.ch\n\n");
00104       runTest("stressGeometry", 0);
00105    }
00106    TStopwatch timer;
00107    timer.Start();
00108    gSystem->Exec("echo stressHepix > stressHepix.log");
00109    runTest("stressFit Minuit  2000",12);
00110    runTest("stressLinear",26);
00111    runTest("stressGeometry",118);
00112    runTest("stressSpectrum 1000",190);
00113    runTest("stress -b 3000",124);
00114    timer.Stop();
00115    Double_t rt = timer.RealTime();
00116    //scan log file to accumulate the individual Cpu Times
00117    FILE *fp = fopen("stressHepix.log","r");
00118    char line[180];
00119    float cput;
00120    Double_t ct = 0;
00121    {
00122       while (fgets(line,180,fp)) {
00123          char *cpu = strstr(line,"Cpu Time =");
00124          if (cpu) {sscanf(cpu+10,"%g",&cput); ct += cput;}
00125       }
00126    }
00127    fclose(fp);
00128    Double_t reftime = 348.3; //pcbrun4 compiled and 490.5 seconds real time
00129    const Double_t rootmarks = 800*reftime/ct;
00130 
00131    //Print table with results
00132    Bool_t UNIX = strcmp(gSystem->GetName(), "Unix") == 0;
00133    printf("\n\n");
00134    printf("****************************************************************************\n");
00135    printf("*                                                                          *\n");
00136    printf("*               S T R E S S   H E P I X  S U M M A R Y                     *\n");
00137    printf("*                                                                          *\n");
00138    printf("*       ROOTMARKS =%6.1f   *  Root%-8s  %d/%d\n",rootmarks,gROOT->GetVersion(),
00139          gROOT->GetVersionDate(),gROOT->GetVersionTime());
00140    printf("*                                                                          *\n");
00141    printf("*  Real Time = %6.1f seconds, CpuTime = %6.1f seconds\n",rt,ct);
00142    if (UNIX) {
00143       TString sp = gSystem->GetFromPipe("uname -a");
00144       sp.Resize(60);
00145       printf("*  SYS: %s\n",sp.Data());
00146       if (strstr(gSystem->GetBuildNode(),"Linux")) {
00147          sp = gSystem->GetFromPipe("lsb_release -d -s");
00148          printf("*  SYS: %s\n",sp.Data());
00149       }
00150       if (strstr(gSystem->GetBuildNode(),"Darwin")) {
00151          sp  = gSystem->GetFromPipe("sw_vers -productVersion");
00152          sp += " Mac OS X ";
00153          printf("*  SYS: %s\n",sp.Data());
00154       }
00155    } else {
00156       const char *os = gSystem->Getenv("OS");
00157       if (!os) printf("*  SYS: Windows 95\n");
00158       else     printf("*  SYS: %s %s \n",os,gSystem->Getenv("PROCESSOR_IDENTIFIER"));
00159    }
00160    printf("****************************************************************************\n");
00161 }
00162 

Generated on Tue Jul 5 15:15:15 2011 for ROOT_528-00b_version by  doxygen 1.5.1