Closed mgr327 closed 8 years ago
Thank you for reporting the issue. I think the problem is with parallel initialization of the random number generator. The generated C++ code runs fine without OpenMP: I will work on fixing the issue. Side note: I wonder how far HPAT.jl can go.
The issue is fixed with 8e0485a0db2d8a36237b35ecbe63a28aadea8ec6. Now different threads use different RNG engines with random seeds, which gives approximately independent streams. Here is the graph with ParallelAccelerator (with OpenMP):
Hello,
the following graph shows the standard deviation of the result vs the number of Monte Carlo steps. It seems that there is a problem with the convergence to the proper value of pi in the 'parallelized' code (green graph). The serial code convergence (blue graph) is OK. The red line is just 1/\sqrt{n} that is provided as a guide for the eye.
The calculation were done using the code from the pi example:
The version of Julia and the packages were as following:
julia> versioninfo() Julia Version 0.4.3 Commit a2f713d* (2016-01-12 21:37 UTC) Platform Info: System: Linux (x86_64-redhat-linux) CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz WORD_SIZE: 64 BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Sandybridge) LAPACK: libopenblasp.so.0 LIBM: libopenlibm LLVM: libLLVM-3.3
julia> Pkg.status("ParallelAccelerator")
julia> Pkg.status("CompilerTools")
The actual code used to produce the graph is as following: