Skip to content

Commit

Permalink
Merge pull request #2787 from GEOS-ESM/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 authored Apr 25, 2024
2 parents 0601825 + eef7954 commit 8583784
Show file tree
Hide file tree
Showing 62 changed files with 4,091 additions and 1,640 deletions.
75 changes: 9 additions & 66 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,46 +26,20 @@ orbs:
workflows:
build-and-test-MAPL:
jobs:
# Builds MAPL in a "default" way - Intel
# Builds MAPL in a "default" way
- ci/build:
name: build-and-test-MAPL-on-<< matrix.compiler >>-using-<< matrix.cmake_generator >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [ifort]
compiler: [gfortran,ifort]
cmake_generator: ['Unix Makefiles','Ninja']
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
run_unit_tests: true
ctest_options: "-LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure"
persist_workspace: true # Needed for MAPL tutorials

# Builds MAPL in a "default" way - GNU
#
# NOTE: Currently Open MPI fails on the bundleio with:
#
# The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
# Workarounds are to run on a single node, or to use a system with an RDMA
# capable network such as Infiniband.
#
# For now, we run GNU/Open MPI without the bundleio tests. Some indications that
# Open MPI 5 will not have this limitation

- ci/build:
name: build-and-test-MAPL-on-<< matrix.compiler >>-using-<< matrix.cmake_generator >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
cmake_generator: ['Unix Makefiles','Ninja']
baselibs_version: *baselibs_version
repo: MAPL
mepodevelop: false
run_unit_tests: true
ctest_options: "-E bundleio -LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure"
ctest_options: "-L 'ESSENTIAL' --output-on-failure"
persist_workspace: true # Needed for MAPL tutorials

# Builds MAPL like UFS does (no FLAP and pFlogger, static)
Expand All @@ -83,7 +57,7 @@ workflows:
remove_pflogger: true
extra_cmake_options: "-DBUILD_WITH_FLAP=OFF -DBUILD_WITH_PFLOGGER=OFF -DBUILD_WITH_FARGPARSE=OFF -DUSE_EXTDATA2G=OFF -DBUILD_SHARED_MAPL=OFF"
run_unit_tests: true
ctest_options: "-LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure"
ctest_options: "-L 'ESSENTIAL' --output-on-failure"

# Run MAPL Tutorials
- ci/run_mapl_tutorial:
Expand All @@ -92,8 +66,7 @@ workflows:
- docker-hub-creds
matrix:
parameters:
#compiler: [gfortran, ifort]
compiler: [ifort]
compiler: [gfortran, ifort]
tutorial_name:
- hello_world
- parent_no_children
Expand All @@ -108,29 +81,14 @@ workflows:

build-and-run-GEOSgcm:
jobs:
# Build GEOSgcm -- ifort
- ci/build:
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
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 GEOSgcm -- GCC
# Build GEOSgcm
- ci/build:
name: build-GEOSgcm-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
compiler: [gfortran, ifort]
baselibs_version: *baselibs_version
repo: GEOSgcm
checkout_fixture: true
Expand Down Expand Up @@ -170,29 +128,14 @@ workflows:

build-GEOSldas:
jobs:
# 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 GEOSldas
- ci/build:
name: build-GEOSldas-on-<< matrix.compiler >>
context:
- docker-hub-creds
matrix:
parameters:
compiler: [gfortran]
compiler: [gfortran,ifort]
baselibs_version: *baselibs_version
repo: GEOSldas
mepodevelop: false
Expand Down
6 changes: 4 additions & 2 deletions .github/actions/deploy-ford-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,14 @@ runs:
shell: bash

- name: Build Documentation
run: ford ${{ inputs.ford-input }}
run: |
cd docs/Ford
ford ${{ inputs.ford-input }}
shell: bash

