Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] Problems in 1.3 loading shared libs when usingVampirServer
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2009-02-24 13:07:18

On Feb 24, 2009, at 11:32 AM, <michael.meinel_at_[hidden]> <michael.meinel_at_[hidden]
> wrote:

> 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".

Ah, ok. I wonder if you're not building properly. -lmpi is not
usually suffucient to build an Open MPI application; we hide a bunch
of flags inside mpicc you can see via mpicc --showme.

How does one add more ldflags to your script?

>>> To try it out yourself, please feel free to use the attached code.
>>> * Make sure to adapt the pathes to your OpenMPI implementation in
>>> * Run " 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
>> #else
>> return PyBool_FromInt(1);
>> #endif
>> I then was able to "./ install" properly. It looks like you
>> also need to setenv PYTHON_MPI_INIT to some non-empty value as well;
>> otherwise raises an error at import time.
> You source fix looks good, I will pass it to the minimpi maintainer.

Actually, as I got further, I see PyBool_FromInt() does not exist --
but PyBool_FromLong() does. Use that instead.

> 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.

Ah, I see -- it was ignoring the exception in what you initially sent,
which is why I ran into this issue.

> If you replace the following line in
> except ImportError: # couldn't load the .so
> with the following lines:
> except ImportError, e: # couldn't load the .so
> print e

Ok, now I'm getting the error:

>>> import minimpi
python: symbol lookup error: /home/jsquyres/bogus/lib/openmpi/ undefined symbol: mca_base_param_reg_int

I'd like to experiment with adding some other ldflags / libs into the
build process. How do I do that?

Jeff Squyres
Cisco Systems