Use of Ions in MT Makoto Asai 2013 Geant4 Collaboration Seville.

Slides:



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

How SAS implements structured programming constructs
Chapter 10 Introduction to Arrays
山下智弘 JST CREST/ 神戸大学 Borrowing especially from presentations of M. Asai(SLAC) Geant4 Japan Oct, RCNS, based on Geant4 9.0.p01.
Geant4 Collaboration WS1 Extension of Geant4 particles : hyper-nuclei / anti-nuclei 12 th Geant4 Collaboration Workshop Hisaya.
Geant4 v9.2p02 Particle Gun Makoto Asai (SLAC) Geant4 Tutorial Course.
Geant4 v9.2p02 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Primary particle generation Makoto Asai (SLAC) Geant4 Users CERN Nov. 12 th, 2002.
14 May 2011 Geant4 Tutorial Introduction J. Perl 1 Geant4 Tutorial University of Pennsylvania May 2011 A five day hands-on course based on Geant4.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Makoto Asai (SLAC) Geant4 Users CERN Nov. 15 th, 2002 Customizing Run Management.
Geant4 v9.4 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
10 January 2011 Geant4 Tutorial Introduction J. Perl 1 Geant4 Winter Course Tutorial Texas A&M University January 2011 A five day hands-on course.
Geant4 v9.3p01 Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course.
Review on pointers and dynamic objects. Memory Management  Static Memory Allocation  Memory is allocated at compiling time  Dynamic Memory  Memory.
1 Sharing Objects – Ch. 3 Visibility What is the source of the issue? Volatile Dekker’s algorithm Publication and Escape Thread Confinement Immutability.
Primary particle generation Makoto Asai (SLAC) Geant4 Users SLAC Feb. 18 th, 2002.
Some tips for geometries of medical applications Makoto Asai (SLAC)
Primary Particle Makoto Asai (SLAC) Geant4 Tutorial Course Geant4 v8.2p01.
The foreach LooptMyn1 The foreach Loop The foreach loop gives an easy way to iterate over arrays. foreach works only on arrays, and will issue an error.
Perl Tutorial Presented by Pradeepsunder. Why PERL ???  Practical extraction and report language  Similar to shell script but lot easier and more powerful.
GEant4 Parallelisation J. Apostolakis. Session Overview Part 1: Geant4 Multi-threading C++ 11 threads: opportunity for portability ? Open, revised and.
Physics I: Physics Lists Geant4 Tutorial at Jefferson Lab 10 July 2012 Dennis Wright (SLAC) Geant4 9.6 beta.
Use of Coverity & Valgrind in Geant4 Gabriele Cosmo.
Work_Geant4 Bo-Wen Shiou. #include "G4RunManager.hh“ #include "G4RunManager.hh“ #include "G4UImanager.hh" #include "G4UImanager.hh" #include "ExN01DetectorConstruction.hh“
Special Topics in Nuclear Physics, JU, Second Semester, (Saed Dababneh). 1 Course web or
Geant4 Physics List V.Ivanchenko Thanks to P.Gumplinger, M.Maire, H.P.Wellisch  General Physics  Electromagnetic Physics  Optical Photons  Hadronic.
Constructors CMSC 202. Object Creation Objects are created by using the operator new in statements such as… The following expression invokes a special.
Primary particle Giovanni Santin ESA / ESTEC and RheaTech Ltd On behalf of the Geant4 collaboration Ecole Geant4 Annecy, and Nov 2008 With.
MPI-3 Hybrid Working Group Status. MPI interoperability with Shared Memory Motivation: sharing data between processes on a node without using threads.
1 Physics I: Physics Lists Paris Geant4 Tutorial 4 June 2007 Marc Verderi Laboratoire Leprince-Ringuet (Heavily copied from D. Wright) Geant4 V8.3.
G4NuclideTable Koi, Tatsumi EPP SLAC National Accelerator Laboratory 1 Geant4 Radioactive decay mini workshop.
Monte Carlo /12/07. What is Geant ? Monte Carlo simulation tool for nuclear and particle physics Set up detectors –Sensitive detector which returns.
17-19 Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan Oct, 2007Geant4 Japan 2007 Geant4 Collaboration.
C Functions Three major differences between C and Java functions: –Functions are stand-alone entities, not part of objects they can be defined in a file.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Generating Primary Particles Each Geant4 Event starts with generation of one or multiple primary particles It is up to the user to define primary particle.
CBM Software Meeting 1 CBM Simulation & Analysis Framework Geant3 / Gean4 configuration M. Al-Turany, D. Bertini.
Meeting goals Makoto Asai and Marc Verderi 2013 Geant4 Collaboration Meeting Seville, Spain.
C++ 程序语言设计 Chapter 12: Dynamic Object Creation. Outline  Object creation process  Overloading new & delete.
CMSC 202 Advanced Section Classes and Objects: Object Creation and Constructors.
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
Chapter 6: Function Introduction to function Standard functions User defined functions –function prototype –function definition Function call Storage classes.
Geant4-MT migration and UI issues K. Murakami (KEK/CRC) Sep/11/201217th Geant4 Collaboration meeting1.
WORK Bo-Wen Shiou. GNUmakefile GNUmakefile XXX.cc (ex:try03.cc) XXX.cc (ex:try03.cc) include folder (xxx.hh) include folder (xxx.hh) src folder (xxx.cc)
V.Ivanchenko Salamanca1 Geant4: Electromagnetic Processes 1  Introduction  Interfaces  PhysicsList  Optical process.
General introduction of version 10.1 and prospect Makoto Asai SLAC PPA/SCA January 14th, Geant4 Technical Forum.
Physics I: Physics Lists Puebla Geant4 Tutorial 15 June 2010 Dennis Wright Geant4 V9.3.p01.
Geant4 Training 2003 Primary Particle Generation The full set of lecture notes of this Geant4 Course is available at
General Introduction and prospect Makoto Asai (SLAC PPA/SCA)
The ArrayList Data Structure Standard Arrays at High Speed!
Toward Geant4 version 10 Makoto Asai (SLAC PPA/SCA) For the Geant4 Collaboration Geant4 Technical Forum December 6 th, 2012.
1 Exercises 0 Go inside the “hadrontherapy” directory: cd hadrontherapy Copy the Hadrontherapy example to your home folder: cp –r $G4INSTALL/examples/advanced/hadrontherapy.
Chapter 6 Limited Direct Execution Chien-Chung Shen CIS/UD
Makoto Asai.  Parallel layered mass geometry  Other minor improvement  G4Exception.
Maria Grazia Pia Retrieving information from kernel Acknowledgements: A. Lechner, J. Apostolakis, M. Asai, G. Cosmo, A. Howard.
Object Lifetimes and Dynamic Objects Lecture-7. Object Lifetimes and Dynamic Objects External (Global) Objects Persistent (in existence) throughout the.
Makoto Asai.  In the past, material is considered only if it appears in the mass (tracking) world. The user might define parallel world(s) for artificial.
Code improvement: Coverity static analysis Valgrind dynamic analysis GABRIELE COSMO CERN, EP/SFT.
Chapter 5 Conclusion CIS 61.
This pointer, Dynamic memory allocation, Constructors and Destructor
Physics I: Physics Lists
Object Oriented Programming in java
Marc Verderi GEANT4 collaboration meeting 01/10/2002
Customizing Run Management
Kernel Author: Makoto Asai.
Primary particle Makoto Asai (SLAC Computing Services)
slides created by Ethan Apter and Marty Stepp
Monte Carlo /12/25.
Dynamic Binary Translators and Instrumenters
Presentation transcript:

Use of Ions in MT Makoto Asai 2013 Geant4 Collaboration Seville

Split class – case of particle definition In Geant4, each particle type has its own dedicated object of G4ParticleDefinition class. – Static quantities : mass, charge, life time, decay channels, etc., To be shared by all threads. – Dedicated object of G4ProcessManager : list of physics processes this particular kind of particle undertakes. Physics process object must be thread-local. G4ParticleDefinition -G4double mass -G4double charge -G4double life time -Decay table -G4int particleIndex -G4double mass -G4double charge -G4double life time -Decay table -G4int particleIndex G4PartDefSplitter -Array of TLS pointers of G4ProcessManager -TLS pointer TLS pointer G4ProcessManager -Proc man* -Process A* -Process B* -Process C* -Process D* 2 Use of Ions in MT - Makoto Asai2 TLS pointer of process manager for each particle type General ions share the same index with G4GenericIon

Use of Ions in MT With the following minor restrictions, ions could be instantiated on the fly. – G4GenericIon must be defined in the physics list. – Ions to be created on the fly must be "general ions" that are the objects of G4Ions class and share exactly the same G4ProcessManager object with G4GenericIon. So-called light ions are not included in this general ion category. They have to be pre-defined. Actually these light ions are automatically pre-defined if G4GenricIon is defined. G4ParticleDefinition has a new method IsGeneralIon(), that returns true if the particle is general ion that share the G4ProcessManager object with G4GenericIon. G4GenericIon itself is not included. – Such ions must be created through G4IonTable::GetIon() methods. No direct instantiation of G4Ions class object is allowed. – Creating an ion on the fly costs some performance penalty. Geant4 kernel will consult to G4NuclideTable (new class, Tatsumi and Dennis are working on it) about the creation of "default" ions before the event loop. We expect the number of such "default" ions to be reasonably small so that they won't cause much of the memory consumption problem, but it should be tunable on use-cases (again, Tatsumi and Dennis are working on it). Use of Ions in MT - Makoto Asai3

