root tests ams computing meeting march 31 st 2003 davide grandi infn milano
TRANSCRIPT
ROOT tests
AMS Computing meetingMarch 31st 2003
Davide GrandiINFN Milano
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Outline• Status at june 2002• Replace ntuples with ROOT trees?• New features (TCloneArrays, &TRefArrays)• Root tests with version 3.05.02 (03-2003)
– Problems – Advantages
• Comparison of versions• Public info• Work in progress• Conclusions
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Status at june 2002
• PAW ntuples converted to root trees via h2root
• Chain of ntuples/trees
• Start analysis of new TCloneArrays
• PAW/ROOT almost equal
• See web page http://ams.cern.ch/AMS/Reports/AMSnote-2002_06_01b.ppt
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Replace PAW nt with ROOT trees?
• CERN IT division policy:1. PAW/fortran no more supported2. All HEP experiments moving to C++ (LHC code only C+
+)3. ROOT histogramming package faster and more efficient
than PAW HBOOK• AMS requirements:1. Data storage for 3 years data taking ~ 400 TB (+MC)2. On disk at least 50 TB3. Fast analysis tool (OO?)
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
New features (1)
• Introduced by A. Klimentov & V. Choutko
• TCloneArrays (started using also in june 2002): is an array of identical (clone) objects, the memory is allocated only once, is specially designed for repetitive data analysis task (in a loop many times the same objects are created and deleted)
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
New features (2)• Tref & TRefArrays:
• TRef is a lightweight object pointing to any Tobject that can be used instead of normal C++ pointers
1. Pointer is read before Reference
2. Pointer and Reference are written in different Tree branches
3. Pay attention to null pointers…
• TRefArray “simply” an array of TRef
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
framework• Pcamsf2.cern.ch
• Linux
• 2 Ghz CPU
• Gcc 3.2.2 (03-2003)
• ROOT run in batch mode without graphic interface
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
PAW results
• Best performance at 06/2003
• NT 30k events
• Without gunzipping (which means 2-3 times disk space….):
5.890 1.030 0:16.99
• With gunzipping :
13.500 4.770 0:54.88
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
ROOT 3.03.04 (12-2002)
• Seems more stable than newer versions
• Best speed test on 30k events:
20.08 sec at 100% CPU
• To use it: need to be recompiled with new gcc 3.2.2
• Seem “lighter” than newer version
• Faster (from 10% without ACLiC to 30% with ACLiC)
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.02 (03-2003)
• (many) thanks to Alexei and Vitaly compiled & installed with gcc 3.2.2
• Test done on different size of files– 1k, 10k, 30k and 90k events
• Different selection files (try to optimize speed)
• Use of ACLiC is always recommended
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Strategy and ACLiC
• Load the tree: unknown AMS classes
Generate the Dictionary and dinamycally load it
• Generate the selection skeleton (MakeSelector)
Define branches (TCloneArrays are not recognized…) in header file and “make-up”
• Run the selection code with ACLiC (create a shared lib, 102 times faster!!!) add a ++
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.02
N.B all tests performed with
•creation of histograms with names and writing to stdout
Strategy:
•Load the whole tree (do or do not selections)
•Load only needed branches (do or do not selections)
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.021k events
•loading only needed branches
CPU 1.14 REAL 1.15
•loading the tree CPU 1.6 REAL 1.6
•doing selections (loading branches needed)
CPU 1.15 REAL 1.14
•doing selections (loading the tree)
CPU 1.7 REAL 1.7
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.0210k events
•loading only 11 branches CPU 11.71 REAL 11.69
•loading the tree CPU 16.54 REAL 16.54
• doing selections (loading only needed branches)
--creating shared lib CPU 11.75 REAL 11.72
--shared lib already created CPU 11.3 REAL 11.29
• doing selections (loading the tree)
CPU 17.29 REAL 17.28
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.0230k events
•loading only 11 branches CPU 32.67 REAL 32.68
•loading the tree CPU 46.46 REAL 46.46
•doing selections (11 branches)
--creating shared lib CPU 29.21 REAL 29.2
10% FASTER THAN READING 11 branches
--shared lib already created
•doing selections (loading the tree)
CPU 47.74 REAL 47.68
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.0290k events
•loading only 11 branches CPU 99.89 REAL 99.6
•loading the tree CPU 141.01 REAL 141.04
•doing selections (11 branches)
--creating shared lib CPU 89.69 REAL 89.69
--sh lib already created CPU 89.45 REAL 89.48
•Doing selections (loading the tree)
CPU 145.86 REAL 145.89
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Version 3.05.02
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Comparison of versions
• Older versions are more “stable” and faster
• Changing versions old codes must be changed– Slightly if iostream.hRiostream.h– Deeply (for ex. Test.h created by MakeSelector)
• Changing default compiler can give you problems (at least I had…)
• Compiling and installing??… I was lucky (done by A. Klimentov)
• Of course: bug fixed! CVS versions “daily updated
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Public info• Soon on pcamsf2:
1. In dir /users/dgrandi/public/root
2. All info on AMS root trees
3. How to create/read root trees
4. How to create analysis file
5. Some examples of selections
6. Suggestions to avoid some errors
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Work in progress
• Check the possibility to use different versions (older is better without losing advantages of newest version a compromise)
• Work with G. Lamanna to insert gamma branches in root trees
• To do (?): “bypassing the Streamer improves the performance when writing/reading TCloneArrays” root guide pag.203….
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Conclusions (1)
• ROOT still evolving (better use consolidated version)
• Excellent “on-line” help (R. Brun always answering)
• Needed C++ knowledge (much more than mine to use the whole ROOT power)
• Very sensitive to small changes (compilers etc.) in the environment
Davide Grandi INFN, Root tests, AMS Computing meeting 31/03/2003
Conclusions (2)
• ROOT can be used to write/read AMS-02 data
• Files already compressed: optimum for disk space!
• ROOT is very CPU consuming but with the advantages of C++ (OO, templates, 3D graphics, geometric packages etc.)
choice between disk space & CPU load