Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

10
Math Libs @ LHCb Ivan Belyaev Ivan Belyaev LHCb, CERN & LHCb, CERN & ITEP/Moscow ITEP/Moscow

Transcript of Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

Page 1: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

Math Libs @ LHCb

Ivan BelyaevIvan Belyaev

LHCb, CERN & ITEP/MoscowLHCb, CERN & ITEP/Moscow

Page 2: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 22

Math libraries

““External”External”

• LHC Computing GRID project LHC Computing GRID project

• RTAG (Requirements and RTAG (Requirements and Technology Assessment Technology Assessment Group) for math library Group) for math library review review

• Review, requirements & Review, requirements & recommendation, recommendation, suggestionssuggestions

•nownow

• Real impact for LHCb Real impact for LHCb • long term long term

““Internal” Internal”

•What math libraries are What math libraries are currently actually used?currently actually used?

•OO world OO world

•FORTRAN world FORTRAN world

•What we need in What we need in nearest future? nearest future?

•e.g. LHCb-light e.g. LHCb-light studies: no FOTRAN - studies: no FOTRAN - no CERNLIB?no CERNLIB?

•How to distribute our How to distribute our software ? licencesoftware ? licence

Page 3: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 33

RTAG for math library review

• Chair: Frederic JAMESChair: Frederic JAMES

• Mandate: Review the current situation with math libraries and make Mandate: Review the current situation with math libraries and make recommendationsrecommendations

• Review the current situation of the usage of the various math libraries in the Review the current situation of the usage of the various math libraries in the experiments (including but not limited to NagC++, GSL, CLHEP, ROOT)experiments (including but not limited to NagC++, GSL, CLHEP, ROOT)

• Identify and recommend which ones should be adopted, which ones could Identify and recommend which ones should be adopted, which ones could be discontinuedbe discontinued

• Suggest possible improvements to the existing onesSuggest possible improvements to the existing ones

• Estimate resources needed for this activityEstimate resources needed for this activity

• Timescale - Initial report in 1 month, final report within 2 monthsTimescale - Initial report in 1 month, final report within 2 months

• Makeup - Reps from experiments, IT/API (CLHEP), ROOT + additional Makeup - Reps from experiments, IT/API (CLHEP), ROOT + additional members at chair’s discretionmembers at chair’s discretion

• Guidance – The result of the RTAG should allow to establish a clear Guidance – The result of the RTAG should allow to establish a clear program of work to streamline the status of math libraries and find the program of work to streamline the status of math libraries and find the maximum commonality between experiments, taking into account cost, maximum commonality between experiments, taking into account cost, maintenance and projected evolution of the experiment needsmaintenance and projected evolution of the experiment needs

Page 4: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 44

Existing math libs

•NagC NagC

http://cern.ch/anaphe/dochttp://cern.ch/anaphe/documentation/Nag_C/NAGdoumentation/Nag_C/NAGdoc/cl/html/mark6.htmlc/cl/html/mark6.html

•GSL: GSL:

GNU Scientific LibraryGNU Scientific Library

http://www.gnu.org/directhttp://www.gnu.org/directory/gsl.htmlory/gsl.html

•CLHEP (rudimentary)CLHEP (rudimentary)

http://wwwinfo.cern.ch/ashttp://wwwinfo.cern.ch/asd/lhc++/clhep/index.htmld/lhc++/clhep/index.html

•ROOT (all CERNLIB)ROOT (all CERNLIB)http://root.cern.http://root.cern.chch

•STL (rudimentary) STL (rudimentary)

•Geant4 (includes Geant4 (includes CLHEP) CLHEP) http://cern.ch/Geant4http://cern.ch/Geant4

•Fragments:Fragments:•MidNight ( Minuit)MidNight ( Minuit)

• ??

•What Else?What Else?

Page 5: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 55

General features I

NagC and GSL NagC and GSL

•General purpose powerful C-General purpose powerful C-librarieslibraries

•Wide functionalityWide functionality

• Special functionsSpecial functions

• Linear algebraLinear algebra

• Equation solvers Equation solvers

• MinimizationMinimization

• Random numbersRandom numbers

• Statistics Statistics

• Interpolation, Interpolation, extrapolation, integration,extrapolation, integration,……

•Ugly user interfaceUgly user interface

•High performanceHigh performance

