Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/build-tests-iturbo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Build iturbo branch of MOM6 with TIM and FMS

# See the following link for more information on the NCAR HPC development containers:
# https://hub.docker.com/u/ncarcisl

on:
workflow_dispatch:
push:
branches: ["main", "ci-tests", "container-ci"]
pull_request:
branches: ["main", "ci-tests", "container-ci"]

jobs:

run-matrix:
strategy:
fail-fast: false
matrix:
compiler: [ oneapi, gcc14 ]
mpi: [ mpich ]
gpu: [ nogpu ]
arch: [ x86_64 ]
runner: [ ubuntu-latest, gha-runner-turbo ]

name: Build Test
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash -elo pipefail {0}

container:
image: docker.io/ncarcisl/cisldev-${{ matrix.arch }}-almalinux9-${{ matrix.compiler }}-${{ matrix.mpi }}${{ matrix.gpu == 'cuda' && '-cuda' || '' }}

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0

- name: Switch MOM6 to dev/turbo-debug
run: |
cd submodules/MOM6/
git fetch origin
git checkout --recurse-submodules dev/turbo-debug
echo "Head of dev/turbo-debug is this commit:"
git log -1 --decorate
cd ../..

- name: Interrogate Runtime Environment
run: |
cat /container/config_env.sh
lscpu
echo && echo && echo
echo '----------------------------------------------------------------'
echo && echo && echo
echo "CC=${CC}"
echo "CXX=${CXX}"
echo "FC=${FC}"
echo "F77=${F77}"
echo
echo "CFLAGS=${CFLAGS}"
echo "CPPFLAGS=${CPPFLAGS}"
echo "CXXFLAGS=${CXXFLAGS}"
echo "FCFLAGS=${FCFLAGS}"
echo "F77FLAGS=${F77FLAGS}"
export CC CXX FC F77 CFLAGS CXXFLAGS FCFLAGS F77FLAGS CPPFLAGS
conda --version 2>/dev/null || echo " --> no conda in this container"
which mpicc
mpicc --version 2>/dev/null || true

- name: Build MOM6 with TIM
run: |
./build.sh --compiler ${COMPILER_FAMILY} --machine container --infra TIM
if [[ ! `nm --print-armap bin/${COMPILER_FAMILY}/MOM6_using_TIM/MOM6-infra/libinfra-TIM.a | grep tim_com` ]]; then
echo "ERROR: Did not find tim_com in libinfra-TIM.a (did TIM module change name?)"
exit 1
fi
Comment thread
johnmauff marked this conversation as resolved.

- name: Build MOM6 with FMS2
run: |
./build.sh --compiler ${COMPILER_FAMILY} --machine container --infra FMS2
if [[ `nm --print-armap bin/${COMPILER_FAMILY}/MOM6_using_FMS2/MOM6-infra/libinfra-FMS2.a | grep tim_com` ]]; then
echo "ERROR: Found tim_com in libinfra-FMS2.a (=> using TIM infra, not FMS)"
exit 1
fi
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
[submodule "src/FMS"]
path = submodules/infra/FMS2
url = https://github.com/TURBO-ESM/FMS
[submodule "src/CESM_share"]
path = submodules/CESM_share
url = https://github.com/ESCOMP/CESM_share
[submodule "src/MARBL"]
path = submodules/MARBL
url = https://github.com/marbl-ecosys/MARBL
Expand Down
4 changes: 0 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ROOTDIR=$(pwd -P)
MKMF_ROOT=${ROOTDIR}/build-utils/mkmf
TEMPLATE_DIR=${ROOTDIR}/build-utils/makefile-templates
MOM_ROOT=${ROOTDIR}/submodules/MOM6
SHR_ROOT=${ROOTDIR}/submodules/CESM_share
AMREX_ROOT=${ROOTDIR}/submodules/amrex
INFRA_ROOT=${ROOTDIR}/submodules/infra/TIM
PFUNIT_ROOT=${ROOTDIR}/submodules/pFUnit
Expand Down Expand Up @@ -305,9 +304,6 @@ cd ${BLD_PATH}
mkdir -p ${INFRA}
cd ${INFRA}
${MKMF_ROOT}/list_paths ${INFRA_ROOT}
# We need shr_const_mod.F90 and shr_kind_mod.F90 from ${SHR_ROOT}/src to build FMS
echo "${SHR_ROOT}/src/shr_kind_mod.F90" >> path_names
echo "${SHR_ROOT}/src/shr_const_mod.F90" >> path_names
${MKMF_ROOT}/mkmf -t ${TEMPLATE} -p lib${INFRA}.a -o "${INFRA_INCLUDE_FLAGS}" -l "${INFRA_LINKING_FLAGS}" -c "-Duse_libMPI -Duse_netCDF -DSPMD" path_names
Comment thread
mnlevy1981 marked this conversation as resolved.
make -j${JOBS} DEBUG=${DEBUG} CODECOV=${CODECOV} OFFLOAD=${OFFLOAD} lib${INFRA}.a

Expand Down
53 changes: 19 additions & 34 deletions dev-utils/gen_parse_tree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,25 @@ ROOTDIR=$(pwd -P)/..
MKMF_ROOT=${ROOTDIR}/build-utils/mkmf
TEMPLATE_DIR=${ROOTDIR}/build-utils/makefile-templates
MOM_ROOT=${ROOTDIR}/submodules/MOM6
SHR_ROOT=${ROOTDIR}/submodules/CESM_share
INFRA_ROOT=${ROOTDIR}/submodules/FMS
INFRA_ROOT=${ROOTDIR}/submodules/infra/TIM