Before/During run_initialization in master thread Use of Ions in MT - Makoto Asai4 G4MTRunManager G4MTRun ManagerKernel PhysicsList Detector Construction instantiate SetPhysics() ConstructParticle() Construct() ConstructPhysics() SetCuts() G4ParticleTbl / G4IonTable SetObjectID() InitializePhysics() ConstructIons()

Particle iterator is now intelligent G4ParticleTable::G4PTblDicIterator* theParticleIterator = G4ParticleTable::GetParticleTable()->GetIterator(); theParticleIterator->reset(); while( (*theParticleIterator)() ) { G4ParticleDefinition* particle = theParticleIterator->value(); If the particle iterator is reset() without an argument, it skips general ions. If it is reset(false), it iterates also with all general ions that are registered to the G4ParticleTable so far. Use of Ions in MT - Makoto Asai5

How G4IonTable::GetIon() works in worker thread Use of Ions in MT - Makoto Asai6 GetIon() Found ? register Y N GetIon() Found ? return YN register CreateIon() Operations in shared objects (Mutexed) Operations in thread-local objects

Warning message WWWW G4Exception-START WWWW *** G4Exception : PART11117 issued by : G4ParticleTable::FindIon() This method is obsolete and will be dropped from v10.0. Use G4IonTable::FindIon(). *** This is just a warning message. *** WWWW G4Exception-END WWWW GetIon() and FindIon() methods in G4ParticleTable are obsolete and should not be used any more. Use equivalent (and enhanced) methods in G4IonTable. G4ParticleTable::GetParticleTable() -> GetIon(…); Should be replaced by G4IonTable::GetIonTable() -> GetIon(…); Currently, this warning message is issued. Soon these methods will be actually removed, so that classes that still use these methods won’t compile any more. Use of Ions in MT - Makoto Asai7

A request Don’t do ionTable -> GetIon(“ion_name”) -> GetMass(); ionTable -> GetIon(A, Z, lvl) -> GetMass(); Instead, do ionTable -> GetMass(“ion_name”); ionTable -> GetMass(A, Z, lvl); GetIon() method creates an ion object. If the mass is the only information you need, don’t create the ion. For the full list of GetIon(), FindIon(), GetMass() and other methods on ions, please consult to G4IonTable class. Use of Ions in MT - Makoto Asai8