Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] adding new functions to a BTL
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-10-22 14:48:07


George reminds me that I forgot to explain why you couldn't dlsym....

We use lt_dlopen() to open the plugins (Libtool's wrapper for a
portable dlopen). It opens all plugins (DSOs) in a private scope.
That private scope is kept deep in the OPAL MCA base and not exposed
elsewhere in the code base. So if you manually dlopen a plugin again,
I'll bet that the linker realizes that that DSO has already been
loaded into the process space and doesn't actually load it again (but
doesn't fail). So the dlsyms fail because you don't have access to
the private scope from where Libtool originally opened the DSO.

Make sense?

On Oct 22, 2008, at 1:04 PM, Eugene Loh wrote:

> I'm trying to prototype an idea inside OMPI and am running into a
> problem.
>
> I want to add a new function to a BTL and to have the PML call this
> function. I can't just put such a function call into the PML (not
> even for my prototype) since the PML is loaded before the BTL and so
> the PML will complain about a missing symbol.
>
> So, the PML will just have to refer to the function symbolically and
> I need to figure out the BTL function address "at the appropriate
> time" (after the BTL is loaded but before I need to call my function).
>
> I tried to dlopen the BTL (seemed successful... I got back a non-
> NULL handle), but dlsym can't seem to find any of the symbols in the
> BTL (not even ones that existed before I started any of my work).
>
> I can describe other things I tried or other things I think are
> supposed to work (but that I am reluctant to try), but let's cut to
> the chase: HELP!
>
> Please note that I'm a newbie OMPI developer and so I'm really
> interested in doing the simplest thing possible to try my
> prototype. I recognize that certain things will have to be done to
> add "real code" back to the code base, but at this point I'd prefer
> to defer difficult work and just test the ideas of my prototype.
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel

-- 
Jeff Squyres
Cisco Systems