mercredi 13 janvier 2021

Random number seed for large number of Julia jobs

I have a Julia code, and I want to submit this code to a remote computing cluster via running a large number of jobs in parallel (i.e., around 10,000 jobs in parallel). The way this code works is that, the main function (call it "main.jl") calls another function (call it "generator.jl") which utilizes random numbers such as rand(Float64) and so on. The problem is I need to make absolutely sure that these random numbers are not correlated. If, in the beginning of main.jl, I write

@everywhere import Random.Random
@everywhere using Random.Random

Random.seed!(1234)

Will this ensure that none of the random numbers are correlated when I submit these jobs to the cluster? Will this generate a different random seed every time I submit main.jl to the cluster in my bash script; i.e., even if I submit N jobs in parallel via

#PBS -t 1-N

Is there an advantage to using MersenneTwister(12345) vs just Random.seed!(1234)? Just in case it matters, I have been using Julia 1.5.1 on the remote machine.




Aucun commentaire:

Enregistrer un commentaire