Message: Re: Question on accessing G4 from different threads Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Question on accessing G4 from different threads 

Forum: Multithreading
Re: Question Question on accessing G4 from different threads (Simon Spannagel)
Date: 01 Aug, 2018
From: Makoto Asai <Makoto Asai>

Hi,
BeamOn() does not only a simple event loop but also constructs cross-section tables, geometry voxelization, etc., that are shared over threads. Thus Geant4 is not designed to accept more than one BeamOn() simultaneously. For your use-case, I would suggest you to create your UserPrimaryGeneratorAction class that share a singleton vector of primary events. From your multithreaded framework, you can fill in primary events to this singleton vector using mutex.
Please note that this scenario works efficiently only if the speed of generating primary event is much faster than simulating one event with Geant4.
Hope this helps,
Makoto

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Question on accessing G4 from different threads   (Simon Spannagel - 01 Aug, 2018)
(_ Feedback: Re: Question on accessing G4 from different threads   (Jonathan Madsen - 01 Aug, 2018)
(_ None: Re: Question on accessing G4 from different threads   (Simon Spannagel - 01 Aug, 2018)
(_ None: Re: Question on accessing G4 from different threads   (Makoto Asai - 02 Aug, 2018)
 Add Message Add Message
to: "Re: Question on accessing G4 from different threads"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews