You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several papers/reports in the literature have documented that the limited PRNG stride in Monte Carlo codes can negatively impact results. For example, see the paper by Hakim and Fynan as well as the recent technical report by @cjosey. Currently, OpenMC uses a fixed stride of 152,917:
constexpruint64_t prn_stride {152917LL}; // stride between particles
For some problems (highly scattering media, deep penetration fixed source with variance reduction, subcritical multiplication with k close to 1), the stride in OpenMC would be easily exceeded, which calls into question the reliability of the results. At a minimum, we should allow the stride to be user-configurable so that for these types of problems, one can at least choose a longer stride.
Other Considerations
Since the total period of the PRNG is fixed, picking a longer stride means that the effective period between source particles is reduced. Longer term, for very large problems we probably ought to adopt a PRNG with a longer period to handle problems with lots of source particles.
Compatibility
We can make the stride user-configurable while maintaining the default value, which means there won't be any compatibility issues or changes in test results.
The text was updated successfully, but these errors were encountered:
Hi Paul, I am Arief the first author of the article.
Can I take a go at this?
We have a local branch already implemented this feature and initially planned to submit a PR (feature + theories) after the article is published.
Hi @ahman24, it was great to discuss this with Dr. Fynan at the latest ANS meeting! If you haven't already implemented it, it may also be useful to print a warning to the user if the stride is exceeded.
We already had a local branch that implements random number usage counter and throw warning whenever the stride is exceeded, but I am currently on a vacation. For now, we will submit a PR only for user-configurable stride and submit a follow up PR later after my vacation.
Description
Several papers/reports in the literature have documented that the limited PRNG stride in Monte Carlo codes can negatively impact results. For example, see the paper by Hakim and Fynan as well as the recent technical report by @cjosey. Currently, OpenMC uses a fixed stride of 152,917:
openmc/src/random_lcg.cpp
Line 13 in cfe210d
For some problems (highly scattering media, deep penetration fixed source with variance reduction, subcritical multiplication with k close to 1), the stride in OpenMC would be easily exceeded, which calls into question the reliability of the results. At a minimum, we should allow the stride to be user-configurable so that for these types of problems, one can at least choose a longer stride.
Other Considerations
Since the total period of the PRNG is fixed, picking a longer stride means that the effective period between source particles is reduced. Longer term, for very large problems we probably ought to adopt a PRNG with a longer period to handle problems with lots of source particles.
Compatibility
We can make the stride user-configurable while maintaining the default value, which means there won't be any compatibility issues or changes in test results.
The text was updated successfully, but these errors were encountered: