Skip to content
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

v2.1.x: oshmem: move finalisation to oshmem_onexit #2121

Merged

Conversation

ggouaillardet
Copy link
Contributor

…nexit()

so we can use the legacy start_pes even when Open MPI is compiled with
--enable-static or --disable-visibility

(back-ported from commit 92dd719)

@ggouaillardet ggouaillardet added this to the v2.1.0 milestone Sep 25, 2016
@jsquyres jsquyres changed the title v2.0.x: oshmem: move finalisation to oshmem_onexit v2.1.x: oshmem: move finalisation to oshmem_onexit Sep 26, 2016
@jsquyres
Copy link
Member

This is the v2.1.x version of #2120.

@ggouaillardet
Copy link
Contributor Author

for the record, my initial analysis was incorrect.

i thought shmem_finalize() was never invoked under the hood if legacy start_pes() is used.
i ran under the debugger and found that the destructor is indeed always invoked, even if only static libraries are built.
what i missed is that opal_class_finalize(), which is also a destructor, is invoked before shmem_finalize(), which was also a destructor, so shmem_finalize() crashes when destroying objects.
/* this is true at least when i compile with --disable-shared --enable-static --disable-dlopen and in my environment */

i do not know if/how destructors can be ordered in the case of static libraries.

having shmem_finalize() invoked at exit (via on_exit()) ensures it is invoked before opal_class_finalize() so everything is fine.

@igor-ivanov
Copy link
Member

@ggouaillardet see related comment at #2120 (comment)

@jsquyres
Copy link
Member

jsquyres commented Oct 4, 2016

We talked about this again on the call today. Everyone seems either neutral or ok with it: it solves a corner case that not many people will run into, but some will. So let's do it.

@ggouaillardet This needs to be rebased (perhaps because of the recent OSHMEM PRs?)

…nexit()

so we can use the legacy start_pes even when Open MPI is compiled with
--enable-static or --disable-visibility

(back-ported from commit 92dd719)
@ggouaillardet ggouaillardet changed the title v2.1.x: oshmem: move finalisation to oshmem_onexit v2.x: oshmem: move finalisation to oshmem_onexit Oct 5, 2016
@ggouaillardet ggouaillardet changed the title v2.x: oshmem: move finalisation to oshmem_onexit v2.1.x: oshmem: move finalisation to oshmem_onexit Oct 5, 2016
@ggouaillardet ggouaillardet force-pushed the topic/v2.x/oshmem_finalize_on_exit branch from 8cc14a0 to d9debb1 Compare October 5, 2016 00:37
@hppritcha
Copy link
Member

the travis failure is a known problem which has been fixed.

@hppritcha hppritcha merged commit 088ed04 into open-mpi:v2.x Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants