From 274101ca3d175a8ab1d182b151b5fda65ea8dcbb Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Fri, 20 Dec 2024 20:06:02 +0100 Subject: [PATCH] ci: refactor gitlab-ci.yml --- .gitlab/common.yml | 26 ++++++++++++++++---------- .gitlab/levante.yml | 27 +++++++-------------------- .gitlab/lumi.yml | 7 ++----- 3 files changed, 25 insertions(+), 35 deletions(-) diff --git a/.gitlab/common.yml b/.gitlab/common.yml index 87f018f61..707122f1c 100644 --- a/.gitlab/common.yml +++ b/.gitlab/common.yml @@ -1,27 +1,33 @@ .dp: variables: - FPMODEL: DP + RTE_ENABLE_SP: OFF FAILURE_THRESHOLD: "7.e-4" .sp: variables: - FPMODEL: SP + RTE_ENABLE_SP: ON FAILURE_THRESHOLD: "3.5e-1" .common: variables: - # Make variables: - MAKEFLAGS: -j8 - RRTMGP_ROOT: ${CI_PROJECT_DIR} - RRTMGP_DATA_TAG: v1.8.2 + CMAKE_BUILD_PARALLEL_LEVEL: 8 + VERBOSE: + # TODO: add missing test dependencies and run them in parallel: + # CTEST_PARALLEL_LEVEL: 8 + CTEST_OUTPUT_ON_FAILURE: 1 script: # # Build libraries, examples and tests # - # - $FC -v - - cmake -S . -B build -DCMAKE_Fortran_COMPILER=$FC -DCMAKE_Fortran_FLAGS="$FCFLAGS" -DRRTMGP_DATA_VERSION=$RRTMGP_DATA_TAG -DPRECISION=$FPMODEL -DUSE_C_BOOL=$RTE_CBOOL -DKERNEL_MODE=$RTE_KERNELS -DENABLE_TESTS=ON -DFAILURE_THRESHOLD=$FAILURE_THRESHOLD - - cmake --build build --config Release -- -j8 + - | + cmake -S . -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DRTE_ENABLE_SP=$RTE_ENABLE_SP \ + -DKERNEL_MODE=$KERNEL_MODE \ + -DBUILD_TESTING=ON \ + -DFAILURE_THRESHOLD=$FAILURE_THRESHOLD + - cmake --build build # # Run examples, tests and checks # - - ctest -V --test-dir build + - ctest --test-dir build diff --git a/.gitlab/levante.yml b/.gitlab/levante.yml index 2a0a1a435..677cf4039 100644 --- a/.gitlab/levante.yml +++ b/.gitlab/levante.yml @@ -29,22 +29,13 @@ variables: .nvhpc: variables: - # Core variables: - # FC: /sw/spack-levante/nvhpc-22.5-v4oky3/Linux_x86_64/22.5/compilers/bin/nvfortran FC: /sw/spack-levante/nvhpc-24.9-p7iohv/Linux_x86_64/24.9/compilers/bin/nvfortran - # 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 + NetCDF_Fortran_ROOT: /sw/spack-levante/netcdf-fortran-4.6.1-4wu5wt .nag: variables: - # Core variables: FC: /sw/spack-levante/nag-7.1-lqjbej/bin/nagfor - # Convenience variables: - VERSION_FCFLAGS: -V - NFHOME: /sw/spack-levante/netcdf-fortran-4.5.3-5di6qe - NCHOME: /sw/spack-levante/netcdf-c-4.8.1-vbnli5 + NetCDF_Fortran_ROOT: /sw/spack-levante/netcdf-fortran-4.5.3-5di6qe .common-levante: extends: .common @@ -52,15 +43,11 @@ variables: PYHOME: /sw/spack-levante/mambaforge-22.9.0-2-Linux-x86_64-kptncg # 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 # Extend the existing environment variables: - export PATH="${PYHOME}/bin:${PATH}" - - export LD_LIBRARY_PATH="${NFHOME}/lib:${NCHOME}/lib:${LD_LIBRARY_PATH-}" # Some tests require a large stack: - ulimit -s unlimited @@ -71,8 +58,8 @@ variables: - .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.8 -DRTE_USE_${FPMODEL} - RTE_KERNELS: accel + FFLAGS: -g -O2 -Mrecursive -Mallocatable=03 -Mstack_arrays -Minfo=accel,inline -acc=gpu,verystrict -gpu=cc80,cuda12.6 + KERNEL_MODE: accel .nag-cpu: extends: @@ -81,17 +68,17 @@ variables: - .common-levante variables: # Compiler flags used for ICON model: - FCFLAGS: -Wc=/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc -f2008 -colour -w=uep -g -gline -O0 -float-store -nan -Wc,-g -Wc,-pipe -Wc,--param,max-vartrack-size=200000000 -Wc,-mno-fma -C=all -DRTE_USE_CBOOL -DRTE_USE_${FPMODEL} + FFLAGS: -Wc=/sw/spack-levante/gcc-11.2.0-bcn7mb/bin/gcc -f2008 -colour -w=uep -g -gline -O0 -float-store -nan -Wc,-g -Wc,-pipe -Wc,--param,max-vartrack-size=200000000 -Wc,-mno-fma -C=all .nag-cpu-default: extends: .nag-cpu variables: - RTE_KERNELS: default + KERNEL_MODE: default .nag-cpu-accel: extends: .nag-cpu variables: - RTE_KERNELS: accel + KERNEL_MODE: accel nvhpc-gpu-openacc-DP: extends: diff --git a/.gitlab/lumi.yml b/.gitlab/lumi.yml index 9e2c1ad4c..4f351f2e2 100644 --- a/.gitlab/lumi.yml +++ b/.gitlab/lumi.yml @@ -38,10 +38,7 @@ variables: .cce: variables: - # Core variables: FC: ftn - # Convenience variables: - VERSION_FCFLAGS: -V COMPILER_MODULES: PrgEnv-cray cce/16.0.1 craype-x86-milan # @@ -91,8 +88,8 @@ setup-python: - .common-lumi variables: # Compiler flags used for ICON model: - FCFLAGS: -hacc -hadd_paren -Ktrap=divz,ovf,inv -hflex_mp=intolerant -hfp1 -g -DRTE_USE_${FPMODEL} - RTE_KERNELS: accel + FFLAGS: -hacc -hadd_paren -Ktrap=divz,ovf,inv -hflex_mp=intolerant -hfp1 -g + KERNEL_MODE: accel # Convenience variables: EXTRA_COMPILER_MODULES: craype-accel-amd-gfx90a rocm