gpt4 book ai didi

python - Hello_World 未在集群 :II 上使用 mpi4py

转载 作者:行者123 更新时间:2023-12-01 05:31:38 28 4
gpt4 key购买 nike

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

Hello World :

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

See here for the part-I of the question.

最佳答案

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

apt-get install mpich

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

MPICH:www.mpich.org

打开 MPI:wwww.open-mpi.org

关于python - Hello_World 未在集群 :II 上使用 mpi4py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20098651/

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