Re: [Rd] Parallel number stream: clusterSetRNGStream

2019-06-07 Thread Henrik Bengtsson
Yes, I would think this behavior is intentionally, but obviously, I don't know for sure. Looking at the code: > parallel::clusterSetRNGStream function (cl = NULL, iseed = NULL) { cl <- defaultCluster(cl) oldseed <- if (exists(".Random.seed", envir = .GlobalEnv, inherits = FALSE))

[Rd] Parallel number stream: clusterSetRNGStream

2019-06-07 Thread Colin Gillespie
Dear All, Is the following expected behaviour? set.seed(1) library(parallel) cl = makeCluster(5) clusterSetRNGStream(cl, iseed = NULL) parSapply(cl, 1:5, function(i) sample(1:10, 1)) # 7 4 2 10 10 clusterSetRNGStream(cl, iseed = NULL) # 7 4 2 10 10 parSapply(cl, 1:5, function(i) sample(1:10,