Poor performance on cluster multithreading

Actually there are two problems with this code:

  1. MersenneTwister() does not ensure that PRNGs are non-overlapping (although the risk of overlap is very small - but this is the reason why randjump is provided)
  2. The simplest you can do is either do deepcopy in each thread an element used by this thread of an array of initiated PRNGs in a single thread or use a “separator” object (one PRNG that is discarded to separate data in threads) similarly to what I proposed in KissThreading.jl/KissThreading.jl at master · mohamed82008/KissThreading.jl · GitHub. The discarding approach might not be best if you have NUMA issues in your infrastructure.
2 Likes