简体   繁体   English

并行计算问题

[英]Parallel computing problems

I seem to have run on a problem when trying to run a parallel computing in R 尝试在R中运行并行计算时,我似乎遇到了一个问题

library(parallel)
library(foreach)
library(doParallel)
library(snow)
cl <- makeCluster(detectCores())
Loading required package: Rmpi
Error : .onLoad failed in loadNamespace() for 'Rmpi', details:
call: inDL(x, as.logical(local), as.logical(now), ...)
error: unable to load shared object 'C:/Users/PCCasa/Documents/R/win-   library/3.2/Rmpi/libs/x64/Rmpi.dll':
LoadLibrary failure:  The system is unable to find the package specified.

Error in makeMPIcluster(spec, ...) : 
the `Rmpi' package is needed for MPI clusters.
registerDoParallel(cl)
Error in registerDoParallel(cl) : Object 'cl' not found

windowsproduces an error which advises to either repair or reinstall msmpi.dll. Windows产生一个错误,建议您修复或重新安装msmpi.dll。 Could you kindly let me know what the best prodecure would be as to solve this issue 请您让我知道解决这个问题的最佳方法是什么

None, the RMPI spawn function is not implemented for Windows. 没有,RMPI衍生功能未在Windows中实现。 Here is the excerpt of the RMPI code. 这是RMPI代码的摘录。

if (.Platform$OS=="windows"){
    #stop("Spawning is not implemented. Please use mpiexec with Rprofile.")
    workdrive <- unlist(strsplit(getwd(),":"))[1]
    workdir <- unlist(strsplit(getwd(),"/"))
    if (length(workdir) > 1)
        workdir <-paste(workdir, collapse="\\")
    else
        workdir <- paste(workdir,"\\")
    localhost <- Sys.getenv("COMPUTERNAME")
    networkdrive <-NULL #.Call("RegQuery", as.integer(2),paste("NETWORK\\",workdrive,sep=""), 
                    #PACKAGE="Rmpi")
    remotepath <-networkdrive[which(networkdrive=="RemotePath")+1]
    mapdrive <- as.logical(mapdrive && !is.null(remotepath))
    arg <- c(Rscript, R.home(), workdrive, workdir, localhost, mapdrive, remotepath)
    if (.Platform$r_arch == "i386") 
        realns <- mpi.comm.spawn(slave = system.file("Rslaves32.cmd", 
            package = "Rmpi"), slavearg = arg, nslaves = nslaves, 
            info = 0, root = root, intercomm = intercomm, quiet = quiet)
    else 
        realns <- mpi.comm.spawn(slave = system.file("Rslaves64.cmd", 
                    package = "Rmpi"), slavearg = arg, nslaves = nslaves, 
            info = 0, root = root, intercomm = intercomm, quiet = quiet)
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM