Skip to content

Commit

Permalink
Merge pull request #2593 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
GitFlow: Merge develop into main for release
  • Loading branch information
tclune committed Feb 9, 2024
2 parents 70d50bc + 1a2f909 commit b09ae30
Show file tree
Hide file tree
Showing 74 changed files with 3,019 additions and 2,026 deletions.
101 changes: 52 additions & 49 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ orbs:
ci: geos-esm/circleci-tools@2

workflows:
build-and-test:
build-and-test-MAPL:
jobs:

# Builds MAPL in a "default" way - Intel
- ci/build:
name: build-and-test-MAPL-on-<< matrix.compiler >>-using-<< matrix.cmake_generator >>
Expand All @@ -35,7 +34,7 @@ workflows:
matrix:
parameters:
compiler: [ifort]
cmake_generator: ['Unix Makefiles']
cmake_generator: ['Unix Makefiles','Ninja']
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
Expand All @@ -61,7 +60,7 @@ workflows:
matrix:
parameters:
compiler: [gfortran]
cmake_generator: ['Unix Makefiles']
cmake_generator: ['Unix Makefiles','Ninja']
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
Expand All @@ -86,65 +85,58 @@ workflows:
run_unit_tests: true
ctest_options: "-LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure"

# Build GEOSgcm -- ifort
- ci/build:
name: build-GEOSgcm-on-<< matrix.compiler >>
# Run MAPL Tutorials
- ci/run_mapl_tutorial:
name: run-<< matrix.tutorial_name >>-Tutorial-with-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
#compiler: [gfortran, ifort]
compiler: [ifort]
tutorial_name:
- hello_world
- parent_no_children
- parent_one_child_import_via_extdata
- parent_one_child_no_imports
- parent_two_siblings_connect_import_export
# We will only run the tutorials with GNU make. No need to double up
# as Ninja is a build test only
requires:
- build-and-test-MAPL-on-<< matrix.compiler >>-using-Unix Makefiles
baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
checkout_mapl_branch: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra, retained for one day

# Build GEOSgcm -- GCC
build-and-run-GEOSgcm:
jobs:
# Build GEOSgcm -- ifort
- ci/build:
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
compiler: [ifort]
baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
mepodevelop: true
checkout_mapl_branch: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra, retained for one day

# Build GEOSldas on ifort
- ci/build:
name: build-GEOSldas-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [ifort]
baselibs_version: *baselibs_version
repo: GEOSldas
mepodevelop: false
checkout_fixture: true
fixture_branch: develop
checkout_mapl_branch: true

# Build GEOSldas on gfortran
# Build GEOSgcm -- GCC
- ci/build:
name: build-GEOSldas-on-<< matrix.compiler >>
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
baselibs_version: *baselibs_version
repo: GEOSldas
mepodevelop: false
repo: GEOSgcm
checkout_fixture: true
fixture_branch: develop
mepodevelop: true
checkout_mapl_branch: true
persist_workspace: true # Needs to be true to run fv3/gcm experiment, costs extra, retained for one day

# Run GCM (1 hour, no ExtData)
- ci/run_gcm:
Expand Down Expand Up @@ -176,26 +168,37 @@ workflows:
gcm_ocean_type: MOM6
change_layout: false

# Run MAPL Tutorials
- ci/run_mapl_tutorial:
name: run-<< matrix.tutorial_name >>-Tutorial-with-<< matrix.compiler >>
build-GEOSldas:
jobs:
# Build GEOSldas on ifort
- ci/build:
name: build-GEOSldas-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
#compiler: [gfortran, ifort]
compiler: [ifort]
tutorial_name:
- hello_world
- parent_no_children
- parent_one_child_import_via_extdata
- parent_one_child_no_imports
- parent_two_siblings_connect_import_export
# We will only run the tutorials with GNU make. No need to double up
# as Ninja is a build test only
requires:
- build-and-test-MAPL-on-<< matrix.compiler >>-using-Unix Makefiles
baselibs_version: *baselibs_version
repo: GEOSldas
mepodevelop: false
checkout_fixture: true
fixture_branch: develop
checkout_mapl_branch: true

# Build GEOSldas on gfortran
- ci/build:
name: build-GEOSldas-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
baselibs_version: *baselibs_version
repo: GEOSldas
mepodevelop: false
checkout_fixture: true
fixture_branch: develop
checkout_mapl_branch: true

