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

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Fri, 02 Nov 2012 15:39:29 +0000 (GMT)

On Fri, 2 Nov 2012, Paul Gilbert wrote:

> 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.

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 .

>
> Paul
>
> On 12-11-01 08:46 PM, Ivan Popivanov wrote:
>> Hello,
>>
>> Have been thinking that sometimes users may want each process to initialize
>> its random seed with a specific value rather then the current seed. This
>> could be keyed off depending whether mc.set.seed is logical, preserving the
>> current behaviour, or numerical, using the value in a call to set.seed.
>> Does this make sense?
>>
>> If you wonder how I came up with the idea: I spent a couple of hours
>> debugging "unstable" results from parallel tuning of svms, which was caused
>> by the parallel execution. In my case I can simply do the set.seed in the
>> FUN argument function, but that may not be always the case.
>>
>> Ivan

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Fri 02 Nov 2012 - 15:42:45 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 04 Nov 2012 - 09:40:50 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive