gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 00:14:26 32 4
gpt4 key购买 nike

我正在尝试通过 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/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com