Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1f1d2d1
Added NVHPC support to Parflow and OASIS
kvrigor Oct 9, 2026
33f5997
Removed Stages 2023 & 2024
kvrigor Oct 9, 2026
5755aa8
GNU+PSMPI env file
kvrigor Oct 9, 2026
e91f640
BuildOASIS: clean first before building libraries
kvrigor Oct 9, 2026
20fc48d
New env: jsc.2026.intel.psmpi
kvrigor Oct 13, 2026
2755218
OASIS3-MCT Stages/2026 NVHPC fixes
kvrigor Oct 14, 2026
e2ee7cb
Deprecated --<component-model> switches; passed --icongpu options to …
kvrigor Oct 14, 2026
2a567ec
eCLM-ICONGPU should build OASIS first.
kvrigor Oct 15, 2026
dee820a
Merge branch 'master' into env-s2026-nvhpc
kvrigor Oct 20, 2026
e0773bf
ParflowGPU NVHPC build hacks
kvrigor Oct 20, 2026
381a271
ICON build hacks
kvrigor Oct 20, 2026
52445f9
Changed eCLM to 'dev-iconeclm-exchfix'
kvrigor Oct 20, 2026
f5d182f
ICONGPU should also build eCLM in coupling mode
kvrigor Oct 21, 2026
a3a0c08
eCLM: updated dev-iconeclm-exchfix
kvrigor Oct 21, 2026
d319165
use loascplscheme_exchcoef only with ICON
kvrigor Oct 21, 2026
8eccd1d
BuildParFlow: Error message enforcing ParFlow on GPUs for NVHPC
jjokella Oct 21, 2026
ba9de00
Ensure OMPI_* vars are unset
kvrigor Oct 21, 2026
4d80f45
Enable PDAF builds on JUPITER with NVHPC compilers (#150)
jjokella Oct 21, 2026
b07a5a7
Updated OASIS3-MCT to tsmp-patches-v0.2
kvrigor Oct 26, 2026
858c3d1
BuildICON: GPU build only works on NVHPC for now.
kvrigor Oct 26, 2026
4708287
BuildParflow: Removed unnecessary comment
kvrigor Oct 26, 2026
72ce734
Added comment on why SUNDIALS module was disabled
kvrigor Oct 26, 2026
9045eeb
Updated eCLM to rc-0.1
kvrigor Oct 27, 2026
9e6786a
CI: Updated OASIS to tsmp-patches-v0.2
kvrigor Oct 27, 2026
0403403
CI: OASIS version shouldn't be hardcoded
kvrigor Oct 27, 2026
2bb90da
Updated tsmp-patches-v0.2 to include gfortran compile fixes
kvrigor Oct 27, 2026
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
10 changes: 5 additions & 5 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ jobs:
VER_NETCDF_F90: 4.6.1
VER_HYPRE: 2.33.0
VER_ECCODES: 2.40.0
VER_OASIS: tsmp-patches-v0.1
CHECKSUM_OASIS: 9b1d8d24efbff1ce7d2b2e4fd75249ea3a9c647c57e4c0a652dc7de695c5ec49
VER_OASIS: tsmp-patches-v0.2
CHECKSUM_OASIS: f409288fe16a5bd5e78bf934030a54b0c053152ec70ed03017155ef4485607a0
MAKE_JOBS: 4

steps:
Expand Down Expand Up @@ -339,15 +339,15 @@ jobs:
id: cache-oasis-restore
with:
path: ${{ env.TSMP2_ROOT }}/oasis3-mct
key: ${{ matrix.config.name }}_oasis-${{ env.VER_OASIS }}
key: ${{ matrix.config.name }}_oasis-${{ env.VER_OASIS }}-${{ env.CHECKSUM_OASIS }}

- if: matrix.config.use_oasis == 'True' && steps.cache-oasis-restore.outputs.cache-hit != 'true'
name: Update OASIS3-MCT submodule ${{ steps.model-versions.outputs.VER_OASIS }}
working-directory: ${{ env.TSMP2_ROOT }}
run: |
pwd
wget --quiet https://datapub.fz-juelich.de/slts/sw_hpscterrys/oasis3-mct-${VER_OASIS}.tar.gz
echo "${CHECKSUM_OASIS} oasis3-mct-tsmp-patches-v0.1.tar.gz" | sha256sum -c
echo "${CHECKSUM_OASIS} oasis3-mct-${VER_OASIS}.tar.gz" | sha256sum -c
tar xf oasis3-mct-${VER_OASIS}.tar.gz
mv oasis3-mct-${VER_OASIS} oasis3-mct

Expand All @@ -356,7 +356,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ${{ env.TSMP2_ROOT }}/oasis3-mct
key: ${{ matrix.config.name }}_oasis-${{ env.VER_OASIS }}
key: ${{ matrix.config.name }}_oasis-${{ env.VER_OASIS }}-${{ env.CHECKSUM_OASIS }}

#
# eCLM
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[submodule "models/parflow_pdaf"]
path = models/parflow_pdaf
url = https://github.com/HPSCTerrSys/parflow
branch = v3.14.1-pdaf
branch = v3.15.0-pdaf
[submodule "models/pdaf"]
path = models/pdaf
url = https://github.com/HPSCTerrSys/pdaf.git
Expand All @@ -21,7 +21,7 @@
[submodule "models/oasis3-mct"]
path = models/oasis3-mct
url = https://icg4geo.icg.kfa-juelich.de/ExternalReposPublic/oasis3-mct
branch = v5.0_patched
branch = tsmp-patches-v0.2
[submodule "models/CLM3.5"]
path = models/CLM3.5
url = https://github.com/HPSCTerrSys/CLM3.5.git
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (${ICON} OR ${ICONGPU})
set(ICON_SRC "${CMAKE_SOURCE_DIR}/models/icon")
endif()
include(BuildICON)
list(APPEND COMPONENT_MODELS "ICON")
list(APPEND COMPONENT_MODELS ${ICON_ID})
if ("${MODEL_ID}" STREQUAL "")
set(MODEL_ID "${ICON_ID}")
else()
Expand Down
18 changes: 10 additions & 8 deletions build_tsmp2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ while [[ "$#" -gt 0 ]]; do
-q|--quiet) quiet=y;;
-v|--verbose) verbose_makefile=y;;
--version) echo "$0 version 0.2.0"; exit 0;;
--icon|icon) icon=y iconCPU=y iconCMakeModelID="ICON";;
icon) icon=y iconCPU=y iconCMakeModelID="ICON";;
icongpu) icon=y iconGPU=y iconCMakeModelID="ICONGPU";;
--eclm|eclm) eclm=y;;
--parflow|parflow) parflow=y parflowCPU=y parflowCMakeModelID="ParFlow";;
--parflowgpu|parflowgpu) parflow=y parflowGPU=y parflowCMakeModelID="ParFlowGPU";;
--pdaf|pdaf) pdaf=y;;
--cosmo|cosmo) cosmo=y;;
--clm35|--clm3.5|clm3.5) clm35=y;;
eclm) eclm=y;;
parflow) parflow=y parflowCPU=y parflowCMakeModelID="ParFlow";;
parflowgpu) parflow=y parflowGPU=y parflowCMakeModelID="ParFlowGPU";;
pdaf) pdaf=y;;
cosmo) cosmo=y;;
clm3.5) clm35=y;;
--no_update) update_compsrc=n;;
--clean_first) clean_first=y;;
--icon_src) icon_src="$2"; shift ;;
Expand Down Expand Up @@ -234,9 +234,11 @@ fi
if [[ -n "${env}" ]]; then
message "Sourcing environment..."

