Sobol.jl icon indicating copy to clipboard operation
Sobol.jl copied to clipboard

benchmark/compare against Burkardt's implementation

Open stevengj opened this issue 9 years ago • 6 comments

It would be interesting to compare against this implementation, both for correctness and performance.

stevengj avatar Sep 18 '15 02:09 stevengj

@Ken-B, if you feel like taking a crack at this, it would be much appreciated.

stevengj avatar Sep 18 '15 11:09 stevengj

That's quite a challenge for me, as I've never compiled c++ before. However, with the help of Google I've compiled his code and the example runs. Now I'm trying to build Cxx.jl. I'll keep you posted if any results. Fingers crossed!

Ken-B avatar Sep 18 '15 14:09 Ken-B

Oh, if it's a bother for you, I can do it myself at some point; I was just thinking of calling/benchmarking it in C++, not in Julia. But I thought you might enjoy taking a crack at it.

stevengj avatar Sep 18 '15 15:09 stevengj

No bother, it's a welcome challenge. I wanted before to check out Cxx.jl and this seems like a perfect opportunity. Im just saying that it's uncharted territory for me so I don't know if I'll manage.

Ken-B avatar Sep 18 '15 16:09 Ken-B

Cxx.jl requires llvm-svn or llvm 3.7.0, but I keep getting build errors on my mac. I've tried different versions of xcode. Where could I go to get help on that?

I don't think I would be able to manage this soon.

Ken-B avatar Sep 25 '15 09:09 Ken-B

I ran a little test using this C++ benchmark program. I benchmarked the Julia code using

function nth(s, n)
          x = Vector{Float64}(ndims(s))
          for i = 1:n
             next!(s, x)
          end
          return x
end

to compute the n-th element of a Sobol sequence.

The good news is that the answers match ours in all the cases I tried, and the performance is within a factor of 2.

The bad news is that we are up to 2x slower, so we are leaving some performance on the table. (Note that the C++ code is returning single-precision vectors, whereas we are returning double precision; this is a slight advantage, but I doubt it explains most of the difference.)

stevengj avatar Mar 29 '17 01:03 stevengj