cannot launch remote nodes

Issue #90 invalid
saurav prakash created an issue

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)

  1. Lisandro Dalcin

    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.

  2. saurav prakash reporter

    Thanks for replying, I found the issue. It was related to EC2 instance initialization!

  3. Log in to comment