Hey guys, I'm trying to use mpi4py on my mac but I'm running into some problems. I'm just trying to get it up and running by running a simple helloworld program that runs on different processors.

When I run the command 'mpiexec -n 2 python helloworld.py' I'm getting a very long error message that starts out like:

A requested component was not found, or was unable to be opened.  This
means that this component is either not installed or is unable to be
used on your system (e.g., sometimes this means that shared libraries
that the component requires are unable to be found/loaded).  Note that
Open MPI stopped checking at the first component that it did not find.

If you guys would like to see the rest I could cut and paste it, but it is very long and I was going to see if anyone had an answer first.

If this is relevant typing 'which mpiexec' returns /usr/bin/mpiexec
a otool -L on MPI.so returns

/opt/local/lib/libmpi.1.dylib (compatibility version 2.0.0, current version 2.2.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)

I used sudo port install py27-mpi4py to set it up.

Thanks for your time guys!

Thank you for your reply, but I'm not working inside of sage. I did use the link you gave to try to fix the problem though but ran into another one. I used sudo port install openmpi to get the newest version of that... and then I just reinstalled mpi4py through pip and just through source. Now I am getting the error when I type the command 'from mpi4py import MPI':

ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpi4py/MPI.so, 2): Symbol not found: _ompi_mpi_logic
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpi4py/MPI.so
  Expected in: flat namespace
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mpi4py/MPI.so

A quick google search on the ompi symbol returned nothing. Can anyone help me? :(

Edited 4 Years Ago by fatalaccidents

I guess I had to install it telling it to use the new openmpicc because it was looking at /usr/bin/mpicc instead. Then I have to run it using openmpiexec. After that, it works. Thanks for your help though.

This question has already been answered. Start a new discussion instead.