mpirun - 没有足够的插槽可用

kil*_*les 22 hpc mpi openmpi

通常当我使用mpirun时,我可以"超载"它,使用的处理器比我的计算机上的处理器多.例如,在我的四核mac上,我可以运行mpirun -np 29 python -c "print 'hey'"没问题.我现在在另一台机器上,这会引发以下错误:

$ mpirun -np 25 python -c "print 'hey'"
--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 25 slots 
that were requested by the application:
  python

Either request fewer slots for your application, or make more slots available
for use.
--------------------------------------------------------------------------
Run Code Online (Sandbox Code Playgroud)

为什么不"超频"mpirun在这里工作?有没有办法可以克服此错误消息并使用比可用处理器更多的处理器成功运行?

小智 33

显然可以通过mpirun使用"--oversubscribe"选项获得超额订阅 - 使用扭矩/毛伊为我做了诀窍

  • 这似乎比接受的答案好得多。请注意,“--oversubscribe”标志是 OpenMPI 3.x 的一项功能。OpenMPI 2.x 中不存在此标志,但这里默认允许超额订阅。 (2认同)

Har*_*ald 15

根据https://www.open-mpi.org/faq/?category=running#oversubscribing,您可以使用主机文件超额订阅您的节点.在继续之前,请注意这样会严重降低节点的性能.此外,如果用于运行应用程序的系统使用队列系统,则可能无效.

首先创建一个包含的宿主文件(名为hostfile)

localhost slots=25
Run Code Online (Sandbox Code Playgroud)

简单地运行您的应用程序

mpirun --hostfile hostfile -np 25 python -c "print 'hey'"
Run Code Online (Sandbox Code Playgroud)

  • 您引用的链接特别指出,不应声明比机器中可用的插槽更多的插槽。插槽应说明可用处理器的实际数量(或更少),并且要超额订阅,应使用“--oversubscribe”标志 (3认同)