python-3.5 - 将 mpi4py 与 python3.5 结合使用

标签 python-3.5 openmpi ubuntu-16.04 mpi4py

我正在尝试将 mpi4py 与 python3.5 一起使用,我已经在 Ubuntu 16.04 上安装了 openMPI,然后安装了 mpi4py 模块。

当我尝试导入 mpi4py 时出现以下错误:

Python 3.5.2 (default, Jul  5 2016, 12:43:10) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from mpi4py import MPI
[ubuntu:31733] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_mmap: /usr/lib/openmpi/lib/openmpi/mca_shmem_mmap.so: undefined symbol: opal_show_help (ignored)
[ubuntu:31733] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_posix: /usr/lib/openmpi/lib/openmpi/mca_shmem_posix.so: undefined symbol: opal_shmem_base_framework (ignored)
[ubuntu:31733] mca: base: component_find: unable to open /usr/lib/openmpi/lib/openmpi/mca_shmem_sysv: /usr/lib/openmpi/lib/openmpi/mca_shmem_sysv.so: undefined symbol: opal_show_help (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's 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
--------------------------------------------------------------------------
--------------------------------------------------------------------------
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):

  opal_init failed
  --> Returned value Error (-1) 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 "Error" (-1) 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)
[ubuntu:31733] Local abort before MPI_INIT completed successfully; not able to aggregate error messages, and not able to guarantee that all other processes were killed

我该如何解决这个问题?

最佳答案

我通过执行以下操作解决了这个问题:

删除现有安装:

sudo apt-get remove openmpi-bin
sudo apt-get remove python3-mpi4py

重新安装

sudo apt-get install libopenmpi-dev
sudo pip3 install mpi4py
sudo apt install openmpi-bin

关于python-3.5 - 将 mpi4py 与 python3.5 结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38855734/

相关文章:

c - MPI_Reduce 数组表示十进制值 (C)

linux - 未找到 Ubuntu Xenial upstart 服务

python - 如何在 Ubuntu 16.04 上完全卸载 python 2.7.13

PHP CLI pcntl 在 PHP7.0 Ubuntu xenial 服务器中不工作

python - 减少巨大列表生成的执行时间

python - 在 Python 中注释 "file type"的正确方法

python - Pandas 数据框在满足双重标准时更改值

encryption - 自定义加密/解密程序中的错误

mpi - mpif90 和 mpifort 的区别

c++ - 从 C++ 调用 ScaLAPACK