Skip to content

[Bioc-devel] reproducible with mclapply?

3 messages · Valerie Obenchain, Vladislav Petyuk, Kasper Daniel Hansen

#
I'll add a section to the BiocParallel docs.

Valerie
On 06/04/2015 07:55 AM, Kasper Daniel Hansen wrote:

  
    
#
The only bad thing I see so far in using set.seed inside the function is
that it interferes with previously set seed by the user.  So follow-up
stochastic computation will be out user's control.  Perhaps there are other
undesirable effect that I do not see at this point.
I tweaked the solution a bit here that wraps mclapply/lapply and maintains
the user control of stochasticity by resetting the seed to some random
value generated based on users input.
http://stackoverflow.com/questions/30610375/how-to-run-permutations-using-mclapply-in-a-reproducible-way-regardless-of-numbe/30627984#30627984
I tend to agree though that in a long run doRNG is the way to go.

On Thu, Jun 4, 2015 at 8:15 AM, Valerie Obenchain <vobencha at fredhutch.org>
wrote:

  
  
#
You're ignoring the fact that some random number generators should never be
used inside of mclapply(), period.  You should add that to your post and
you should show how to set the random number generator appropriately.

You seem to be only focusing on reproducibility of the code and not
correctness.

Kasper
On Thu, Jun 4, 2015 at 1:20 PM, Vladislav Petyuk <petyuk at gmail.com> wrote: