Repository navigation
Add cmake HIDE_MPI flag to esmf_time_f90 build to prevent double mpi_finalize - #13
Conversation
|
@jamiebresch, do you mind pointing me to where the HIDE_MPI flag is normally added? I could not find it in We need to make mpas_finalize work in mpas-jedi, which requires that MPI_Finalize not be called from within internal MPAS subroutines. MPI initialization and destruction needs to be controlled at the top level in OOPS. I wonder if some ESMF subroutine is called during mpas_finalize, which in turn calls MPI_Finalize. That would be problematic. |
MPAS-Model/src/external/Makefile Line 6 in d33a772 |
Just to clarify, so far we have been unable to use mpas_finalize in mpas-jedi because an error message tells us that MPI_Finalize is being called. There is logic in mpas_dmpar_finalize to avoid such a call here for mpas-jedi simulations: MPAS-Model/src/framework/mpas_dmpar.F Line 348 in d33a772 So if ESMF is also calling MPI_Finalize, that is another place to look. |
|
Sorry @jamiebresch. I totally did not understand what the HIDE_MPI flag is doing. It actually forces the ESMF subroutine to NOT call MPI_Finalize, which is what we want. Then how do we add the There are similar lines in |
liujake
left a comment
There was a problem hiding this comment.
This seems to be an obvious bug in build. Thanks @jamiebresch to catch this. Not sure if this will solve our current MPAS_Finalize issue, but think it should be merged with no harm at least.
|
Oh I thought this was an issue, not a PR. Looks great! |
-DHIDE_MPI flag is required in building esmf_time_f90 to prevent calling mpi_finalize twice. The flag is in src/external/esmf_time_f90/Makefile and should be added in src/external/esmf_time_f90/CMakeLists.txt for cmake. This fixes the error message: `*** The MPI_Finalize() function was called after MPI_FINALIZE was invoked.` reported in JCSDA-internal/mpas-bundle#90
-DHIDE_MPI flag is required in building esmf_time_f90 to prevent calling mpi_finalize twice.
The flag is in src/external/esmf_time_f90/Makefile and should be added in src/external/esmf_time_f90/CMakeLists.txt for cmake.
This fixes the error message:
*** The MPI_Finalize() function was called after MPI_FINALIZE was invoked.reported in https://github.com/JCSDA-internal/mpas-bundle/issues/90