# Default values for CLI arguments
COMPILER="flang_ptree"
MACHINE="ncar"
INFRA="FMS2"
INFRA="TIM"
MEMORY_MODE="dynamic_symmetric"
DEBUG=0 # False
OVERRIDE=0 # False

# Find valid values for INFRA
for dir in `ls -d ${ROOTDIR}/submodules/infra/*`; do
if [ ! -z "${VALID_INFRA}" ]; then
VALID_INFRA="${VALID_INFRA}, `(basename ${dir})`"
else
VALID_INFRA=`(basename ${dir})`
fi
done

echo "Starting parse dump at `date`"
# Parse command line arguments
while [[ "$#" -gt 0 ]]; do
Expand All @@ -25,7 +33,8 @@ while [[ "$#" -gt 0 ]]; do
echo "Flang parse tree generator."
echo " --machine <machine> Machine type (default: ncar)"
echo " --memory-mode <memory_mode> Memory mode (default: dynamic_symmetric)"
echo " --infra <infra> Subdirectory of config_src/infra/ to build (default: FMS2)"
echo " --infra <infra> Subdirectory of config_src/infra/ to build"
echo " (valid values [${VALID_INFRA}]; default: TIM)"
echo " --debug Enable debug mode (default: disabled)"
echo " --override If a build already exists, clear it and rebuild (default: false)"
echo " --jobs <num_jobs> Sets the number of jobs to use for make/cmake calls."
Expand All @@ -45,8 +54,10 @@ while [[ "$#" -gt 0 ]]; do
OVERRIDE=1 ;;
--infra)
INFRA="$2"
if [[ "${INFRA}" == "TIM" ]]; then
INFRA_ROOT=${ROOTDIR}/submodules/TIM
INFRA_ROOT=${ROOTDIR}/submodules/infra/${INFRA}
if [[ ! -d "${INFRA_ROOT}" ]]; then
echo "--infra option ${INFRA} not valid. Valid options are [${VALID_INFRA}]."
exit 1
fi
shift ;;
--jobs)
Expand Down Expand Up @@ -111,7 +122,7 @@ if [ -z "${JOBS}" ]; then
fi
echo "Using ${JOBS} jobs"

BLD_PATH=${ROOTDIR}/bin/${COMPILER}
BLD_PATH=${ROOTDIR}/bin/${COMPILER}/MOM6_using_${INFRA}

# If override is set, remove existing build directory
if [ $OVERRIDE -eq 1 ]; then
Expand All @@ -126,30 +137,7 @@ if [ ! -d ${BLD_PATH} ]; then
mkdir -p ${BLD_PATH}
fi

# comma-separated list of files in src/framework that are needed to build $LININFRA (for FMS2, at least)
MOM6_infra_framework_deps_list=$(cat << EOF
MOM_string_functions.F90
MOM_io.F90
MOM_array_transform.F90
MOM_domains.F90
MOM_error_handler.F90
posix.F90
MOM_file_parser.F90
MOM_coms.F90
MOM_document.F90
MOM_cpu_clock.F90
MOM_unit_scaling.F90
MOM_dyn_horgrid.F90
MOM_hor_index.F90
MOM_ensemble_manager.F90
MOM_io_file.F90
MOM_netcdf.F90
EOF
)
MOM6_infra_framework_deps=$(echo ${MOM6_infra_framework_deps_list} | tr ' ' ',')
# comma-separated list of files in src/core that are needed to build $LIBINFRA (for FMS2, at least)
MOM6_infra_core_deps=MOM_grid.F90,MOM_verticalGrid.F90
MOM6_infra_files=${MOM_ROOT}/{config_src/memory/${MEMORY_MODE},config_src/infra/${INFRA},src/framework/{$MOM6_infra_framework_deps},src/core/{$MOM6_infra_core_deps}}
MOM6_infra_files=${MOM_ROOT}/{config_src/memory/${MEMORY_MODE},config_src/infra/${INFRA}}
MOM6_src_files=${MOM_ROOT}/{config_src/memory/${MEMORY_MODE},config_src/drivers/solo_driver,pkg/CVMix-src/src/shared,pkg/GSW-Fortran/modules,../MARBL/src,config_src/external,src/{*,*/*}}/

# 1) Build Underlying Infrastructure Library
Expand All @@ -158,9 +146,6 @@ if [[ "${INFRA}" == "FMS2" || "${INFRA}" == "TIM" ]]; then
mkdir -p ${INFRA}
cd ${INFRA}
${MKMF_ROOT}/list_paths ${INFRA_ROOT}
# We need shr_const_mod.F90 and shr_kind_mod.F90 from ${SHR_ROOT}/src to build FMS
echo "${SHR_ROOT}/src/shr_kind_mod.F90" >> path_names
echo "${SHR_ROOT}/src/shr_const_mod.F90" >> path_names
${MKMF_ROOT}/mkmf --gen-ptree -t ${TEMPLATE} -p lib${INFRA}.a path_names
make -j${JOBS} DEBUG=${DEBUG} lib${INFRA}.a
LINKING_FLAGS="-L../MOM6-infra -linfra-${INFRA} -L../${INFRA} -l${INFRA}"
Expand Down
1 change: 0 additions & 1 deletion submodules/CESM_share
Submodule CESM_share deleted from b2fa12
2 changes: 1 addition & 1 deletion submodules/MOM6
Submodule MOM6 updated 397 files
Loading