Make the global RNG a Julia global variable instead of a libdSFMT variable #8399
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 is a follow-up of https://groups.google.com/forum/#!topic/julia-dev/0MUE8MoyO0k, where it is found that with simplistic benchmarks a global RNG controlled by Julia is no slower (and maybe slightly faster) than the one controlled by the dSFMT library (which is currently used by
rand()
with norng
argument).So this PR is to test more widely this assertion and find other possible problems.
Julia managing itself its global RNG may have advantages in a multi-threaded world (one "global" RNG per thread?). Are there any drawbacks? Note that an interface to the global RNG from libdSFMT can be kept (it just wouldn't be the default) if one really wants access to it.
This PR is built on #8380 (unmerged), and in fact adds only one small commit: I did the bare minimum so that everything builds and the tests pass. I certainly have missed things, please report problems.