I had a problem running python Hello World mpi4py python code in a virtual machine.
Hello.py code:
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
print "hello world from process ", rank,"of", size
I tried to launch it using mpiexec and mpirun, but it does not work very well. Output:
$ mpirun -c 4 python hello.py
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
And from mpiexec:
$ mpiexec -n 4 python hello.py
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
hello world from process 0 of 1
They don't seem to get the title and size of comms. What can cause this? How to solve it?
mpiexec --version
mpiexec (OpenRTE) 1.6.5
mpirun --version
mpirun (Open MPI) 1.6.5
Ubuntu 14.04 system on Virtal Machine.
Any ideas why? Thank!
source
share