CLHEPCLHEP

•““de-facto” standard de-facto” standard

•Useful classes (C++)Useful classes (C++)

•FunctionalityFunctionality•Random numbers Random numbers

•Rudimentary:Rudimentary:•Linear algebra Linear algebra

•very limited very limited

•very inefficientvery inefficient

•Access to the functionsAccess to the functions•No functionsNo functions

Page 6: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 66

General features II

STL STL

•Standard: Standard: • <numerics><numerics>

•Statistics Statistics

•General purpose General purpose templated classes like templated classes like vectors, arrays, vectors, arrays, matrices:matrices:•Very efficient: in-lined Very efficient: in-lined

and optimizedand optimized

• rudimentaryrudimentary

RootRoot

• CERNLIB CERNLIB

Geant4Geant4

• CLHEPCLHEP

• Special functionsSpecial functions

• Interpolation, Interpolation, extrapolation, extrapolation, integration,…integration,…

Page 7: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 77

functionality (inverse view I)

•Special functions:Special functions:•NagC NagC

•GSLGSL

• (Geant4)(Geant4)

•StatisticsStatistics•NagC NagC

•GSLGSL

•STLSTL

•MinimizationMinimization•NagCNagC

•GSLGSL

•Ordinary equationsOrdinary equations•NagCNagC

•GSLGSL

•CLHEP (linear)CLHEP (linear)

•Differential equationsDifferential equations•NagCNagC

•GSLGSL

•Geant4Geant4

•Random numbersRandom numbers•CLHEPCLHEP

•NagCNagC

•GSLGSL

Page 8: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 88

functionality (inverse view II)

•Linear algebra classes: Linear algebra classes: matrices and vectorsmatrices and vectors

•CLHEP CLHEP •““de-facto” standardde-facto” standard

•Nice C++ interfaceNice C++ interface

•STLSTL•The “standard” is not a The “standard” is not a

standard yet (now)standard yet (now)

•C++ interface C++ interface

•NagC and SLTNagC and SLT•C-interface, ugly, C-interface, ugly,

unfriendlyunfriendly

•Prone to memory leaksProne to memory leaks

Linear algebra operationsLinear algebra operations

•CLHEPCLHEP• limited functionalitylimited functionality

• inefficientinefficient

•STLSTL• limited functionalitylimited functionality

• very efficientvery efficient

•NagC and GSL with NagC and GSL with ATLAS/C-BLASATLAS/C-BLAS• excellent functionalityexcellent functionality

• very efficient very efficient

•Should be hidden ! Should be hidden !

Page 9: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 99

•Current usage in LHCbCurrent usage in LHCb

(as known for me)(as known for me)

•CLHEP (everywhere) CLHEP (everywhere)

•NagC NagC • Special function(s) (Tr)Special function(s) (Tr)

• Linear algebra (Calo)Linear algebra (Calo)

• ??

•Could be substituted with Could be substituted with GSL without problems! GSL without problems!

•GSL need to be installed!GSL need to be installed!•Win2K?Win2K?

•NagC has no visible NagC has no visible advantages with respect advantages with respect to GSLto GSL

•NagC requires the NagC requires the license license • Panoramix/SoCalo Panoramix/SoCalo

distribution is illegal distribution is illegal

•GSL is covered by GPLGSL is covered by GPL

•Quality? Performance?Quality? Performance?•GSL allows: GSL allows:

•in-line optimizationin-line optimization

• usage of specialized usage of specialized ATLAS/C-BLAS librariesATLAS/C-BLAS libraries

Page 10: Math Libs @ LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.

4 Feb'2k+24 Feb'2k+2 Computing Computing Ivan Belyaev LHCb CERN & ITEP/MoscowIvan Belyaev LHCb CERN & ITEP/Moscow 1010

•(I think) we need Some (I think) we need Some internal LHCb review or internal LHCb review or discussion on the discussion on the current and future current and future usage of math librariesusage of math libraries

•Need to consider the Need to consider the replacement of NagC replacement of NagC with GSL as soon as with GSL as soon as possible.possible.

•GSL installation GSL installation • LHCb area ?LHCb area ?

•CERN-wide ?CERN-wide ?•My view could be biased My view could be biased

and even wrongand even wrong• For RTAG I need your help ! For RTAG I need your help !