Skip to content

An idea: Extend mclapply's mc.set.seed with an initial seed value?

3 messages · Ivan Popivanov, Paul Gilbert, Brian Ripley

#
I appreciate your problem, and getting reproducible random generator 
results on a parallel system is something to be careful about. However, 
I would avoid making it too easy to have a fixed seed. In earlier days 
there were mistakes too often made by users inadvertently using the same 
seed over and over again (on simple single processor systems), for 
example, by reloading a session with the seed set.

Paul
On 12-11-01 08:46 PM, Ivan Popivanov wrote:
#
On Fri, 2 Nov 2012, Paul Gilbert wrote:

            
But R already makes what I take to be the wish really easy:

set.seed(123)
mclapply(...)

sets the same seed on each child.

And the other option, mc.set.seed = TRUE, makes it easy to have 
reproducibly different seeds on each child.  See 
?parallel::mcparallel .