|Message: Saving partial results||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
I'm running a simulation that includes movement. In my GeneratePrimaries, I offset the position of the initial particle by an amount that depends on the event number. The position of the particle is x(t), and t = N/Ntot where N is the event number of the current event and Ntot is the total number of events to be simulated. The quantity of interest is the energy deposited in different parts of the target, which I record using a G4PSEnergyDeposit.
I would like to make a "movie" of how the dose distribution develops as a function of time. That is, I want to save the output of the simulation every so many events. For the sake of example, let's say I'm simulating 1000 events and I want a snapshot of the output every 50. In single-threaded mode, I could simply make an EndOfEventAction to check the current event number N, and if (N % 50) == 0 I could fetch the deposited energy from my G4THitsMap and write it to file. In multithreaded mode this approach is not possible because each thread only has access to the events it happened to process, and only one of the threads will process the event that triggers the write.
Question 1: When a thread detects that (N % 50) == 0, is it possible to somehow merge all the events processed so far across all threads so that the output can be written to file?
Another approach could be to tell Geant4 "I want to simulate 1000 events - But start the run at event 400 and stop it at event 449!" That way the time dependence and merging would happen as normal, and I could just split the run into many sub runs that start and stop at the appropriate event numbers. The output would not be cumulative for each segment of the run like with the first approach, but this could be fixed by post-processing.
Question 2: Is there a convenient way to process only a subrange of the events in a run? Maybe a check in BeginOfEventAction to skip the entire event unless it is in the desired range. Can this be done?
Suggestions on other approaches are also welcome. I might very well be missing something obvious.
|Inline Depth:||Outline Depth:||Add message:|