Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course.

Slides:



Advertisements
Similar presentations
The Geant4 Kernel: Status and Recent Developments John Apostolakis, Gabriele Cosmo – CERN / PH Makoto Asai – SLAC On behalf the Geant4 collaboration April.
Advertisements

Background Virtual memory – separation of user logical memory from physical memory. Only part of the program needs to be in memory for execution. Logical.
Geant4 v9.2p02 Kernel II Makoto Asai (SLAC) Geant4 Tutorial Course.
Processes Management.
Business logic for annotation workflow Tom Oldfield July 21, 2010.
Geant4 v9.2p02 User Interface I Makoto Asai (SLAC) Geant4 Tutorial Course.
Lecture 34: Chapter 5 Today’s topic –Virtual Memories 1.
Chapter 11: File System Implementation
Geant4 v9.2p02 Kernel III Makoto Asai (SLAC) Geant4 Tutorial Course.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
CS 333 Introduction to Operating Systems Class 18 - File System Performance Jonathan Walpole Computer Science Portland State University.
14 User Documents and Examples I SLAC Geant4 Tutorial 3 November 2009 Dennis Wright Geant4 V9.2.p02.
Nested Parameterization
Highlights of latest developments ESA/ESTEC Makoto Asai (SLAC)
Computer Organization Cs 147 Prof. Lee Azita Keshmiri.
Makoto Asai (SLAC) Geant4 Users SLAC Feb. 20th, 2002 Stack management, Digitization and Pile-up.
1 Work Plan/Summary I By 25 th May 2007… Class clean-up – biasing and scoring… What to remove? (for v9.0) –Biasing VScorer and associated classes (in transportation.
MIS 431 Chapter 71 Ch. 7: Advanced File Management System MIS 431 Created Spring 2006.
Makoto Asai (SLAC) Geant4 Tutorial Course
Makoto Asai (SLAC) Geant4 Users CERN Nov. 13th, 2002 Stack management, Digitization and Pile-up.
Some tips for geometries of medical applications Makoto Asai (SLAC)
Geant4 New Features Joseph Perl (SLAC/SCCS) G4NAMU AAPM Minneapolis 22 July 2007.
File System. NET+OS 6 File System Architecture Design Goals File System Layer Design Storage Services Layer Design RAM Services Layer Design Flash Services.
Chapter 3 Memory Management: Virtual Memory
Grid Data Management A network of computers forming prototype grids currently operate across Britain and the rest of the world, working on the data challenges.
CMPE 421 Parallel Computer Architecture
1. Memory Manager 2 Memory Management In an environment that supports dynamic memory allocation, the memory manager must keep a record of the usage of.
Geant4 v9.5 Kernel III Makoto Asai (SLAC) Geant4 Tutorial Course.
User Documents and Examples I Sébastien Incerti Slides thanks to Dennis Wrigth, SLAC.
Other GEANT4 capabilities Event biasing Parameterisation (fast simulation) Scoring Persistency Parallelisation and integration in a distributed computing.
Lecture 19: Virtual Memory
Geant4 v9.3p01 Kernel III Makoto Asai (SLAC) Geant4 Tutorial Course.
IT253: Computer Organization
How to Build a CPU Cache COMP25212 – Lecture 2. Learning Objectives To understand: –how cache is logically structured –how cache operates CPU reads CPU.
Maria Grazia Pia Detector Response Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Geant4 Event Biasing Marc Verderi, LLR (Heavily copied from Jane Tinslay, SLAC) June 2007.
L/O/G/O Cache Memory Chapter 3 (b) CS.216 Computer Architecture and Organization.
Alex Howard, CERN – Performance Improvement – Hebden Bridge 14 th September Recommendations for improving application performance (… but not presentation.
Chapter 4 Memory Management Virtual Memory.
Computing Performance Recommendations #13, #14. Recommendation #13 (1/3) We recommend providing a simple mechanism for users to turn off “irrelevant”
Fast Crash Recovery in RAMCloud. Motivation The role of DRAM has been increasing – Facebook used 150TB of DRAM For 200TB of disk storage However, there.
CSE 241 Computer Engineering (1) هندسة الحاسبات (1) Lecture #3 Ch. 6 Memory System Design Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
Geant4 in production: status and developments John Apostolakis (CERN) Makoto Asai (SLAC) for the Geant4 collaboration.
New software library of geometrical primitives for modelling of solids used in Monte Carlo detector simulations Marek Gayer, John Apostolakis, Gabriele.
Geant4 v9.4 Kernel III Makoto Asai (SLAC) Geant4 Tutorial Course.
CS333 Intro to Operating Systems Jonathan Walpole.
1  2004 Morgan Kaufmann Publishers Chapter Seven Memory Hierarchy-3 by Patterson.
Profiling study of Geant4-GATE Discussion of suggested VRTs Nicolas Karakatsanis, George Loudos, Arion Chatziioannou Geant4-GATE technical meeting 12 th.
Geant4 on GPU prototype Nicholas Henderson (Stanford Univ. / ICME)
Virtual Memory Review Goal: give illusion of a large memory Allow many processes to share single memory Strategy Break physical memory up into blocks (pages)
Update on G5 prototype Andrei Gheata Computing Upgrade Weekly Meeting 26 June 2012.
Makoto Asai.  Parallel layered mass geometry  Other minor improvement  G4Exception.
SQL IMPLEMENTATION & ADMINISTRATION Indexing & Views.
Interaction with the Geant4 kernel
Virtual memory.
Jonathan Walpole Computer Science Portland State University
Geant4 Geometry Speed-ups
Interaction with the Geant4 kernel
Modern Systems Analysis and Design Third Edition
Lecture 14 Virtual Memory and the Alpha Memory Hierarchy
Chapter 9: Virtual-Memory Management
Andy Wang Operating Systems COP 4610 / CGS 5765
Detector sensitivity Makoto Asai (SLAC Computing Services)
Other GEANT4 capabilities
CSC3050 – Computer Architecture
Marc Verderi GEANT4 collaboration meeting 01/10/2002
Customizing Run Management
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Geant4 v9.2p02 Speed up Makoto Asai (SLAC) Geant4 Tutorial Course

Geant4 v9.2p02 Tips for computing performance

Some tips to consider - 1 We are making our best effort to improve the speed of Geant4 toolkit. But, since it is a toolkit, a user may also make the simulation unnecessarily slow. For general applications –Check methods which are invoked frequently, e.g. UserSteppingAction(), ProcessHits(), ComputeTransformation(), GetField() etc. –In such methods, avoid string manipulation, file access or cout, unnecessary object instantiation or deletion, or unnecessary massive polynomial calculation such as sin(), cos(), log(), exp(). For relatively complex geometry or high energy applications –Kill unnecessary secondary particles as soon as possible. –Use stacking action wisely. Abort unnecessary events at the earliest stage. –Utilize G4Region for regional cut-offs, user limits. –For geometry, consider replica rather than parameterized volume as much as possible. Also consider nested parameterization. –Do not keep too many trajectories. For relatively simple geometry or low energy applications –Do not store the random number engine status for each event. Kernel III - M.Asai (SLAC)3

Some tips to consider - 2 Chop out unnecessary objects in memory. This is not only the issue of memory size of your CPU, but also the matter of cache-hit rate. –By default cross-section tables of EM processes are built for the energy range of 0.1 keV to 100 TeV (10 TeV in G4 v9.3). If your simulation does not require higher energies, cut higher part out. Do not change the granularity of sampling bins (7 bins per decade). –Delete unnecessary materials. –Limit size (number of bins) of scoring meshes. If you believe your simulation is unnecessarily slow, your application may have: –Memory leak –Geometry overlap Kernel III - M.Asai (SLAC)4

Geant4 v9.2p02 Most efficient way of simulating DICOM-like 3D voxels with material parameterization

Options you can take - 1 There is no silver bullet. You can try some/all of these options combined. Huge number of cells –If 3D parameterized volume with material parameterization is used, Compact memory size but slow in case of 1D optimization Fast but huge memory size in case of 3D optimization –Use replica for the first and second axes slices and 1-dimensional parameterization for the third axis. Use G4NestedParameterisation to parameterize the material. Material map –Though number of materials appear is quite limited, each cell must at least have a pointer to a material. I.e. you have to have a huge material map which has entries of the number of cells. –Split your whole voxel geometry into reasonable number of regions, and assign a dedicated stack to each region. For example 5*5*5 = 125 regions. –Load material map (from your file on the disk) only for one region. If a track reaches to the boundary of the region you are currently simulating, suspend the track. –Simulate all the tracks in one region. Once a region becomes empty, load material map for another region and simulate all tracks in that region. –Note that some tracks may come back to a region you have already simulated. Kernel III - M.Asai (SLAC)6

Options you can take - 2 Indexing organs –If you are accumulating, e.g. energy deposition, just for each organ rather than for individual voxels, you may overwrite GetIndex() method of G4PSEnergyDeposit scorer to return the organ index rather than the copy number of a voxel. Then the scorer creates a map of organ index and energy deposition. Thus reduces the size of map significantly. Event biasing –In particular, geometrical importance biasing, and secondary particle splitting must be good options to take. –You must validate results of your biasing options with full simulation. Shower parameterization –In stead of having a full EM shower, you may want to consider the shower parameterization in particular for the core part of the shower. Dedicated navigator –Given the geometry is perfectly regular, you may want to consider implementing a dedicated navigator that is absolutely simple-minded to handle just regular pattern of boxes of same size, thus quite fast. –Dedicated navigator for voxel geometry is under development. Parallelization –Allocate good number of CPUs… Kernel III - M.Asai (SLAC)7