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

Switch to pcg32 RNG #242

Merged
merged 3 commits into from
Jul 4, 2019
Merged

Switch to pcg32 RNG #242

merged 3 commits into from
Jul 4, 2019

Conversation

dhardy
Copy link
Collaborator

@dhardy dhardy commented Jul 3, 2019

This switches OpenMalaria to the PCG 64 generator (XSL RR 128 64 variant, aka pcg64). This generator has less predictable output than previously-used Mersenne Twister algorithm and performs extremely well in all RNG analysis algorithms I have seen. It is also faster and uses much less memory.

This change also switches to the boost::random distribution algorithms which are easier to work with. (We don't use C++11 distribution algorithms since the standard provides no guarantee of reproducibility of results, and the libstdc++ implementation is slower than Boost.) The disadvantage of this is that a Boost update may adjust random algorithm output (see https://stackoverflow.com/questions/56384275/known-differences-in-boost-random-output-from-1-58-to-1-67).

@dhardy dhardy changed the title Switch to pcg64 RNG Switch to pcg32 RNG Jul 4, 2019
@dhardy dhardy merged commit 5e4479e into SwissTPH:master Jul 4, 2019
@dhardy dhardy deleted the rng branch July 4, 2019 11:58
@dhardy
Copy link
Collaborator Author

dhardy commented Sep 5, 2019

Note: this uses PCG32 instead of PCG64 as originally planned, since there are problems building the latter with MSVC. PCG64 may have better performance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant