问题
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