1

再次尝试在本地集群上学习 mpi4py。因此,我编写了一个 hello_world 程序,但它不会运行!我附上了 .py 代码和错误。有人可以指出我做错了什么吗?提前致谢。

你好世界:

from mpi4py import MPI
comm=MPI.COMM_WORLD
print("Hello, World! My rank is: " + str(comm.rank))

错误信息:

Traceback (most recent call last):
 File "./MPI_Hello_World.py", line 1, in <module>
 from mpi4py import MPI

ImportError: libmpich.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "./MPI_Hello_World.py", line 1, in <module>
from mpi4py import MPI


ImportError: libmpich.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "./MPI_Hello_World.py", line 1, in <module>
from mpi4py import MPI

ImportError: libmpich.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "./MPI_Hello_World.py", line 1, in <module>
from mpi4py import MPI

ImportError: libmpich.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "./MPI_Hello_World.py", line 1, in <module>
from mpi4py import MPI

ImportError: libmpich.so.3: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "./MPI_Hello_World.py", line 1, in <module>
from mpi4py import MPI

ImportError: libmpich.so.3: cannot open shared object file: No such file or directory

有关问题的第一部分,请参见此处。

4

1 回答 1

2

我对 MPI4PY 一点也不熟悉,但看起来它需要单独的 MPI 安装,而不是提供自己的 MPI。您是否尝试安装一个(MPICH、Open MPI 等)?在大多数 Linux 系统上,这就像快速安装一样简单

apt-get install mpich

或者无论你的口味的包管理器是什么。如果您想要最新最好的,您可以从项目的网站获得相对简单的说明:

MPICH:www.mpich.org

开放 MPI:www.open-mpi.org

于 2013-11-20T15:44:19.800 回答