You should get such a seed
reinterpret(Int32, Base.Random.GLOBAL_RNG.seed)
Test:
julia> srand(123456789); julia> reinterpret(Int32, Base.Random.GLOBAL_RNG.seed) 1-element Array{Int32,1}: 123456789
To save the restoration of the full state of rng, you can do a simple thing and just save the entire Base.Random.GLOBAL_RNG object. An easy way would be to use JLD .
In my private package I manually save / read the rng state on HDF5, see here .
EDIT: This, of course, is a more explicit version of @IainDunning's answer
source share