1 / 16

Geant4 Application Grid Implementation Guide

Learn how to seamlessly run Geant4 applications on the GRID using DIANE, enabling distributed computing and fine-tuning for efficient simulation execution. Explore step-by-step processes and tools for monitoring, implementation, and debugging.

Download Presentation

Geant4 Application Grid Implementation Guide

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. How to run a Geant4 application on the GRID http://cern.ch/geant4

  2. Contents • Requirements • Software tools • Geant4 application design • Geant4 application implementation • How to run on the GRID

  3. Requirements • Same application code for sequential and parallel execution • Transparent execution in sequential/parallel mode • Transparent execution on a PC farm and on the Grid • Monitor the progress of the simulation execution • Traceability of failed tasks for debugging purposes

  4. Software tools Execution in distributed computing Monte Carlo simulation Analysis DIANE Abstract Interfaces for Data Analysis www.cern.ch/geant4 www.cern.ch/diane Physicist Interface (PI) aida.freehep.org lcg-pi.web.cern.ch/lcg-pi/ Component-based architecture software tools

  5. Hide complex details of underlying technology prototypefor an intermediate layer between applications and the GRID http://cern.ch/DIANE Developed by J. Moscicki, CERN/IT DIANE • R&D project • started in 2001 in CERN/IT with very limited resources • collaboration with Geant4 groups at CERN, INFN, ESA • succesful prototypes running on LSF and EDG Master-Worker architectural pattern Parallel cluster processing • make fine tuning and customisation easy • transparently using GRID technology • application independent By J. Moscicki (CERN)

  6. Application design Generic Geant4 application design • Transparent execution of the simulation • In sequential mode • In parallel mode Steering the simulation execution in the DIANE framework Initialize () ExecuteMacro () Finish () SetSeed() Encapsulate the essential actions to execute a simulation Initialize, Concrete class derived from IG4Simulation

  7. Implementation Example: geant4/examples/extended/parallel/ExDiane Derived from the Brachytherapy advanced example www.ge.infn.it/geant4/examples/index.html

  8. Main #include “BrachySimulation.hh” Int main(int argc, char** argv) { BrachySimulation* simulation = new BrachySimulation(0); simulation -> initialize(argc, argv); If (argc > 1) mn = argv[1]; simulation -> executeMacro(mn); simulation -> finish(); delete simulation; return 0; }

  9. BrachySimulation inherits from DIANE::IG4Simulation BrachySimulation.cc BrachySimulation::BrachySimulation(G4int seed) {…} BrachySimulation::~BrachySimulation() {} void BrachySimulation::setSeed(G4int sd) // Set the seed interactively { seed = sd; HepRandom::setTheSeed(seed); } G4bool BrachySimulation::initialize(int, char**) {…. runManager = new G4RunManager; runManager -> SetUserInitialization(detectorConstruction); runManager -> SetUserInitialization(physicsList); runManager -> SetUserAction(primaryParticles); …… runManager -> Initialize(); } void BrachySimulation::executeMacro(G4String fileName) { … } // Execution of the macro file void BrachySimulation::finish() {delete runManager;} DIANE::IG4Simulation* createG4Simulation(int seed) // This is all the application needs to run through DIANE {return new BrachySimulation(seed);} No other code changes

  10. Execution of a G4 application in a distributed environment

  11. Task 1 Task 2 Task n Practical Example • Example: simulation with analysis • The job is divided into tasks • The tasks are executed on worker components • Each task produces a file with histograms • Job result = sum of histograms produced by tasks • Master-worker model • Client starts a job • Workers perform tasks and produce histograms • Master integrates the results Start the execution Result Result 1 Result n

  12. Application = “G4Analysis” WorkerInitData = { ‘G4ApplicationcomponentName’ : “G4Brachy” ‘InitMacroFile’ : “”” /control/verbose 1 /run/verbose 1 /event/verbose 1 /run/initialize “”” } JobInitData = { ‘runParams’ : { ‘seed’ : 0, // Initial seed ‘eventNumber’ = 100000 // Total number of events of the job ‘macroFileTemplate’ : “/run/beamOn ”}, ‘eventsPerWorker’ : 10000 // The job is subdivided in 10 tasks ‘workerInit’ : WorkerInitData } Example of a macro

  13. Distributed computing resources

  14. Running on the GRID Master • DIANE is installed • Source the environment of DIANE • cd G4Myapplication • eval `diane.app.setup –e csh` • Execute the job: • diane.startjob –j macroFileName –w workers@LCG • –wms LCG_SITES_LIST --ganga Name of the macro file Result n Result 1 Number of workers List of the sites • Workers on the GRID • Geant4, AIDA and PI are preinstalled • DIANE and G4Brachy are downloaded from the web • DIANE and G4Brachy are installed • The tasks are executed The results of the tasks (analysis objects) are sent back to the Master

  15. Execution on the GRID through DIANE, 20 M events,180 tasks, 30 workers Worker number diane.plotprofile ID_job Time (seconds) Example of results On the Master • diane.workspace/jobs/ID_job • Contains the results of the simulation – analysis objects • profile.job contains the monitoring of the execution of the tasks

  16. Documentation Documentation on DIANE • http://www.cern.ch/diane • Installing and compiling DIANE • Compiling and running a Geant4 application through DIANE

More Related