-
Notifications
You must be signed in to change notification settings - Fork 104
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
randomVector is buggy #97
Comments
Looks like it uses See this http://stackoverflow.com/questions/6161322/using-stdlibs-rand-from-multiple-threads |
|
This is a big problem! Perhaps we can fix randomVector using drand48 as suggested in SO. A temporary fix for random_vector_GSL would be also good even if it is slow. Thanks for the bug report. |
I have changed rand() to drand48_r. Can you check that it works now as expected? |
I haven't had a chance to test it, but wouldn't the use of |
Of course! I forgot that state. I will fix it. |
I have pushed a fix. I think I have removed all static variables. |
I can't compile it on my machine but it looks good.
|
Do you know the reason for the error? I have gcc 4.6.3 and it compiles without any warning. |
I'm on OSX, so my gcc is really clang:
|
I might also not have the build environment set up correctly. |
There is a new version using random_r(), I hope it works well on OSX. |
It seems that randomVector is not a deterministic function of the seed. It also seems that randomVector is not thread safe, I kept seeing it generate random NaNs in multithreaded code.
The text was updated successfully, but these errors were encountered: