为什么R mclapply可在Mac上运行,而不能在PC上运行?

时间:2019-07-26 15:31:03

标签: r windows macos multicore

我想知道为什么会这样(例如,机器架构,软件细节等)

我已成功实施:

https://www.r-bloggers.com/implementing-mclapply-on-windows-a-primer-on-embarrassingly-parallel-computation-on-multicore-systems-with-r/

# it will NOT work on Windows:

# check if "parallel" is installed
if (!"parallel" %in% rownames(installed.packages())) {install.packages("parallel")}

# attempt to use the "mclapply"
res_out <- mclapply(1:10, function(i) {bb <- i ^ 2; return(bb)})

# see the result
print(unlist(res_out))

我目前没有Windows,但是我相信代码不会像我们在Windows 10上所尝试的那样在Windows上运行。

0 个答案:

没有答案