Skip to content

Commit

Permalink
Merge pull request #2972 from GEOS-ESM/release/v2.46
Browse files Browse the repository at this point in the history
Hotfix: Fix support for external MPI
  • Loading branch information
mathomp4 authored Aug 16, 2024
2 parents d444793 + e0087ba commit d4b541e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.47.2] - 2024-08-16

### Fixed

- Fix bug in supporting externally initialized MPI

## [2.47.1] - 2024-07-17

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

project (
MAPL
VERSION 2.47.1
VERSION 2.47.2
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF

# Set the possible values of build type for cmake-gui
Expand Down
16 changes: 9 additions & 7 deletions gridcomps/Cap/MAPL_Cap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,19 @@ subroutine initialize_mpi(this, unusable, rc)

_UNUSED_DUMMY(unusable)

!call MPI_Initialized(this%mpi_already_initialized, ierror)
!_VERIFY(ierror)
call ESMF_InitializePreMPI(_RC)
call MPI_Initialized(this%mpi_already_initialized, ierror)
_VERIFY(ierror)

if (.not. this%mpi_already_initialized) then
call ESMF_InitializePreMPI(_RC)
call MPI_Init_thread(MPI_THREAD_MULTIPLE, provided, ierror)
_ASSERT(provided == MPI_THREAD_MULTIPLE, 'MPI_THREAD_MULTIPLE not supported by this MPI.')
! call MPI_Init_thread(MPI_THREAD_SINGLE, provided, ierror)
! _VERIFY(ierror)
! _ASSERT(provided == MPI_THREAD_SINGLE, "MPI_THREAD_SINGLE not supported by this MPI.")
else
! If we are here, then MPI has already been initialized by the user
! and we are just using it. But we need to make sure that the user
! has initialized MPI with the correct threading level.
call MPI_Query_thread(provided, ierror)
end if
_ASSERT(provided == MPI_THREAD_MULTIPLE, 'MPI_THREAD_MULTIPLE not supported by this MPI.')

call MPI_Comm_rank(this%comm_world, this%rank, ierror); _VERIFY(ierror)
call MPI_Comm_size(this%comm_world, npes_world, ierror); _VERIFY(ierror)
Expand Down

0 comments on commit d4b541e

Please sign in to comment.