Displaying 1 result from an estimated 1 matches for "maxkk".
Did you mean:
maxk
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
...ne with two cores. #################
library(foreach)
library(snow)
library(doSNOW)
testfun=function(){
options(digits.secs=6)
set.seed(slave.seed <- substring(Sys.time(), 21, 26))
a <- rnorm(5,0,1)
return(a)
}
maxkk <- 5
cl <- makeCluster(5, type = "SOCK")
registerDoSNOW(cl)
results=foreach (i = 1:maxkk, .combine = 'rbind') %dopar% testfun()
results
stopCluster(cl)
#################
2. Suppose I want to use *snow*, according to some reference, I need to use
*rsprng* as a generator. Doe...