-
Notifications
You must be signed in to change notification settings - Fork 25
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
Multithreading causes random errors #189
Comments
Could you give more detail on how you run this code ? I have tried it with the last release and on master, and I don't get any error. Those are my specs
|
You will not get an error. Instead, you will get a random integer (on my windows pc with 6 cores around 5-7, on a friend's Macbook with 4 cores usually somewhat lower), which changes on consecutive runs. But the code should always return 1 deterministically, for every element in |
Oh I see. Looking at the "unique" results with full precision, I get : julia> using IntervalArithmetic
julia> @format full
Display parameters:
- format: full
- decorations: false
- significant figures: 6
julia> rts = unique(results)
4-element Vector{Any}:
Root{Interval{Float64}}[Root(Interval(0.9999999999999994, 1.0000000000000007), :unique)]
Root{Interval{Float64}}[Root(Interval(0.9999999999999997, 1.0000000000000007), :unique)]
Root{Interval{Float64}}[Root(Interval(0.9999999999999996, 1.0000000000000007), :unique)]
Root{Interval{Float64}}[Root(Interval(0.9999999999999994, 1.0000000000000004), :unique)] So it looks like by running on different processors we got slightly different numerical results (seems to be a 1 or 2 bits difference). It doesn't strike me as necessary a bug, since they are all correct results. I am not an expert in those details, however. |
This code works on master. |
The minimum working example below should always return 1. When using one thread, everything is fine, but as soon as I run the same code with multiple threads, random errors start creeping up.
I hope you could help identify the issue or find a possible workaround. Thank you for your time!
The text was updated successfully, but these errors were encountered: