2017-03-01 143 views
1

我試圖讓我的本地機器上運行doMPI程序包,以便我可以在它之前對其執行測試將作業提交給羣集。我正在使用Mac OSX Yosemite並通過brew安裝了開放的mpi 2.0.2。doMPI錯誤:系統中沒有足夠的插槽可用於滿足應用程序請求的2個插槽

mpirun -V

mpirun (Open MPI) 2.0.2

Report bugs to http://www.open-mpi.org/community/help/

我已閱讀過引進了doMPI我試圖在演示

mpirun -H localhost R --slave -f sincMPI.R

不幸的是,我得到不斷收到以下錯誤執行的例子。我搜索了一下,但似乎無法弄清楚什麼可能是錯的。

> Loading required package: foreach Loading required package: iterators 
> Loading required package: Rmpi 
> -------------------------------------------------------------------------- 
> There are not enough slots available in the system to satisfy the 2 
> slots that were requested by the application: 
> /Library/Frameworks/R.framework/Resources/bin/Rscript 
> 
> Either request fewer slots for your application, or make more slots 
> available for use. 
> -------------------------------------------------------------------------- 
> Error in mpi.comm.spawn(slave = rscript, slavearg = args, nslaves = 
> count, : MPI_ERR_SPAWN: could not spawn processes Calls: 
> startMPIcluster -> mpi.comm.spawn -> .Call Execution halted 
> ------------------------------------------------------- 
> Primary job terminated normally, but 1 process returned a non-zero exit code.. 
>Per user-direction, the job has been aborted. 
> ------------------------------------------------------- 
> -------------------------------------------------------------------------- 
> mpirun detected that one or more processes exited with non-zero 
> status, thus causing the job to be terminated. The first process to do 
> so was: 
> 
> Process name: [[27630,1],0] Exit code: 1 

編輯:基於下面

答案曾任指定的測試的結果:

mpirun -H localhost,localhost,localhost R --slave -f sincMPI.R 

我從startMPIcluster()拿出數= 2,它也工作了。

startMPIcluster() #in sincMPI.R 
mpirun -H localhost,localhost,localhost R --slave -f sincMPI.R 

如果取出count = 2,則可以改變mpi run中的主機數量。在這裏我指定了四個主機。

startMPIcluster() #in sincMPI.R 
mpirun -H localhost,localhost,localhost,localhost R --slave -f sincMPI.R 

您甚至可以使用此方法來指定超過可用內核數量。我有8個(邏輯)內核,但我可以指定9個主機並運行。

mpirun -H localhost,localhost,localhost,localhost,localhost,localhost,localhost,localhost,localhost R --slave -f sincMPI.R 

但是,你不能把數= 9成startMPIcluster()

startMPIcluster(count=9) 
Error in startMPIcluster(count = 9) :  
    count must be either unspecified, or set to 8 
Execution halted 

所以,也許測試MPI在Mac上最好的辦法是在startMPIcluster不設定計數和使用-H來控制任務的數量?

回答

1

通過使用mpirun -H localhost選項,MPI Universe大小隻有一個,並且導致mpi.comm.spawn在示例調用startMPIcluster時失敗。如果您使用-H localhost,localhost,localhost,則Universe大小將爲3,並且該示例應該可以工作。


更新

注意在一臺計算機上的交互模式下執行時(也就是,當我使用的mpirun ),我只叫startMPIcluster與計數的說法。當使用mpirun執行doMPI腳本時,我發現通過mpirun控制工作人員的數量更容易。

+0

這工作得很好,謝謝!我做了一些實驗來看MPI如何在Mac上運行。爲了記錄,我將結果放在原始問題中。 –

相關問題