Skip to content

Commit

Permalink
Merge pull request #2 from earth-system-radiation/feature-add-ci
Browse files Browse the repository at this point in the history
Add preliminary CI. Changes in the `rte-rrtmgp` repo should get aligned with here: adopting CMake and C_BOOL by default.
  • Loading branch information
RobertPincus authored Jan 15, 2025
2 parents aafba4c + f5f78cc commit 7bc72cb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ on:
push:
branches:
- main
- feature-add-ci
pull_request:
branches-ignore:
- documentation
workflow_dispatch:

defaults:
Expand Down Expand Up @@ -68,6 +65,7 @@ jobs:
matrix:
config-name:
- nvhpc-gpu-cuda-DP
- nvhpc-gpu-cuda-SP
steps:
#
# Build, run and check (fetch the log)
Expand Down
1 change: 1 addition & 0 deletions .gitlab/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@
#
# Build libraries
#
- git branch
- make libs
21 changes: 9 additions & 12 deletions .gitlab/levante.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ variables:
.nvhpc:
variables:
# Core variables:
FC: /sw/spack-levante/nvhpc-22.5-v4oky3/Linux_x86_64/22.5/compilers/bin/nvfortran
CPPC: /sw/spack-levante/nvhpc-22.5-v4oky3/Linux_x86_64/22.5/compilers/bin/nvc++
# Convenience variables:
VERSION_FCFLAGS: --version
NFHOME: /sw/spack-levante/netcdf-fortran-4.5.4-syv4qr
NCHOME: /sw/spack-levante/netcdf-c-4.9.0-gc7kgj
CUDACXX: nvcc
# Flags used in building Icon
CUDAFLAGS: -Xptxas -O3 -DNDEBUG -DRTE_RRTMGP_GPU_MEMPOOL_CUDA

.common-levante:
extends: .common
Expand All @@ -38,11 +35,10 @@ variables:
# Suppress an irrelevant but annoying error message:
PROJ_LIB: ${PYHOME}/share/proj
# Make variables:
FCINCLUDE: -I${NFHOME}/include
LDFLAGS: -L${NFHOME}/lib -L${NCHOME}/lib
before_script:
- module purge
- module load git
- module load nvhpc/24.7-gcc-11.2.0
# Extend the existing environment variables:
- export PATH="${PYHOME}/bin:${PATH}"
- export LD_LIBRARY_PATH="${NFHOME}/lib:${NCHOME}/lib:${LD_LIBRARY_PATH-}"
Expand All @@ -54,12 +50,13 @@ variables:
- .gpu
- .nvhpc
- .common-levante
variables:
# Compiler flags used for ICON model:
FCFLAGS: -g -O2 -Mrecursive -Mallocatable=03 -Mstack_arrays -Minfo=accel,inline -acc=gpu,verystrict -gpu=cc80,cuda11.7 -DRTE_USE_${FPMODEL}
RTE_KERNELS: accel

nvhpc-gpu-cuda-DP:
extends:
- .dp
- .nvhpc-gpu-openacc

nvhpc-gpu-cuda-SP:
extends:
- .sp
- .nvhpc-gpu-openacc
11 changes: 2 additions & 9 deletions build/Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
#!/usr/bin/env make

#
# Compiler variables FC, FCFLAGS must be set in the environment
#
# Make all the libraries though we'll only use the interface + kernels
all: librtecudakernels.a librrtmgpcudakernels.a

COMPILE = $(FC) $(FCFLAGS) $(FCINCLUDE) -c
%.o: %.F90
$(COMPILE) $<
CUDAFLAGS ?= "-Xptxas -O3 -DNDEBUG -DRTE_RRTMGP_GPU_MEMPOOL_CUDA"
COMPILE_CU = $(CUDACXX) -c $(CUDAFLAGS)

COMPILE_CU = $(CPPC) -c -std=c++17 -O3 -gopt -DRTE_RRTMGP_GPU_MEMPOOL_CUDA -acc -cuda

%.o: %.cu
$(COMPILE_CU) $<
Expand Down

0 comments on commit 7bc72cb

Please sign in to comment.