Skip to content

'parallel' package changes '.Random.seed'

1 message · Henric Nilsson (Public)

#
Dear Prof Ripley,

Thank you for your kind reply.  Please find my comments below.
I apologize for not expressing myself more clearly here.  I do not 
dispute whether it is necessary to call runif(1L) or not.

What I meant to ask was: Is it really necessary for 'parallel' to change 
'.Random.seed' when its namespace is loaded?
Yes, and are not relevant here.
But can't that action, i.e., choosing a random port in the 11000:11999 
range, be implemented so that it doesn't change '.Random.seed' when the 
namespace is loaded?
Thanks for the suggesting it.  This works nicely as shown in my earlier 
follow-up post, and makes the package pass its own test.

The downside is that this will require the same intervention from any 
other user relying on random number generation.
You're completely right, of course.

But I believe that it may lead to surprising behaviour for some 
unsuspecting users (me included), and should be avoided if possible. 
But maybe you're surprised, that I'm surprised?

I've looked at your implementation in the 'boot' package, where 
'parallel' is not explicitly imported and thus '.Random.seed' is 
untouched after loading the 'boot' namespace.  Is it preferable to not 
import 'parallel' and access the relevant 'parallel' functions using the 
'::' operator as you did there?  Please advise.
Thanks for reminding me -- an update is long overdue.

Before posting I checked the SVN repository and found that the relevant 
code in 'parallel' was the same as in the version I used.


Henric Winell