Skip to content

Commit 0d3fe46

Browse files
committed
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. examples: add return 0 to sessions smoke test Signed-off-by: Howard Pritchard <[email protected]> (cherry picked from commit 70e51fe) (cherry picked from commit 6cf4dbe)
1 parent aa6bfb0 commit 0d3fe46

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

examples/hello_sessions_c.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ int main(int argc, char** argv) {
1111
MPI_Info info;
1212
MPI_Session s1, s2;
1313

14-
#if 0
15-
/* need PR https://github.com/open-mpi/ompi/pull/12868 to be merged in
16-
* before this can be uncommented.
17-
*/
1814
MPI_Info_create(&info);
19-
#endif
2015
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s1);
2116
MPI_Session_finalize(&s1);
2217
MPI_Session_init(MPI_INFO_NULL, MPI_ERRORS_RETURN, &s2);
2318
MPI_Session_finalize(&s2);
19+
MPI_Info_free(&info);
20+
return 0;
2421
}

ompi/instance/instance.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -954,13 +954,6 @@ static int ompi_mpi_instance_finalize_common (void)
954954

955955
ompi_mpi_instance_release ();
956956

957-
if (0 == opal_initialized) {
958-
/* if there is no MPI_T_init_thread that has been MPI_T_finalize'd,
959-
* then be gentle to the app and release all the memory now (instead
960-
* of the opal library destructor */
961-
opal_class_finalize ();
962-
}
963-
964957
return OMPI_SUCCESS;
965958
}
966959

0 commit comments

Comments
 (0)