# TODO: Fix this GPU thing on another PR
# TODO: Fix this messy GPU env parameterization on another PR
if [[ "$parflowGPU" == "y" ]];then
source "${env}" --parflowgpu
elif [[ "$iconGPU" == "y" ]];then
source "${env}" --icongpu
else
source "${env}"
fi
Expand Down
4 changes: 3 additions & 1 deletion cmake/BuildICON.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ endif()

# GPU-specific options
if(${ICONGPU})
list(APPEND ICON_LIBS "-c++libs -nvmalloc -cuda")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
list(APPEND ICON_LIBS "-c++libs -nvmalloc -cuda")
endif()
list(APPEND EXTRA_CONFIG_ARGS --enable-gpu=openacc --enable-mpi-gpu --enable-cuda-graphs --enable-pgi-inlib)
else()
list(APPEND EXTRA_CONFIG_ARGS --enable-openmp)
Expand Down
19 changes: 13 additions & 6 deletions cmake/BuildOASIS3MCT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ else()
message(WARNING "CMAKE_BUILD_TYPE='${CMAKE_BUILD_TYPE}' is not supported by OASIS3-MCT")
endif()

set(CPPDEF_EXTRAS "")
if(${PDAF})
string(APPEND CPPDEF_EXTRAS " -DUSE_PDAF")
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
# NVHPC doesn't support quad precision. https://forums.developer.nvidia.com/t/real-16-implementation/129969
string(APPEND CPPDEF_EXTRAS " -D__NO_16BYTE_REALS")
endif()

set(OASIS_BLD_DIR ${CMAKE_CURRENT_BINARY_DIR}/OASIS3_MCT/bld)
set(OASIS_MAKE_INC ${OASIS_BLD_DIR}/make.inc)
set(OASIS_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/OASIS3-MCT)
Expand All @@ -35,15 +44,13 @@ file(APPEND ${OASIS_MAKE_INC} "AR = ar\n")
file(APPEND ${OASIS_MAKE_INC} "ARFLAGS = -ruv\n")
file(APPEND ${OASIS_MAKE_INC} "DYNOPT = -fPIC\n")
file(APPEND ${OASIS_MAKE_INC} "LDDYNOPT = -shared\n")
if(${PDAF})
file(APPEND ${OASIS_MAKE_INC} "CPPDEF = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY -DUSE_PDAF\n")
else()
file(APPEND ${OASIS_MAKE_INC} "CPPDEF = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY\n")
endif()
file(APPEND ${OASIS_MAKE_INC} "CPPDEF = -Duse_netCDF -Duse_comm_$(CHAN) -D__VERBOSE -DTREAT_OVERLAY ${CPPDEF_EXTRAS}\n")
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -ffree-line-length-none -fallow-argument-mismatch ${OpenMP_Fortran_FLAGS}\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" OR CMAKE_Fortran_COMPILER_ID STREQUAL "IntelLLVM")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -xCORE-AVX2 -assume byterecl -mt_mpi ${OpenMP_Fortran_FLAGS}\n")
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC")
file(APPEND ${OASIS_MAKE_INC} "FCBASEFLAGS = ${OPTIM} -I. -fPIC ${OpenMP_Fortran_FLAGS}\n")
else()
message(FATAL_ERROR "Fortran compiler '${CMAKE_Fortran_COMPILER_ID}' is not supported.")
endif()
Expand All @@ -67,7 +74,7 @@ ExternalProject_Add(OASIS3_MCT
PREFIX OASIS3_MCT
SOURCE_DIR ${OASIS_SRC}
BUILD_IN_SOURCE FALSE
CONFIGURE_COMMAND ""
CONFIGURE_COMMAND make -f ${OASIS_SRC}/util/make_dir/TopMakefileOasis3 realclean -C ${OASIS_BLD_DIR}
BUILD_COMMAND make -j ${PARALLEL_JOBS} -f ${OASIS_SRC}/util/make_dir/TopMakefileOasis3 static-libs -C ${OASIS_BLD_DIR}
INSTALL_COMMAND ""
)
Expand Down
39 changes: 39 additions & 0 deletions cmake/BuildPDAF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_FOPT "-fallow-argument-mismatch")
list(APPEND PDAF_FOPT "-fcommon")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

