Hello_World not playing with mpi4py on Cluster:II

做~自己de王妃 提交于 2019-12-11 11:39:05

问题


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.

hello world:

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

error message:

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.


回答1:


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

Open MPI: wwww.open-mpi.org



来源:https://stackoverflow.com/questions/20098651/hello-world-not-playing-with-mpi4py-on-clusterii

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!