doMPI错误:系统中没有足够的插槽可用于满足应用程序请求的2个插槽
我试图让我的本地机器上运行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来控制任务的数量?
通过使用mpirun -H localhost
选项,MPI Universe大小只有一个,并且导致mpi.comm.spawn
在示例调用startMPIcluster
时失败。如果您使用-H localhost,localhost,localhost
,则Universe大小将为3,并且该示例应该可以工作。
更新
注意在一台计算机上的交互模式下执行时(也就是,当我使用的mpirun 不),我只叫startMPIcluster
与计数的说法。当使用mpirun执行doMPI脚本时,我发现通过mpirun控制工作人员的数量更容易。
这工作得很好,谢谢!我做了一些实验来看MPI如何在Mac上运行。为了记录,我将结果放在原始问题中。 –