# using NVIDIA HPC SDK
if (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
list(APPEND PDAF_FOPT "-O2")
elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
list(APPEND PDAF_FOPT "-O0")
list(APPEND PDAF_FOPT "-g")
list(APPEND PDAF_FOPT "-traceback")
else()
message(FATAL_ERROR "Unsupported CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()

list(APPEND PDAF_FOPT "-Msave")
list(APPEND PDAF_FOPT "-Mlarge_arrays")
list(APPEND PDAF_FOPT "-Mbyteswapio")
list(APPEND PDAF_FOPT "-Mfreeform")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down Expand Up @@ -189,6 +207,19 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_COPT "-mcmodel=large")
list(APPEND PDAF_COPT "-fcommon")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

# using NVIDIA HPC SDK
if (CMAKE_BUILD_TYPE STREQUAL "RELEASE")
list(APPEND PDAF_COPT "-O2")
elseif (CMAKE_BUILD_TYPE STREQUAL "DEBUG")
list(APPEND PDAF_COPT "-O0")
list(APPEND PDAF_COPT "-g")
list(APPEND PDAF_COPT "-traceback")
else()
message(FATAL_ERROR "Unsupported CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand All @@ -207,6 +238,10 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

list(APPEND PDAF_DOUBLEPRECISION "-fdefault-real-8")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

list(APPEND PDAF_DOUBLEPRECISION "-r8")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down Expand Up @@ -247,6 +282,10 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")

list(APPEND PDAF_MODULEOPT "-J")

elseif (CMAKE_CXX_COMPILER_ID STREQUAL "NVHPC")

list(APPEND PDAF_MODULEOPT "-module")

else()
message(FATAL_ERROR "Unsupported CMAKE_CXX_COMPILER_ID: ${CMAKE_CXX_COMPILER_ID}")
endif()
Expand Down
27 changes: 26 additions & 1 deletion cmake/BuildPDAFMODEL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,10 @@ endif()

# ParFlow libraries
if(DEFINED PARFLOW_SRC)
list(APPEND PDAF_LIBS "-L${CMAKE_INSTALL_PREFIX}/lib -lpfsimulator -lamps -lpfkinsol -lgfortran -lcjson")
list(APPEND PDAF_LIBS "-L${CMAKE_INSTALL_PREFIX}/lib -lpfsimulator -lamps -lpfkinsol -lcjson")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
list(APPEND PDAF_LIBS "-lgfortran")
endif()
# GPU
# list(APPEND PDAF_LIBS "-L${CMAKE_INSTALL_PREFIX}/rmm/lib -lstdc++ -lcudart -lrmm -lnvToolsExt")

Expand All @@ -117,6 +120,28 @@ if(DEFINED PARFLOW_SRC)
# Unconditional loading of stdc++
list(APPEND PDAF_LIBS "-lstdc++")

# GPU: libpfsimulator and libHYPRE (nvofbf toolchain) contain GPU objects
# requiring CUDA and Umpire libraries at final link of tsmp-pdaf.
if(${ParFlowGPU})
list(APPEND PDAF_LIBS "-lcudart")
# CUDA math libraries needed by GPU-enabled HYPRE (nvofbf toolchain)
list(APPEND PDAF_LIBS "-lcurand")
list(APPEND PDAF_LIBS "-lcublas")
list(APPEND PDAF_LIBS "-lcusparse")
# Umpire memory manager needed by libamps and libHYPRE (nvofbf toolchain)
find_library(UMPIRE_LIB NAMES umpire
HINTS
${UMPIRE_ROOT}/lib
$ENV{UMPIRE_ROOT}/lib
$ENV{EBROOTUMPIRE}/lib
)
if(UMPIRE_LIB)
list(APPEND PDAF_LIBS "${UMPIRE_LIB}")
else()
message(WARNING "BuildPDAFMODEL: Umpire library not found. Set UMPIRE_ROOT or EBROOTUMPIRE if needed.")
endif()
endif()

# SLURM library if enabled (typically on HPC-system)
if(ENABLE_SLURM)
list(APPEND PDAF_LIBS "-lslurm")
Expand Down
17 changes: 15 additions & 2 deletions cmake/BuildParFlow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(PF_FFLAGS "-ffree-line-length-none -ffixed-line-length-none")
elseif(CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_C_COMPILER_ID STREQUAL "IntelLLVM")
set(PF_CFLAGS "-Wall -Werror -Wno-unused-function -Wno-unused-variable")
elseif(CMAKE_C_COMPILER_ID STREQUAL "NVHPC")
set(PF_CFLAGS "-Werror -Wno-unused --diag_suppress=unsigned_compare_with_negative,vla_treated_as_fixed_size_array,code_is_unreachable")
if(NOT ${ParFlowGPU})
message(FATAL_ERROR "BuildParFlow: NVHPC compiler detected but ParFlowGPU is not enabled. "
"NVHPC should for now only be used for GPU-accelerated ParFlow builds (parflowGPU). "
"Use a GNU or Intel compiler for CPU-only ParFlow, or enable parflowGPU.")
endif()
else()
message(FATAL_ERROR "C compiler '${CMAKE_C_COMPILER_ID}' is not supported.")
endif()
Expand All @@ -66,8 +73,14 @@ else()
endif()

# Enable Umpire if exists
if (DEFINED ENV{UMPIRE_ROOT} AND NOT ${PDAF})
set(PF_UMPIRE_FLAG "-DUMPIRE_ROOT=$ENV{UMPIRE_ROOT}")
if (DEFINED ENV{UMPIRE_ROOT} AND (NOT ${PDAF} OR ${ParFlowGPU}))
list(APPEND PF_UMPIRE_FLAG -DUMPIRE_ROOT=$ENV{UMPIRE_ROOT})
if(CMAKE_C_COMPILER_ID STREQUAL "NVHPC")
# Umpire leaks wrong OpenMP compile/linker flags when on NVHPC toolchain.
# See https://github.com/HPSCTerrSys/TSMP2/issues/148
list(APPEND PF_UMPIRE_FLAG -DBLT_OPENMP_COMPILE_FLAGS=-fopenmp
-DBLT_OPENMP_LINK_FLAGS=-fopenmp)
endif()
endif()

# Enable SUNDIALS if exists
Expand Down
4 changes: 2 additions & 2 deletions cmake/BuildeCLM.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
if(${ICON} OR ${ParFlow} OR ${ParFlowGPU})
if(${ICON} OR ${ICONGPU} OR ${ParFlow} OR ${ParFlowGPU})
list(APPEND COUP_OAS_FLAGS -DUSE_OASIS=True)
if(${ParFlow} OR ${ParFlowGPU})
list(APPEND COUP_OAS_FLAGS -DCOUP_OAS_PFL=True)
endif()
if(${ICON})
if(${ICON} OR ${ICONGPU})
list(APPEND COUP_OAS_FLAGS -DCOUP_OAS_ICON=True)
endif()
else()
Expand Down
2 changes: 1 addition & 1 deletion cmake/Utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif()
# Count how many component models shoul be build, and if >=2 compile with OASIS
function(check_build_oasis BUILD_OASIS)
# Combine all options into a list
list(APPEND COMPONENT_MODELS ICON COSMO eCLM CLM3.5 ParFlow ParFlowGPU)
list(APPEND COMPONENT_MODELS ICON ICONGPU COSMO eCLM CLM3.5 ParFlow ParFlowGPU)
# Count enabled models
set(MODELCOUNT 0)
foreach(comp_model IN LISTS COMPONENT_MODELS)
Expand Down
8 changes: 6 additions & 2 deletions env/jsc.2026.gnu.openmpi
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module load PnetCDF
module load Umpire
module load SUNDIALS
module load Tcl
if [[ "$1" == "--parflowgpu" ]]; then
if [[ "$1" == "--parflowgpu" || "$1" == "--icongpu" ]]; then
module load CUDA
module load UCX-settings/RC-CUDA
module load Hypre/3.0.0
Expand All @@ -56,6 +56,10 @@ export CC=mpicc
export FC=mpif90
export CXX=mpicxx

# OMPI_* variables affect OpenMPI backend compilers. They should be
# unset so that the correct default backend compilers are selected.
unset OMPI_CC OMPI_FC OMPI_CXX

# Variables read by TSMP2 cmake scripts
export MPI_HOME=$EBROOTOPENMPI
export UMPIRE_ROOT=$EBROOTUMPIRE
Expand All @@ -70,7 +74,7 @@ echo " MPI lib: OpenMPI v$EBVERSIONOPENMPI"
echo " C: $($CC --version | head -n 1)"
echo " C++: $($CXX --version | head -n 1)"
echo " Fortran: $($FC --version | head -n 1)"
if [[ "$1" == "--parflowgpu" ]]; then
if [[ "$1" == "--parflowgpu" || "$1" == "--icongpu" ]]; then
echo " nvcc: $(nvcc --version | tail -n 1 | cut -d" " -f2)"
echo " CUDAARCHS: $CUDAARCHS"
fi
Expand Down
Loading
Loading