diff --git a/opal/runtime/opal_finalize.c b/opal/runtime/opal_finalize.c index 2563469ca6..9dd43ca263 100644 --- a/opal/runtime/opal_finalize.c +++ b/opal/runtime/opal_finalize.c @@ -25,6 +25,7 @@ #include "opal/mca/base/base.h" #include "opal/runtime/opal.h" #include "orte/include/orte_constants.h" +#include "opal/mca/memory/base/base.h" /** * Finalize the OPAL utilities @@ -37,6 +38,13 @@ int opal_finalize(void) { + /* close the memory manager components. Registered hooks can + still be fired any time between now and the call to + opal_mem_free_finalize(), and callbacks from the memory manager + hooks to the bowels of the mem_free code can still occur any + time between now and end of application (even post main()!) */ + opal_memory_base_close(); + /* finalize the mca */ mca_base_close(); diff --git a/opal/runtime/opal_init.c b/opal/runtime/opal_init.c index 3b69a9f534..f1267def5d 100644 --- a/opal/runtime/opal_init.c +++ b/opal/runtime/opal_init.c @@ -24,6 +24,7 @@ #include "opal/memory/memory.h" #include "opal/mca/base/base.h" #include "opal/runtime/opal.h" +#include "opal/mca/memory/base/base.h" /** * Initialize the OPAL utilities @@ -47,6 +48,12 @@ int opal_init(void) /* initialize the mca */ mca_base_open(); + /* open the memory manager components. Memory hooks may be + triggered before this (any time after mem_free_init(), + actually). This is a hook available for memory manager hooks + without good initialization routine support */ + opal_memory_base_open(); + return ORTE_SUCCESS; }