Open DanChaltiel opened 1 year ago
This question was also asked at https://stackoverflow.com/q/75521357/1072091. I've answered it at https://stackoverflow.com/a/75543379/1072091.
Thank you very much for your answer on SO, this was very helpful and interesting.
I still think this should be mentioned in the documentation though.
The docs in ?furrr::future_options()
for Reproducible random number generation (RNG)
mention that random numbers are the same regardless of the parallel backend, but dont mention that it would be different from purrr::map()
, so I can add a sentence about that
Hi,
I am running simulations where some computing should be parallelized and some should not, and I am trying to figure out how to ensure that
purrr::map()
andfurrr::future_map()
yield the same result for a given seed.Reading the help of
furrr_options()
, I'm trying to figure out how to pass the signs tofuture_map()
, but this problem is not addressed specifically.For instance, consider the following code:
Created on 2023-02-22 with reprex v2.0.2
Using
seed=FALSE
,seed=TRUE
,seed=NULL
, or evenseed=42L
yielded different results (or errors), but none was right.Is there a way to pass the right seed to each parallel iteration of
furrr::future_map()
so that it yields the same result aspurrr::map()
?If yes, it might be worth clarifying in the documentation, and if not, could this be considered a new feature?