build-GEOSadas:
jobs:
Expand Down Expand Up @@ -250,7 +253,7 @@ workflows:
baselibs_version: *baselibs_version
container_name: mapl
mpi_name: openmpi
mpi_version: 4.1.4
mpi_version: 5.0.0
compiler_name: gcc
compiler_version: 12.1.0
image_name: geos-env-mkl
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.17.0-openmpi_4.1.4-gcc_12.1.0
image: gmao/ubuntu20-geos-env-mkl:v7.17.0-openmpi_5.0.0-gcc_12.1.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 All @@ -30,7 +30,7 @@ jobs:
OMPI_MCA_btl_vader_single_copy_mechanism: none
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected].0
uses: styfle/[email protected].1
with:
access_token: ${{ github.token }}
- name: Checkout
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
#password: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected].0
uses: styfle/[email protected].1
with:
access_token: ${{ github.token }}
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
*.py.bak
CMakeUserPresets.json

# Ignore possible symlinked build and install directories
build-*
install-*

*.swp
*.swo
.DS_Store
Expand Down
6 changes: 3 additions & 3 deletions Apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ install(
DESTINATION bin/forcing_converter)

ecbuild_add_executable (TARGET Regrid_Util.x SOURCES Regrid_Util.F90)
target_link_libraries (Regrid_Util.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (Regrid_Util.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (Regrid_Util.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(Regrid_Util.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET time_ave_util.x SOURCES time_ave_util.F90)
target_link_libraries (time_ave_util.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (time_ave_util.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (time_ave_util.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
target_link_libraries(time_ave_util.x PRIVATE OpenMP::OpenMP_Fortran)
endif ()

ecbuild_add_executable (TARGET Comp_Testing_Driver.x SOURCES Comp_Testing_Driver.F90)
target_link_libraries (Comp_Testing_Driver.x PRIVATE MAPL MPI::MPI_Fortran esmf)
target_link_libraries (Comp_Testing_Driver.x PRIVATE MAPL MPI::MPI_Fortran ESMF::ESMF)
target_include_directories (Comp_Testing_Driver.x PRIVATE $<BUILD_INTERFACE:${MAPL_SOURCE_DIR}/include>)
# CMake has an OpenMP issue with NAG Fortran: https://gitlab.kitware.com/cmake/cmake/-/issues/21280
if (NOT CMAKE_Fortran_COMPILER_ID MATCHES "NAG")
Expand Down
2 changes: 1 addition & 1 deletion Apps/Regrid_Util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Program Regrid_Util

subroutine main()

type(regrid_support) :: support
type(regrid_support), target :: support

type(ESMF_VM) :: vm ! ESMF Virtual Machine

Expand Down
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,54 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Deprecated

## [2.44.0] - 2024-02-08

### Added

- Added nf90 interface to read and write 1d string
- Convert from ABI Fixed Grid to lon/lat coordinates used in MAPL_XYGridFactory (supporting geostationary GOES-R series)
- Modify trajectory sampler for a collection with multiple platforms: P3B (air craft) + FIREX
- Modify swath sampler to handle two Epoch swath grids
- Handle regrid accumulate for time step (1 sec) during which no obs exists
- Use IntState%stampoffset(n) to adjust filenames for an epoch time
- parse "GOCART::CO2" from 'geovals_fields' entry in PLATFORM
- Add call MAPL_InitializeShmem to ExtDataDriverGridComp.F90
- Read swath data on root, call MAPL_CommsBcast [which sends data to Shmem (when Shmem initialized) or to MAPL_comm otherwise]. This approach avoids race in reading nc files [e.g. 37 files for 3 hr swath data]
- Added memory utility, MAPL_MemReport that can be used in any code linking MAPL
- Added capability in XY grid factory to add a mask to the grid any points are missing needed for geostationary input data
- Added capability in the MAPL ESMF regridding wrapper to apply a destination mask if the destination grid contains a mask
- Added `INSTALL.md` file to provide instructions on how to install MAPL

### Changed

- Updated ESMF required version to 8.6.0
- Allocate gridded fields to use the pinflag option needed for the Single System Image (SSI) capability.
- Made changes to allocate fields to use farray instead of farrayPtr. This allows explicit specification of indexflag required by the new MAPL field split functionality. This functionality allows a clean way to create a new field from an exiting field where the new field is a 'slice' of the existing field with the slicing index being that of the trailing ungiridded dim of the existing field.
- Replaced RC=STATUS plus `_VERIFY(RC)` in `Base_Base_implementation.F90` with just `_RC` in line with our new convention.
- Updated CI to use Open MPI 5.0.0 for GNU
- Enable Ninja for CI builds of MAPL
- Removed use of `ESMF_HAS_ACHAR_BUG` CMake option and code use in `MAPL_Config.F90`. Testing has shown that with ESMF 8.6 (which is
now required), NAG no longer needs this workaround.
- Refactor the CircleCI workflows for more flexibility
- Fix field utils issue - add npes argument to test subroutine decorators.
- Change MAPL CMake to use `ESMF::ESMF` target instead of `esmf` or `ESMF` as the imported target name
- Updated `FindESMF.cmake` to match that of ESMF `develop` as of commit `da8f410`. This will be in ESMF 8.6.1+
- Requires ESMA_cmake 3.40.0 or later as this adds the `ESMF::ESMF` target ALIAS for Baselibs and non-Baselibs builds
- Changed `CMakePresets.json`
- Updated to version 7 and required CMake 3.27.0 (the minimum version that supports CMakePresets.json v7)
- Changed build style on NCCS machines to by default put build and install directories in a user-specified directory so as not to
pollute swdev

### Fixed

- Restore missing submodule interfaces
- Explictly `use` some `iso_c_binding` types previously pulled in through ESMF. This is fixed in future ESMF versions (8.7+) and so
we anticipate this here
- Add explicit `Fortran_MODULE_DIRECTORY` to `CMakeLists.txt` in benchmarks to avoid race condition in Ninja builds
- Add check to make sure ESMF was not built as `mpiuni`
- Fixed failing tests for `field_utils`.
- Various fixes for NVHPC work

## [2.43.2] - 2024-02-06

### Fixed
Expand Down
19 changes: 10 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif ()

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

# Set the possible values of build type for cmake-gui
Expand Down Expand Up @@ -147,28 +147,29 @@ if (NOT Baselibs_FOUND)
add_definitions(-DH5_HAVE_PARALLEL)
endif()

if (NOT TARGET esmf)
find_package(ESMF 8.5.0 MODULE REQUIRED)
if (NOT TARGET ESMF::ESMF)
find_package(ESMF 8.6.0 MODULE REQUIRED)

# ESMF as used in MAPL requires MPI
# NOTE: This looks odd because some versions of FindESMF.cmake out in the
# world provide an "esmf" target while others provide "ESMF". So we
# need this ugliness to support both.
if (TARGET esmf)
target_link_libraries(esmf INTERFACE MPI::MPI_Fortran)
if (TARGET ESMF::ESMF)
target_link_libraries(ESMF::ESMF INTERFACE MPI::MPI_Fortran)
else()
target_link_libraries(ESMF INTERFACE MPI::MPI_Fortran)
target_link_libraries(ESMF::ESMF INTERFACE MPI::MPI_Fortran)
# MAPL and GEOS use lowercase target due to historical reasons but
# the latest FindESMF.cmake file from ESMF produces an ESMF target.
add_library(esmf ALIAS ESMF)
add_library(ESMF::ESMF ALIAS ESMF)
add_library(ESMF::ESMF ALIAS esmf)
endif()
endif ()
else ()
# This is an ESMF version test when using Baselibs which doesn't use the
# same find_package internally in ESMA_cmake as used above (with a version
# number) so this lets us at least trap use of old Baselibs here.
if (ESMF_VERSION VERSION_LESS 8.5.0)
message(FATAL_ERROR "ESMF must be at least 8.5.0")
if (ESMF_VERSION VERSION_LESS 8.6.0)
message(FATAL_ERROR "ESMF must be at least 8.6.0")
endif ()
endif ()

Expand Down
18 changes: 5 additions & 13 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
{
"version": 3,
"version": 7,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"minor": 27,
"patch": 0
},
"include": [
"presets/CMake$penv{CMAKE_PRESET_NAME}Presets.json"
],
"configurePresets": [
{
"name": "base-configure",
"hidden": true,
"displayName": "Base Configure Settings",
"description": "Sets build and install directories",
"binaryDir": "${sourceDir}/build-${presetName}",
"cacheVariables": {
"BASEDIR": "$env{BASEDIR}",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install-${presetName}"
}
},
{
"name": "base-gnu",
"hidden": true,
Expand Down
Loading

0 comments on commit b09ae30

Please sign in to comment.