-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes related to multithreading #58
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… into lobis-prepare-for-multithreading
…-prepare-for-multithreading # Conflicts: # include/SteppingAction.h # src/SteppingAction.cxx
juanangp
reviewed
Sep 12, 2022
This reverts commit d6e7c81.
I think we should re-visit the multithreading because I think that some variables should be defined as |
juanangp
approved these changes
Sep 14, 2022
This was referenced Sep 18, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
multithreading
Related to Multithreading
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces significant changes necessary to allow for multithreading to work. It also introduces some minor features that appeared naturally along the way.
README has also been updated with a description of some of these features.
restG4
has new cli options:-t
to select the number of threads for multithreading-n
to select the number of generator events (and override the value on the rml file)-e
to select the "desired number of entries" so that the simulation will stop once this number of entries is achieved. In practise probably a few more entries will be saved on the file. The value ofnEvents
will be updated to the corresponding value of the number of simulated events.--time
to set a maximum simulation time. As the previous option the simulation will stop if more than the set time has elapsed. The value passed to this flag looks like:1h30m20s
,1m20s
,1h
,20s
, etc.Now the simulation can be stopped (via CTRL+C) and instead of crashing it will attempt to save results into disk, also updating the
nEvents
to the correct value.All examples have been updated to the changes described in rest-for-physics/geant4lib#59 and a new example has been added to validate primary generators (anyone is welcome to write more checks in this example). As mentioned in the Geant4lib PR, RML files that use the old naming conventions (
energyDist
instead ofenergy
etc.) should still work.Now we are using Geant4
SteppingVerbose
which allows to store the initial position of the track. This means a new hit type "Init" is saved for every track and means we can easily draw tracks. We don't need to find the last position of the previous track to draw the first point of the current track.StackingAction
is used to separate decays into subevents.Logic has been simplified and methods such as
EventAction::ReOrderTrackIds
have been removed, which increases simulation speed.After this PR multithreading should work (via the
-t
flag, such asrestG4 -t 4 simulation.rml
). Everything seems to work so far but the results have yet to be validated extensively. Using the same random seed with different number of threads will produce different results!