Random seeds in parallel computing

This I can’t answer and it seems to be complex. See this old discussion:

And this one not so old:

What you actually need now is different random numbers for each worker but reproducible… (still looking)

This looks good:

using Distributed
addprocs(4)
@everywhere using SharedArrays, Random

A = SharedArray{Float64}(10,10)
@everywhere Random.seed!(myid())
@sync @distributed for i in 1:10
    A[:,i] = rand(10)
end
1 Like