Maria Grazia Pia, INFN Genova New techniques in Monte Carlo simulation: experience with a prototype of generic programming application to Geant4 physics processes SNA + MC 2010 Joint International Conference on Supercomputing in Nuclear Applications + Monte Carlo 2010 Maria Grazia Pia INFN Genova, Italy Maria Grazia Pia 1 , Mauro Augelli 2 , Marcia Begalli 3 , Lina Quintieri 4 , Paolo Saracco 1 , Manju Sudhakar 1 , Georg Weidenspointner 5 , Andreas Zoglauer 6 1 INFN Sezione di Genova, Italy – 2 CNES, France 3 State University Rio de Janeiro, Brazil – 4 INFN Laboratori Nazionali di Frascati, Italy 5 MPE and MPI Halbleiterlabor, Germany – 6 University of California at Berkeley, USA
21
Embed
Maria Grazia Pia, INFN Genova New techniques in Monte Carlo simulation: experience with a prototype of generic programming application to Geant4 physics.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Maria Grazia Pia, INFN Genova
New techniques in Monte Carlo simulation: experience with a prototype of generic programming
application to Geant4 physics processes
SNA + MC 2010Joint International Conference on
Supercomputing in Nuclear Applications + Monte Carlo 2010
Maria Grazia Pia INFN Genova, Italy
Maria Grazia Pia1, Mauro Augelli2, Marcia Begalli3, Lina Quintieri4, Paolo Saracco1, Manju Sudhakar1, Georg Weidenspointner5, Andreas Zoglauer6
1 INFN Sezione di Genova, Italy – 2 CNES, France3 State University Rio de Janeiro, Brazil – 4 INFN Laboratori Nazionali di Frascati, Italy 5 MPE and MPI Halbleiterlabor, Germany – 6 University of California at Berkeley, USA
Maria Grazia Pia, INFN Genova
Acknowledgments
The physics models and original implementations of the physics processes mentioned in this talk derive from Geant4 Standard and Low Energy Electromagnetic packages as in Geant4 9.1 (9.2)
Thanks to Sergio Bertolucci (INFN and CERN) Tom Evans (ORNL) Simone Giani (CERN) Alessandro Montanari (INFN Bologna) Andreas Pfeiffer (CERN)
for helpful discussions and advice
The performance results concerning Compton scattering in Geant4 are published in IEEE NSS 2008 proceedings (F. Longo, L. Pandola and M.G. Pia)
Maria Grazia Pia, INFN GenovaCourtesy Borexino
Courtesy H. Araujo and A. Howard, IC London
ZEPLIN III
Courtesy CMS Collaboration
Courtesy ATLAS Collaboration
Courtesy GATE Collaboration
Courtesy R. Nartallo et al.,ESA
Widely used also in Space science and astronomy Medical physics, nuclear medicine Radiation protection Accelerator physics Humanitarian projects, security etc.Technology transfer to industry, hospitals…
Born from the requirements of large scale HEP experiments
Most cited “Nuclear Science and Technology”
publication!>140000 papers
since 1990
2nd most cited CERN/INFN paper
“Modern classic”
S. Agostinelli et al.GEANT4 - a simulation toolkit
Widely used in a variety of experimental applicationsLHC has entered production phase
1994 – 1998Pioneering project in HEP environment
Cutting-edge technologyRigorous software development methodologies
πάντα ῥεῖ
New software technologies have emerged since thenCould Geant4 profit from them?
More than one decade’s growth since RD44Could Geant4 be rejuvenated by pruning ?
Maria Grazia Pia, INFN Genova
Generic programmingPowerful paradigm “Bringing aspects of generic programming into the mainstream is most
likely C++’s greatest contribution to the software development community during this period.” B. Stroustrup, Proc. 3rd ACM SIGPLAN Conf. on History of programming languages, 2007
Drawbacks code bloat compiler support poor error messages, cumbersome debugging
Explore pro and contra by means of a prototype
Small enough to require relatively limited investmentLarge enough for the exercise to be meaningful
Quantitative metrics
Maria Grazia Pia, INFN Genova
A policy defines a class or class template interface
Policy host classes are parameterised classes
Advantages Policies are not required to inherit from a base class The code is bound at compile time
No need of virtual methods, resulting in faster execution
Policy-based design
Syntax-oriented rather than signature-oriented
Weak dependency of the policy and the policy based class on the policy interface
Highly customizable design
First introduced in Geant4S. Chauvie et al., Geant4 physics processes for microdosimetry simulation: design foundation and implementation of the first set of models
Yes, physics does make sense. And is transparently exposed.
Validation on experimental data by Namito et al.
There is only the fight to recover what has been lostAnd found and lost again and again: and now, under conditionsThat seem unpropitious. T.S. Eliot, Four Quartets (East Coker)
Maria Grazia Pia, INFN Genova
Performance improvement(where no improvement is expected)
Policy-based design Geant4 9.1 Gain
C 4.15 6.08 32%
Si 6.23 8.37 26%
Cu 7.64 10.78 29%
W 14.06 19.18 27%
Move lowenergy-Penelope to Standard package design: ~10% gain, including implementation improvements
Source: L. Pandola, http://workgroup.lngs.infn.it/geant4lns/group-meetings-directory/l.pandola
Example: Penelope ComptonNO ATTEMPT [yet] TO IMPROVE THE IMPLEMENTATION
K. Amako et al.,Comparison of Geant4 electromagnetic physics models against the NIST reference dataIEEE Trans. Nucl. Sci., vol. 52, no. 4, pp. 910-918, Aug. 2005
Maria Grazia Pia, INFN Genova
Adopt best practices, build on existing body of knowledge
Maria Grazia Pia, INFN Genova
Physics on a dietThe design exposes the physics at very fine granularity Unprecedented opportunity for thorough validation Identification of epistemic uncertainties
Similarities and differences among Geant4 models Accuracy Computational performance
Toolkit nature of Geant4: provide a variety of models Replicas of the same physics functionality? Often result of evolution: initially they were different Pruning keeps trees healthier!
Cost of maintenance of a complex software system Long time scale of LHC operation (various developers will be retired)
Only a fraction of Geant4 physics has documented validation in the literature