2015-08-27 41 views
0

我似乎已经在运行问题当试图中的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该建议以修复或重新安装msmpi.dll错误。你能不能让我知道什么是最好的prodecure将是解决这个问题

+0

你能把这些错误信息翻译成英文吗? –

+0

错误是因为我必须修复或重新安装msmpi.dll。系统输出此错误 – Barnaby

+0

以下是有关如何安装Rmpi的信息:https://bioinfomagician.wordpress.com/2013/11/18/installing-rmpi-for-rr-on-mac-and-windows/comment -page-1 / – bjoseph

回答

0

没有,RMPI产卵函数没有实现Windows。这是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) 
}