Miguel
Miguel

Reputation: 1

Problem using mpiexec with python and mpi4py

I have a PC with Linux OpenSuse Leap 15.3. I use python through Anaconda version 4.11.0. I have mpi4py installed but when I want to run a simple program like:

from mpi4py import MPI
comm = MPI.COMM_WORLD 
print("%d of %d" % (comm.Get_rank(), comm.Get_size()))

and I run the program using:

mpiexec -n 4 python3.8 nameofprogram.py

I get the following error:

Invalid error code (-2) (error ring index 127 invalid)

INTERNAL ERROR: invalid error code fffffffe (Ring Index out of range) in MPID_nem_tcp_init:373

Fatal error in PMPI_Init_thread: Other MPI error, error stack:

MPIR_Init_thread(586)..............:

MPID_Init(224).....................: channel initialization failed

MPIDI_CH3_Init(105)................:

MPID_nem_init(324).................:

MPID_nem_tcp_init(175).............:

MPID_nem_tcp_get_business_card(401):

MPID_nem_tcp_init(373).............: gethostbyname failed, localhost.localdomain (errno 1)

I have googled and this same problem has been reported other times, but I have not been able to get an answer that I can understand to solve the problem. Please, could someone help me?

Upvotes: 0

Views: 1179

Answers (1)

h3avyc0der
h3avyc0der

Reputation: 29

Instead of running it as mpiexec -n 4 python3.8 nameofprogram.py try to run it as mpiexec -n 4 python3 nameofprogram.py

Upvotes: 0

Related Questions