Closed rdoddanavar closed 2 years ago
Is this going to be an issue? https://codingnest.com/generating-random-numbers-using-c-standard-library-the-problems/
Use python's multiprocessing
module to execute runs
numpy.random
for rng... can return numpy arrays of arbitrary shapepyDOE2
for LHS capabilityBe careful with numpy.random
; make sure RNG state is properly isolated between processes (import multiprocessing as mp
Use new instance of numpy.random.RandomState()
in each process to isolate RNG state(s)
Managing RNG state across processes, consequences on seeding:
Passing multiple arguments into map
for Pool:
Good solution are those above, in tandem with functools.partial
:
Use Philox
in numpy.random
to generate independent, uncorrelated streams: https://numpy.org/doc/stable/reference/random/parallel.html#independent-streams
CPP routine that generates random sequence given seed (int
) and desired distribution (string
), using the<random>
library: http://www.cplusplus.com/reference/random/Multiprocessing capability w/ RNG