-
Notifications
You must be signed in to change notification settings - Fork 3
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
Test sometimes fail #7
Comments
And I thought no-one would notice... It's stochastic, so it fails at times. I certainly can adjust the tolerance. What would be a acceptable failure rate? |
Can't you initialize with an explicit random seed? |
Yes, that should work. But only for single threaded (which is all I test at the moment). Or is there a way to make threaded also deterministic? This simple test is not:
|
Maybe instead of
|
Cool, yes, that seems to work: using Random, Base.Threads
n = 1000
a = zeros(n);
@threads for i in 1:nthreads()
Random.seed!(Random.default_rng(), i)
end
@threads for i = 1:n
a[i] = rand()
end;
sum(a) # -> 511.1700285629997 I'm a bit surprised by this, as I thought that the RNG would be setup as in the docs, i.e. using several locations in one chain (i.e. using Do you know why the |
Nope, I know very little about the RNG stuff. Might be good to open an issue? |
All I know about RNGs is from the rabbit hole I just descended after wondering why the documentation-example used the randjump approach. I'll post a comment in JuliaLang/julia#32407 and open an issue otherwise. |
Issue JuliaLang/julia#34386 |
It seems the test:
sometimes randomly fail (perhaps the tolerance is too tight or something).
The text was updated successfully, but these errors were encountered: