1 / 14

Sunanda Banerjee ( Saha Inst. Nucl . Phys., Kolkata, India)

IEEE Nuclear Science Symposium and Medical Imaging Conference Short Course The Geant4 Simulation Toolkit. Sunanda Banerjee ( Saha Inst. Nucl . Phys., Kolkata, India) Min Cheol Han ( Hanyang Univ., Seoul, Korea) Steffen Hauf (XFEL, Hamburg, Germany)

walker
Download Presentation

Sunanda Banerjee ( Saha Inst. Nucl . Phys., Kolkata, India)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IEEE Nuclear Science Symposium and Medical Imaging ConferenceShort CourseThe Geant4 Simulation Toolkit Sunanda Banerjee (Saha Inst. Nucl. Phys., Kolkata, India) Min Cheol Han (Hanyang Univ., Seoul, Korea) Steffen Hauf(XFEL, Hamburg, Germany) Maria Grazia Pia (INFN Genova, Italy) MariaGrazia.Pia@ge.infn.it Seoul, 27 October 2013 http://www.ge.infn.it/geant4/events/nss2013/geant4course.html This course encompasses training material developed by several Geant4 members: thanks to all of them!

  2. Geant4 MultiThreading

  3. Evolution of Computer Technology • Increase in CPU power used to be done by increasing frequency. This has reached a plateau because of power needs. So expectation in future trend in computer technology: • No major increase in single core performance • Many cores in a processor (double/2 year?) • Less memory per core • Need new software models to take these into account → increase parallelism • In Geant4 events are supposed to be independent. • Each event can be simulated separately • To keep backward compatibility with user code, multi-threading at event level is a natural choice for parallelism Geant4 Multithreading

  4. What is a thread? Sequential application Start N copies of application in the cores if they fit in memory Introduce shared objects to reduce overall memory consumption MT Application: master controls workers that do simulation Geant4 Multithreading

  5. Geant4 MT Model • Steps to be taken • Isolate static data structure from the dynamic one • Protect dynamic part of memory which can be shared among the working threads • A Geant4 (with MT) application can be seen as simple finite state machine • Threads do not exist before /run/beamOn. Master writes shared memory. When threads start they cannot change the shared memory No locking Geant4 Multithreading

  6. Geant4 MT Model Seeds pre-prepared per event in a “queue” Threads compete for next event to be processed Command line scoring and G4tools merge results from threads Geant4 Multithreading

  7. User Application in Sequential Model Geant4 Multithreading

  8. User Application in MT Mode Geant4 Multithreading

  9. Migration to MT (1) • Move user action class from main() to a new ActionInitialization class Geant4 Multithreading

  10. Migration to MT (2) Geant4 Multithreading

  11. Migration to MT (3) • Instantiate G4MTRunManager and replace the code moved in ActionInitialization with use of this class • If sensitive detectors are present separate their creation in a new function CreateSDandField() • A new utility function can be used: G4VUserDetectorConstruction::SetSensitiveDetector • If magnetic field is present, move it toCreateSDandField() Geant4 Multithreading

  12. Migration to MT (4) • Typically G4Allocator us used in Hit, Trajectory and TrajectoryPoint classes • Change static declarations to static G4ThreadLocal Geant4 Multithreading

  13. Computing Performance Deviation from linearity less than 6% Memory saving is better than 40% Geant4 Multithreading

  14. Physics Performance ATLAS TileCal MT reproduces sequential results faithfully Geant4 Multithreading

More Related