Skip to content

Commit

Permalink
Merge pull request #2970 from GEOS-ESM/hotfix/mathomp4/mpi-init-2.46
Browse files Browse the repository at this point in the history
Fix support for external MPI
  • Loading branch information
mathomp4 committed Aug 16, 2024
2 parents b76ba1a + 6c4186b commit e8b8e5e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ parameters:

# Anchors to prevent forgetting to update a version
os_version: &os_version ubuntu20
baselibs_version: &baselibs_version v7.24.0
bcs_version: &bcs_version v11.3.0
baselibs_version: &baselibs_version v7.25.0
bcs_version: &bcs_version v11.5.0
tag_build_arg_name: &tag_build_arg_name maplversion

orbs:
Expand Down Expand Up @@ -178,9 +178,9 @@ workflows:
baselibs_version: *baselibs_version
container_name: mapl
mpi_name: intelmpi
mpi_version: 2021.6.0
mpi_version: "2021.13"
compiler_name: intel
compiler_version: 2022.1.0
compiler_version: "2024.2"
image_name: geos-env
tag_build_arg_name: *tag_build_arg_name
- ci/publish_docker:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.24.0-openmpi_5.0.2-gcc_13.2.0
image: gmao/ubuntu20-geos-env-mkl:v7.25.0-openmpi_5.0.2-gcc_13.2.0
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
name: Build and Test MAPL Intel
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env:v7.24.0-intelmpi_2021.6.0-intel_2022.1.0
image: gmao/ubuntu20-geos-env:v7.25.0-intelmpi_2021.13-intel_2024.2
# Per https://github.com/actions/virtual-environments/issues/1445#issuecomment-713861495
# It seems like we might not need secrets on GitHub Actions which is good for forked
# pull requests
Expand Down
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.46.3] - 2024-08-16

### Fixed

- Fix bug in supporting externally initialized MPI

## [2.46.2] - 2024-05-31

### Removed
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.46.2
VERSION 2.46.3
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 e8b8e5e

Please sign in to comment.