2015-08-27 72 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) 
}