Skip to content
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

Fix celer-g4 primary generator MT reproducibility #1057

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

amandalund
Copy link
Contributor

This reseeds the celer-g4 primary generator RNG for each event so MT results without Celeritas offloading are reproducible. It also fixes the check that num_events have been generated (which was based on the per-thread count rather than the total count).

@amandalund amandalund added bug Something isn't working app Application front ends labels Dec 9, 2023
Copy link
Member

@sethrj sethrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Good catch.

// thread across multiple runs. For reproducibility, Geant4 reseeds each
// worker thread's RNG at the start of each event with a seed calculated
// from the event ID.
rng_.seed(seed_ + event_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the primary generator RNGs are all std::mt1997, but we should consider some sort of wrapper interface that lets us do seed+stride for the XORWOW generators (and any others we implement in the future)

@sethrj sethrj merged commit 238b17c into celeritas-project:develop Dec 10, 2023
19 of 20 checks passed
@amandalund amandalund deleted the fix-primary-gen branch December 10, 2023 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app Application front ends bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants