Displaying 1 result from an estimated 1 matches for "somehorrendousfunction".
2012 Jan 13
0
Example of "task seeds" with R parallel. Critique?
...## run on worker, so can retrieve seeds for particular run
initSeeds <- function(p = NULL){
currentStream <<- 1
projSeeds[[p]]
}
clusterEvalQ(cl, {
RNGkind("L'Ecuyer-CMRG")
})
clusterExport(cl, c("projSeeds", "useStream", "initSeeds"))
someHorrendousFunction <- function(run, parm){
currentStream <- 1
currentSeeds <- startSeeds <- initSeeds(run)
assign(".Random.seed", startSeeds[[currentStream]], envir = .GlobalEnv)
##then some gigantic, long lasting computation occurs
dat <- data.frame(x1 = rnorm(parm$N), x2 = rnor...