python - 通过 Python 在 MPI_Init 中启动 Open MPI 时出错

标签 python linux compilation openmpi

我正在尝试通过 python 使用 OpenMPI 访问共享库,但由于某种原因,我收到以下错误消息:

[Geo00433:01196] mca: base: component_find: unable to open /usr/li/openmpi/lib/openmpi/mca_paffinity_hwloc: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
[Geo00433:01196] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_carto_auto_detect: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
[Geo00433:01196] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_carto_file: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
[Geo00433:01196] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_mmap: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
[Geo00433:01196] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_posix: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
[Geo00433:01196] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_sysv: perhaps a missing symbol, or compiled for a different version of Open MPI? (ignored)
-------------------------------------------------------------------------
It looks like opal_init failed for some reason; your parallel process is
likely to abort.  There are many reasons that a parallel process can
fail during opal_init; some of which are due to configuration or
environment problems.  This failure appears to be an internal failure;
here is some additional information (which may only be relevant to an
Open MPI developer):

  opal_shmem_base_select failed
    --> Returned value -1 instead of OPAL_SUCCESS
--------------------------------------------------------------------------
[Geo00433:01196] [[INVALID],INVALID] ORTE_ERROR_LOG: Error in file runtime/orte_init.c at line 79
--------------------------------------------------------------------------
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 is some
additional information (which may only be relevant to an Open MPI
developer):

  ompi_mpi_init: orte_init failed
  --> Returned "Error" (-1) instead of "Success" (0)
--------------------------------------------------------------------------
*** An error occurred in MPI_Init
*** on a NULL communicator
*** MPI_ERRORS_ARE_FATAL: your MPI job will now abort
[Geo00433:1196] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed!

有什么线索吗?我已经检查了很多网页,但不知何故找不到解决我的问题的方法。

我安装了 Ubuntu 15.10 和 mpich 以及 open-mpi。

非常感谢你们!

最佳答案

我在 Ubuntu 16.04 上遇到了同样的问题(或者非常相似,但错误消息略有不同),即使只安装了 Open MPI。据我所知,Ubuntu 的 mpi4py 包的构建方式存在问题,但我不确定它到底是什么。

复制:由于问题并未完全清楚错误消息是如何产生的(我没有编辑它的声誉),所以我是这样得到它的。首先安装Ubuntu的mpi4py包,然后进入python环境:

$ sudo apt-get install mpi
$ python

在 python 中,尝试以下操作:

>>> from mpi4py import MPI

然后您应该会像 OP 一样收到一条错误消息。

解决方案:这是我如何让它工作的。首先卸载Ubuntu的包:

$ sudo apt-get remove mpi4py

然后安装 Open MPI 头文件(下一步涉及构建 mpi4py)和 pip:

$ sudo apt-get install libopenmpi-dev python-pip

最后安装mpi4py:

$ sudo pip install mpi4py

如果您尝试上面的 python 命令,它现在应该可以正常工作。

关于python - 通过 Python 在 MPI_Init 中启动 Open MPI 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36156822/

相关文章:

python - Pandas 按列值选择行,奇怪的行为

c++ - 有没有办法在Windows下编译为Linux编写的C++代码?

qt - 无法编译源代码-没有这样的文件或目录<libpq-fe.h>

c# - 编译会让我的敏感数据安全吗?

ios - 是否可以为iOS编译Potrace?

python - celery.utils.log.ProcessAwareLoggerobject 在 logging.Logger.manager.loggerDict 中做什么

python - 方案到 Python : most elegant translation of a recursive procedure?

python - 任何具有报告功能的测试Python框架

C - 如何从/dev/urandom读取数据到uint64_t变量中?

c++ - 编译过度对齐的动态分配变量时出现 icpc 错误