Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Types of change(s)
Checklist
make tests
)Description
It was found by @DusanJovic-NOAA (see below) that MAPL has broken externally-initialized MPI. The logic pretty much says "No you didn't" even if you did and, well, MPI stacks fail. Here we try and revive that functionality, though it is hard for us to test it.
The code change enforces "You better have initialized at
MPI_THREAD_MULTIPLE
" since, well, the current code seems to enforce that. I'm not sure if it is truly required or not. I'll consult @aoloso and @tclune to see.Note that also I am not sure what
ESMF_InitializePreMPI()
does other than what the docs say and if it should/can be called in both cases.Current GEOS-MAPL is:
ESMF_InitializePreMPI
MPI_Init_thread
ESMF_Initialize
but the NOAA-MAPL case here will be be:
MPI_Init_thread
MPI_Query_thread
ESMF_Initialize
The ESMF docs say:
So, I mean, it seems wrong to call
ESMF_InitializePreMPI()
in the NOAA case becauseMPI_Init_thread
has already been called. But I'm not sure what (if anything?) breaks in MAPL if one does not callESMF_InitializePreMPI
...Related Issue
ufs-community/ufs-weather-model#2399 (comment)