本文介绍了Hello_World未在Cluster:II上与mpi4py一起玩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

再次尝试在本地群集上学习mpi4py.因此,我编写了一个hello_world程序,它将无法运行!我已经附加了.py代码和错误.有人可以指出我做错了吗?预先感谢.

Again, trying to learn mpi4py on the local cluster. I hence wrote a hello_world program, and it JUST WON'T RUN! I have attached the .py code, and the error. Could someone point out what I am doing wrong? Thanks in advance.

你好世界:

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

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

推荐答案

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

I'm not at all familiar with MPI4PY, but it looks like it requires a separate MPI installation as opposed to providing its own. Did you try installing one (MPICH, Open MPI, etc.) On most Linux systems, this is as easy as doing a quick

apt-get install mpich

或者不管您的口味的包装经理是什么.如果您想要最新和最好的,可以从项目的网站上获得相对简单的说明:

Or whatever your flavor's package manager is. If you want the latest and greatest, you can get relatively simple instructions from the projects' websites:

MPICH: www.mpich.org

打开MPI: wwww.open-mpi.org

这篇关于Hello_World未在Cluster:II上与mpi4py一起玩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 21:55