> > Upon further investigation, it seems to be a problem similar to
this:
> > http://www.open-mpi.org/community/lists/devel/2005/09/0359.php
> > The dynamic parts of the library are however no more linked against
> > their frameworks.

> I looked at your tarball -- I don't know anything about Python, so I  
> don't fully understand it.  Where does it load in libmpi?

The minimpi(.py) Python module loads the minimpiext(.c) module and calls
its minimpiext.init() method (defined in minimpiext.c) which in turn
calls MPI_Init(). "minimpiext.c" is linked against libmpi. Libmpi is
loaded as soon as Python evaluates "import minimpi".

> > To try it out yourself, please feel free to use the attached code.
> > * Make sure to adapt the pathes to your OpenMPI implementation in
> > setup.py
> > * Run "setup.py install"
> > * Start Python
> > * type "import minimpi" and the application should crash.

> I had to change your code slightly for my version of python (probably

> ancient -- whatever ships in RHEL4):
>
> #if 0
>          Py_RETURN_TRUE;
> #else
>          return PyBool_FromInt(1);
> #endif
>
> I then was able to "./setup.py install" properly.  It looks like you  
> also need to setenv PYTHON_MPI_INIT to some non-empty value as well;  
> otherwise minimpi.py raises an error at import time.

You source fix looks good, I will pass it to the minimpi maintainer.
BUT: The PYTHON_MPI_INIT environment variable is used to control our
patched Python interpreter and should not be needed. The exception is
generated just after the loading of the minimpiext(.c) module already
failed.

If you replace the following line in minimpi.py:

    except ImportError: # couldn't load the .so

with the following lines:

    except ImportError, e: # couldn't load the .so
        print e

you should get an idea why loading minimpiext failed in the first place.
These might be other incompatibilities of your platform as we usually
require Python 2.4 in our project.

Regards, Michael Meinel

Reply via email to