可以将包 R.cache
与包 parallel
一起使用。
我正在做一些非常耗时的计算,我想在并行的同时使用缓存。
并行作业彼此独立。但是我无法在集群上加载 R.cache 包。
library(parallel)
library(R.cache)
cl <- makeCluster(getOption("cl.cores", 2))
clusterExport(cl,varlist = ls())
clusterEvalQ(cl, library(R.cache))
## Error in checkForRemoteErrors(lapply(cl, recvResult)) :
## 2 nodes produced errors; first error: there is no package called ‘R.cache’
最佳答案
这里没有关于R.cache
的特别之处。您需要确保 R.cache
安装在每个计算节点上。
是的,R.cache
可以工作并且设计用于并发系统。另见 https://github.com/HenrikBengtsson/R.cache/issues/18
(我是 R.cache
的作者)。
关于R:使用并行写入磁盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41058675/