Simplest way to do parallel replicate

后端 未结 3 1017
被撕碎了的回忆
被撕碎了的回忆 2020-12-14 16:33

I am fond of the parallel package in R and how easy and intuitive it is to do parallel versions of apply, sapply, etc.

Is the

3条回答
  •  一生所求
    2020-12-14 17:08

    This is the best I could come up with:

    cl <- makeCluster(getOption("cl.cores", 4))
    clusterCall(cl, replicate(50, simulate_fxns() ))
    stopCluster(cl)
    

提交回复
热议问题