简体   繁体   English

mpi4py仅在mpiexec下工作

[英]mpi4py only works under mpiexec

I have set up mpi4py on a new server, and it isn't quite working. 我在新服务器上设置了mpi4py ,但运行不正常。 When I import mpi4py.MPI , it crashes. 当我导入mpi4py.MPI ,它崩溃了。 However, if I do the same thing under mpiexec , it works. 但是,如果我在mpiexec下执行相同的操作,它将起作用。 On my other server and on my workstation, both techniques work fine. 在我的另一台服务器和工作站上,两种技术都可以正常工作。 What am I missing on the new server? 我在新服务器上缺少什么?

Here's what happens on the new server: 这是在新服务器上发生的事情:

$ python -c 'from mpi4py import MPI; print("OK")'
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  PMI2_Job_GetId failed failed
  --> Returned value (null) (14) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like orte_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during orte_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here's some additional information (which may only be relevant to an
Open MPI developer):

  orte_ess_init failed
  --> Returned value (null) (14) instead of ORTE_SUCCESS
--------------------------------------------------------------------------
--------------------------------------------------------------------------
It looks like MPI_INIT failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during MPI_INIT; some of which are due to configuration or environment
problems.  This failure appears to be an internal failure; here's some
additional information (which may only be relevant to an Open MPI
developer):

  ompi_mpi_init: ompi_rte_init failed
  --> Returned "(null)" (14) instead of "Success" (0)
--------------------------------------------------------------------------
*** An error occurred in MPI_Init_thread
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL (processes in this communicator will now abort,
***    and potentially your MPI job)
[Octomore:45430] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!

If I run it with mpiexec , it's fine. 如果我使用mpiexec运行它,那很好。

$ mpiexec -np 1 python -c 'from mpi4py import MPI; print("OK")'
OK

I'm running on CentOS 6.7. 我在CentOS 6.7上运行。 I've installed Python 2.7 as a software collection, and I've loaded the openmpi/gnu/1.10.2 module. 我已经安装了Python 2.7作为软件集合,并且已经加载了openmpi/gnu/1.10.2模块。 MPICH and MPICH2 are also installed, so they may be conflicting with OpenMPI. MPICH和MPICH2也已安装,因此它们可能与OpenMPI冲突。 I haven't loaded the MPICH modules, though. 我还没有加载MPICH模块。 I'm running Python in a virtualenv: 我在virtualenv中运行Python:

$ pip list
mpi4py (2.0.0)
pip (8.1.2)
setuptools (18.0.1)
wheel (0.24.0)

It turned out that mpi4py is not compatible with version 1.10.2 of OpenMPI. 事实证明, mpi4py与OpenMPI的1.10.2版本不兼容。 It works fine with version 1.6.5. 它与版本1.6.5正常工作。

$ module load openmpi/gnu/1.6.5
$ python -c 'from mpi4py import MPI; print("OK")'
OK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM