Installing OpenMPI

403 views
Skip to first unread message

Allan

unread,
Jan 24, 2017, 1:25:16 PM1/24/17
to mpi4py
Hi,

I searched around and didn't find an OpenMPI google group (appreciate it if anyone can pointed me there), since my problem is more about OpenMPI than mpi4py.

I download the release tarball (release version 2.0.1) from openmpi and install it with the instructions here:

I choose OpenMPI in the mpi.cfg when installing mpi4py. 

python setup.py build --mpi=openmpi

I tested the mpirun command works. And when I tested the spawn function in mpi4py with a dummy test.py (printing 'hello') code, it gave the following error:


In [1]: from mpi4py import MPI


In [2]: mpiinfo = MPI.Info.Create()


In [3]: import sys


In [4]: comm= MPI.COMM_SELF.Spawn(sys.executable,args=['./test.py'],info=mpiinfo,maxprocs=1)

hello

---------------------------------------------------------------------------

Exception                                 Traceback (most recent call last)

<ipython-input-4-0f0df0acb1b0> in <module>()

----> 1 comm= MPI.COMM_SELF.Spawn(sys.executable,args=['./test.py'],info=mpiinfo,maxprocs=1)


MPI/Comm.pyx in mpi4py.MPI.Intracomm.Spawn (src/mpi4py.MPI.c:113260)()


Exception: MPI_ERR_SPAWN: could not spawn processes



I wonder if my way of installing OpenMPI is wrong or how I can fix this.


Thanks



Jason Maldonis

unread,
Jan 24, 2017, 2:11:58 PM1/24/17
to mpi...@googlegroups.com
Hi Allen,

OpenMPI has a mailing list that is pretty good:  https://www.open-mpi.org/community/lists/

Also, I have found that OpenMPI 1.10 is the most stable for spawning processes. I haven't seen the error you are getting before and I use OpenMPI + mpi4py for spawning jobs as well. I was getting a bunch of different errors under 2.x though.

It may be worth checking out this function I wrote that checks if your MPI and mpi4py are in-sync (it just checks which MPI version mpi4py was installed against and makes sure it's OpenMPI). You're also welcome to use the other files in that repo to test the spawning functionality. (There may also be some weird functionality with IPython + spawning, although hopefully not.)

Best,
Jason

--
You received this message because you are subscribed to the Google Groups "mpi4py" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+unsubscribe@googlegroups.com.
To post to this group, send email to mpi...@googlegroups.com.
Visit this group at https://groups.google.com/group/mpi4py.
To view this discussion on the web visit https://groups.google.com/d/msgid/mpi4py/15d23538-a705-4f9f-b430-3d451f319161%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Allan

unread,
Jan 24, 2017, 3:24:17 PM1/24/17
to mpi4py
Hi Jason,

Thanks a lot. Your code helped me identify my problem.

When I run check_mpi.py, the code fails at this line:

if mpiexec_path not in path:

It turns out the distutils.spawn.find_executable("mpiexec") path is different from the mpi4py.get_config().items() executable path.

I managed to make them the same, and the spawn function works now.

Thanks very much
To unsubscribe from this group and stop receiving emails from it, send an email to mpi4py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages