- edited description
cannot launch remote nodes
I am very new to mpi. I am trying to execute a simple python program on 2 ec2 nodes, by executing the command at the master node.
$mpiexec -np 2 -machinefile my_hostfile python3 hello.py
where my hostfile is:
172.31.31.50
172.31.29.12
and hello.py is:
import numpy
import sys
from mpi4py import MPI
from mpi4py.MPI import ANY_SOURCE
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
if rank==0:
print("doing task of node 0")
if rank==1:
print("doing the task of node 1")
My issue is that nothing is executed and the connection times out. I can ssh from each node to the other without using password. Further, the following command works well:
$ mpiexec -np 2 python3 hello.py
and executes the processes locally in both master and worker nodes.
Please let me know what I am doing wrong.
Thanks,
Saurav.
Comments (4)
-
reporter -
Please try run
mpiexec -n 2 -machinefile my_hostfile hostname
If that does not work, there is very little I can do to help you, the issue is not related to Python or mpi4py.
-
reporter Thanks for replying, I found the issue. It was related to EC2 instance initialization!
-
- changed status to invalid
- Log in to comment