From 70e51fed032ee50cf7110238f134cc9d5f423242 Mon Sep 17 00:00:00 2001 From: Howard Pritchard Date: Mon, 28 Oct 2024 11:32:01 -0600 Subject: [PATCH] sessions: make sure to only finalize class when there are no more refs to opal util layer. Update sessions smoke test to illustrate the issue in case this change gets reverted or undone by some future commit. Signed-off-by: Howard Pritchard --- examples/hello_sessions_c.c | 6 +----- ompi/instance/instance.c | 7 ------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/hello_sessions_c.c b/examples/hello_sessions_c.c index 863aaa1269e..50610e5f430 100644 --- a/examples/hello_sessions_c.c +++ b/examples/hello_sessions_c.c @@ -11,14 +11,10 @@ int main(int argc, char** argv) { MPI_Info info; MPI_Session s1, s2; -#if 0 -/* need PR https://github.com/open-mpi/ompi/pull/12868 to be merged in - * before this can be uncommented. - */ MPI_Info_create(&info); -#endif MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s1); MPI_Session_finalize(&s1); MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s2); MPI_Session_finalize(&s2); + MPI_Info_free(&info); } diff --git a/ompi/instance/instance.c b/ompi/instance/instance.c index 61a268545c2..a5f0b69b800 100644 --- a/ompi/instance/instance.c +++ b/ompi/instance/instance.c @@ -954,13 +954,6 @@ static int ompi_mpi_instance_finalize_common (void) ompi_mpi_instance_release (); - if (0 == opal_initialized) { - /* if there is no MPI_T_init_thread that has been MPI_T_finalize'd, - * then be gentle to the app and release all the memory now (instead - * of the opal library destructor */ - opal_class_finalize (); - } - return OMPI_SUCCESS; }