- name: Deploy Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.event_name == 'push' && github.repository == 'GEOS-ESM/MAPL' && ( startsWith( github.ref, 'refs/tags/v' ) || github.ref == 'refs/heads/main' )
if: github.event_name == 'push' && github.repository == 'GEOS-ESM/MAPL' && ( startsWith( github.ref, 'refs/tags/v' ) || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/release/MAPL-v3' )
with:
folder: ${{ inputs.doc-folder }}
token: ${{ inputs.token }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ jobs:
- name: Build and Deploy Docs
uses: ./.github/actions/deploy-ford-docs
with:
ford-input: docs/Ford/docs-with-remote-esmf.md
# Due to a bug in ford, for now we do *not* want to use
# the full path to the ford input file. Rather, the
# action will cd into docs/Ford and then run ford
# relative path to the ford input file.
ford-input: docs-with-remote-esmf.md
doc-folder: docs/Ford/doc
token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -34,7 +38,11 @@ jobs:
- name: Build and Deploy Dev Docs
uses: ./.github/actions/deploy-ford-docs
with:
ford-input: docs/Ford/docs-with-remote-esmf.public_private_protected.md
# Due to a bug in ford, for now we do *not* want to use
# the full path to the ford input file. Rather, the
# action will cd into docs/Ford and then run ford
# relative path to the ford input file.
ford-input: docs-with-remote-esmf.public_private_protected.md
doc-folder: docs/Ford/dev-doc
token: ${{ secrets.GITHUB_TOKEN }}
target-folder: dev-doc
2 changes: 1 addition & 1 deletion .github/workflows/trigger-circleci-pipeline-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ jobs:
steps:
- name: CircleCI Trigger on Release
id: docker-build
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0
uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.2.0
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}
34 changes: 21 additions & 13 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,29 @@ on:
- ".editorconfig"

jobs:
check-ford-docs:
name: Build Ford Docs
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build and Deploy Docs
uses: ./.github/actions/deploy-ford-docs
with:
# Due to a bug in ford, for now we do *not* want to use
# the full path to the ford input file. Rather, the
# action will cd into docs/Ford and then run ford
# relative path to the ford input file.
ford-input: ford-ci.md
doc-folder: docs/Ford/ci-doc
token: ${{ secrets.GITHUB_TOKEN }}

build_test_mapl:
name: Build and Test MAPL GNU
runs-on: ubuntu-latest
container:
image: gmao/ubuntu20-geos-env-mkl:v7.23.0-openmpi_5.0.0-gcc_12.1.0
image: gmao/ubuntu20-geos-env-mkl:v7.23.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 @@ -63,16 +81,7 @@ jobs:
run: |
cd build
make -j4 build-tests
# skip performance tests
# NOTE: Currently Open MPI fails on the bundleio with:
#
# The OSC pt2pt component does not support MPI_THREAD_MULTIPLE in this release.
# Workarounds are to run on a single node, or to use a system with an RDMA
# capable network such as Infiniband.
#
# For now, we run GNU/Open MPI without the bundleio tests. Some indications that
# Open MPI 5 will not have this limitation
ctest -E bundleio -LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure
ctest -L 'ESSENTIAL' --output-on-failure
build_test_mapl_intel:
name: Build and Test MAPL Intel
runs-on: ubuntu-latest
Expand Down Expand Up @@ -119,5 +128,4 @@ jobs:
run: |
cd build
make -j4 build-tests
# skip performance tests
ctest -LE 'PERFORMANCE|EXTDATA1G_BIG_TESTS|EXTDATA2G_BIG_TESTS' --output-on-failure
ctest -L 'ESSENTIAL' --output-on-failure
2 changes: 2 additions & 0 deletions Apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ file (COPY mapl_stub.pl DESTINATION ${esma_etc}/MAPL)

install (PROGRAMS
MAPL_GridCompSpecs_ACG.py
combine_restarts.py
split_restart.py
mapl_acg.pl
mapl_stub.pl
TYPE SYSCONF
Expand Down
28 changes: 28 additions & 0 deletions Apps/MAPL_GridCompSpecs_ACG.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@
string_emit = lambda value: ("'" + value + "'") if value else None
# Return value in brackets
array_emit = lambda value: ('[' + value + ']') if value else None
lstripped = lambda s: s.lower().strip(' .')

# emit function for character arrays
string_array_emit = lambda value: make_string_array(value) if value else None

def make_string_array(s):
""" Returns a string representing a Fortran character array """
ss = s.strip()
if ',' in ss:
ls = [s.strip() for s in s.strip().split(',')]
else:
ls = s.strip().split()
ls = [rm_quotes(s) for s in ls]
ls = [s for s in ls if s]
n = max(ls)
ss = ','.join([add_quotes(s) for s in ls])
return f"[character(len={n}) :: {ss}]"

rm_quotes = lambda s: s.strip().strip('"\'').strip()
add_quotes = lambda s: "'" + s + "'"

mangle_name = lambda name: string_emit(name.replace("*","'//trim(comp_name)//'")) if name else None
make_internal_name = lambda name: name.replace('*','') if name else None
Expand All @@ -49,6 +69,12 @@ def make_entry_emit(dictionary):
'REQ' : 'MAPL_RestartRequired', 'BOOT' : 'MAPL_RestartBoot',
'SKIPI': 'MAPL_RestartSkipInitial'})

