Skip to content
Snippets Groups Projects
Commit 10ac887f authored by Sebastien Blaise's avatar Sebastien Blaise
Browse files

Fixed bug with MPI_FINALIZE when it was called by PETSc earlier

parent 1c6bf038
No related branches found
No related tags found
No related merge requests found
...@@ -185,6 +185,9 @@ void Msg::Exit(int level) ...@@ -185,6 +185,9 @@ void Msg::Exit(int level)
#if defined(HAVE_MPI) #if defined(HAVE_MPI)
// force general abort (wven if the fatal error occurred on 1 cpu only) // force general abort (wven if the fatal error occurred on 1 cpu only)
MPI_Abort(MPI_COMM_WORLD, level); MPI_Abort(MPI_COMM_WORLD, level);
int finalized;
MPI_Finalized(&finalized);
if (!finalized)
MPI_Finalize(); MPI_Finalize();
#endif #endif
FinalizeOnelab(); FinalizeOnelab();
...@@ -215,6 +218,9 @@ void Msg::Exit(int level) ...@@ -215,6 +218,9 @@ void Msg::Exit(int level)
PetscFinalize(); PetscFinalize();
#endif #endif
#if defined(HAVE_MPI) #if defined(HAVE_MPI)
int finalized; //Some PETSc versions call MPI_FINALIZE
MPI_Finalized(&finalized);
if (!finalized)
MPI_Finalize(); MPI_Finalize();
#endif #endif
FinalizeOnelab(); FinalizeOnelab();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment