-
Notifications
You must be signed in to change notification settings - Fork 187
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
Remove ESPResSo system seed mechanism #3482
Conversation
Remove assignments to System.random_number_generator_state and System.seed. Remove calls to System.set_random_state_PRNG().
Discard the first 1'000'000 values of the RNG to escape Zeroland (see Figure 4 in Panneton et al. 2006).
Check out this pull request on You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB. |
Codecov Report
@@ Coverage Diff @@
## python #3482 +/- ##
========================================
Coverage ? 87%
========================================
Files ? 536
Lines ? 24400
Branches ? 0
========================================
Hits ? 21247
Misses ? 3153
Partials ? 0
Continue to review full report at Codecov.
|
|
src/core/polymer.cpp
Outdated
auto rng = [mt = std::mt19937{static_cast<unsigned>(seed)}, | ||
dist = std::uniform_real_distribution<double>( | ||
0.0, 1.0)]() mutable { return dist(mt); }; | ||
auto mt = Random::mt19937(static_cast<unsigned>(seed)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why you widened the scope of mt
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, I originally moved mt
out to discard the first 1 million values, but then I made a wrapper in random.hpp
to avoid the situation where MT would used without warmup. I'll put it back in the capturing group.
The polymer generation can fail, so it should not have a random seed. Why would you expect this to work? |
Why would the fixed seed in the test script generate correct positions in all machines except |
is that so? |
|
I wasn't sure, that's why I used "if". I'm looking through |
All thermostats are now Philox-based. The Mersenne Twister system seed infrastructure (global variables, MPI callbacks, Python bindings) is no longer needed.