# emit function for logical-valued options
TRUEVALUES = {'t', 'true', 'yes', 'y', 'si', 'oui', 'sim'}
FALSEVALUES = {'f', 'false', 'no', 'n', 'no', 'non', 'nao'}
TRUE_VALUE = '.true.'
FALSE_VALUE = '.false.'
logical_emit = lambda s: TRUE_VALUE if lstripped(s) in TRUEVALUES else FALSE_VALUE if lstripped(s) in FALSEVALUES else None
# emit function for Option.ADD2EXPORT
ADD2EXPORT_EMIT = make_entry_emit({'T': '.true.', 'F': '.false.'})

Expand Down Expand Up @@ -89,6 +115,8 @@ def get_mandatory_options(cls):
'AVINT': ('averaging_interval',),
'DATATYPE': ('datatype',),
'DEFAULT': ('default',),
'DEPENDS_ON_CHILDREN': ('depends_on_children', logical_emit),
'DEPENDS_ON': ('depends_on', string_array_emit),
'FIELD_TYPE': ('field_type',),
'FRIENDLYTO': ('friendlyto', string_emit),
'FRIEND2': ('friendlyto', string_emit),
Expand Down
4 changes: 2 additions & 2 deletions Apps/Regrid_Util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,8 @@ subroutine generate_report()
call reporter%add_column(FormattedTextColumn('% Excl','(f6.2)', 6, PercentageColumn(ExclusiveColumn('MEAN'))))
call reporter%add_column(FormattedTextColumn(' Max Excl)','(f9.6)', 9, ExclusiveColumn('MAX')))
call reporter%add_column(FormattedTextColumn(' Min Excl)','(f9.6)', 9, ExclusiveColumn('MIN')))
call reporter%add_column(FormattedTextColumn('Max PE)','(1x,i4.4,1x)', 6, ExclusiveColumn('MAX_PE')))
call reporter%add_column(FormattedTextColumn('Min PE)','(1x,i4.4,1x)', 6, ExclusiveColumn('MIN_PE')))
call reporter%add_column(FormattedTextColumn('Max PE)','(1x,i5.5,1x)', 7, ExclusiveColumn('MAX_PE')))
call reporter%add_column(FormattedTextColumn('Min PE)','(1x,i5.5,1x)', 7, ExclusiveColumn('MIN_PE')))
report_lines = reporter%generate_report(t_prof)
if (mapl_am_I_root()) then
write(*,'(a)')'Final profile'
Expand Down
Loading

0 comments on commit 8583784

Please sign in to comment.