【问题标题】:doMPI error: There are not enough slots available in the system to satisfy the 2 slots that were requested by the applicationdoMPI 错误:系统中没有足够的可用插槽来满足应用程序请求的 2 个插槽
【发布时间】:2017-07-20 05:01:54
【问题描述】:

我正在尝试让 doMPI 包在我的本地机器上运行,以便在将作业提交到集群之前对其进行测试。我正在使用 Mac OSX Yosemite 并通过 brew 安装了 open mpi 2.0.2。

mpirun -V

mpirun (Open MPI) 2.0.2

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() 中取出 count=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

但是,您不能将 count=9 放入 startMPIcluster()

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

那么,或许在mac上测试mpi最好的方法就是不在startMPIcluster中设置count,而使用-H来控制任务数?

【问题讨论】:

    标签: r parallel-processing osx-yosemite openmpi dompi


    【解决方案1】:

    通过使用 mpirun -H localhost 选项,MPI Universe 大小仅为 1,这导致示例调用 startMPIclustermpi.comm.spawn 失败。如果您使用 -H localhost,localhost,localhost,则 Universe 大小将为 3,示例应该可以工作。


    更新

    请注意,当我在单台计算机上交互执行时(即,当我使用 mpirun 时),我只使用 count 参数调用 startMPIcluster。使用 mpirun 执行 doMPI 脚本时,我发现通过 mpirun 控制工作线程的数量更容易。

    【讨论】:

    • 这很好,谢谢!我做了一些实验只是为了看看 MPI 在 mac 上是如何工作的。只是为了记录,我将结果放在原始问题中。
    猜你喜欢
    • 2016-06-12
    • 1970-01-01
    • 2019-03-04
    • 2018-03-03
    • 2016-03-19
    • 2021-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多