-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hwloc symbol conflicts #6768
Comments
It sounds like the Mellanox Outside of that, though, I'm confused as to what the actual problem is.
I'm not quite clear on what the use case is for "I do not want to use the internal hwloc, but I'm ok using an external hwloc that is specific for Open MPI." Can you explain further? |
I think @markalle is out for a little while, so I talked to @jjhursey about this. He thinks that SMPI is in a case 3:
Which is why @markalle is proposing an hwloc |
@gpaulsen Does that fit with your understanding of the rationale? That was what I remembered of the discussion. |
Ick - that strikes me as violating a bunch of build "rules". I would advise we not support that model as it is pretty guaranteed to cause problems as you can't anticipate every corner case it might hit. Why not just do the right thing? Require they install hwloc - it's a simple dependency to add to the rpm or whatever packaging script you use. Solves the problem without creating potentially buggy changes. |
My concerns with the system installed libhwloc.so.# is putting restrictions on apps, and how it breaks in the current Mellanox environment. Mellanox put conflicting hwloc_* symbols into their libhcoll.so and if Mellanox made that mistake I'm concerned that a user's app might do the same. We could call that an app bug but even without the user explicitly building conflicting hwloc_* symbols into their app they could use a libhwloc.so.X from hwloc-1 while OMPI is using a libhwloc.so.Y from hwloc-2 and those symbols would conflict too. That's harder for me to call an app bug. I don't mind the internal opal_hwloc_* solution. I'm not actually sure if our PMIX build could follow suit and have both OMPI and PMIX using their own internal opal_hwloc_* or similar. That might work, but I don't really think it's better design than having a libhwloc_opal.so providing opal_hwloc_* symbols. I think symbol prefixing like that is only legitimate in two cases:
and if we have multiple products (OMPI, PMIX) that want access to prefixed symbols, then the shared library starts sounding more appealing to me. |
We will discuss this on next week's (July 9th) web-ex to try to make progress more quickly. |
@vspetrov FYI |
@artpol84 @vspetrov @jladd-mlnx Is this in an hcoll release? Should this be added to https://www.open-mpi.org/faq/? |
I want to open a topic for discussion about how we "should" solve it and hash out some agreement on our approach here before making a PR. There also may need to be some cross-product coordination on the solution.
summary of problem:
The issue is having multiple libraries linking against different versions of libhwloc.so, and having symbol conflicts between the hwloc versions that are ending up in the same namespace.
The first place we hit this bug was using Mellanox hcoll, although in principle this same conflict ought to happen if an end user has their app linked against a libhwloc. Anyway right now Mellanox ships a libhcoll.so that contains some form of statically built hwloc, so
nm libhcoll.so
includesand I think it's currently built against one of the hwloc-1.something versions.
If we build OMPI using --with-hwloc/--with-hwloc-libdir and a libhwloc.so at version hwloc-2.something all the symbols are piling into the same namespace and are stepping on each other.
Currently a build of OMPI using --with-hwloc will have libhwloc.so as a direct dependency all over the place in libmpi.so etc so the namespace isn't exclusively loaded by dlopen()/dlsym() and even if it was I think the current MCA loads are still RTLD_GLOBAL so I don't think we're currently very close to being able to expect OMPI's libhwloc.so to be dlopen()ed into a private namespace.
how to reproduce:
at the above hwloc2, and --with-hcoll= mellanox's hcoll library.
(I'm using MLNX_OFED_LINUX-4.3-1.0.1.0 at the moment but I suspect
other versions could reprodue as well)
For me a bunch of ranks will print
almost solution:
HWLOC has an option
that's a good start to avoiding conflicts.
And OMPI has a corresponding option
I think these get us 90% of the way to a solution, but I'm still concerned about the library name "libhwloc.so.15" for example. If OMPI built and used a libhwloc.so.15 that had the symbol_prefix switched to ompi_hwloc_* there's nothing keeping the user from having their own vanilla "libhwloc.so.15" built with regular hwloc_* symbols as part of their app.
So I think we also need to rename the libhwloc used by OMPI.
proposal:
Add another option to the HWLOC build system to rename its library, eg
And add a corresponding option to OMPI to use it, eg
that would cause various links that currently say -lhwloc to become -lhwloc_ompi
And I think Mellanox ought to use the existing
or something like that too otherwise the libhwloc they build into libhcoll.so has the potential to conflict with a user's app even if we make the above changes to OMPI.
Before I make an OMPI PR and hwloc PR I want to see if people agree this is the right approach. In our Spectrum MPI build of OMPI we started doing this already and it's working there.
I could imagine an alternate approach where we don't have anything in OMPI linked against libhwloc.so and instead rely on dlopen/dlsym from an MCA and have that done RTLD_LOCAL so we'd have considerable segregation and then maybe everybody could actually use "hwloc_*" symbols without conflict. But I lean toward changing the symbol prefix and the library name instead as the simpler solution.
The text was updated successfully, but these errors were encountered: