Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] RFC: Add an __attribute__((destructor)) function to opal
From: Nathan Hjelm (hjelmn_at_[hidden])
Date: 2014-07-14 18:07:04


What: Add a library destructor function to OPAL. The new function would
take care of cleaning up some of OPAL's state (closing frameworks,
shutting down MCA, etc).

Why: OPAL can not currently be re-initialized. There are numerous
problems throughout the project that will make it difficult (but not
impossible) to get opal in a state where we can allow
re-initialization. Additionally, there are probably arguments against
making opal re-initable.

opal not being re-initializable would not normally be a problem except
that the following code sequence always crashes:

MPI_T_Init_thread (); <-- Calls opal_init_util()
MPI_T_Finalize (); <-- Calls opal_finalize_util()

MPI_Init (); <-- SEGV

This happens because MPI_T_Finalize() calls opal_finalize_util() to
ensure maximum valgrind cleanness. This call causes OPAL to tear down
OPAL classes (among other things) leading to the SEGV on the next call
to opal_init()/opal_init_util(). There is an open ticket on this issue:

https://svn.open-mpi.org/trac/ompi/ticket/4490

To fix this problem I want to add a destructor function to OPAL. This
function would take on some of the current functionality of
opal_finalize_util(). This would solve the above issue without having to
update OPAL to allow re-initialization.

For those not familiar with destructor functions. They are always called
at the end of execution or when the library is closed
(dl_close). Multiple destructors functions can be defined. Marking a
function as a destructor is simple:

void __attribute__((destructor)) foo (void);

When: Setting a timeout for next Friday (July 25).

-Nathan



  • application/pgp-signature attachment: stored