#514 correct tag given to invoke arguments to only use name and not i… #6407
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ----------------------------------------------------------------------------- | |
| # BSD 3-Clause License | |
| # | |
| # Copyright (c) 2024-2025, Science and Technology Facilities Council. | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are met: | |
| # | |
| # * Redistributions of source code must retain the above copyright notice, this | |
| # list of conditions and the following disclaimer. | |
| # | |
| # * Redistributions in binary form must reproduce the above copyright notice, | |
| # this list of conditions and the following disclaimer in the documentation | |
| # and/or other materials provided with the distribution. | |
| # | |
| # * Neither the name of the copyright holder nor the names of its | |
| # contributors may be used to endorse or promote products derived from | |
| # this software without specific prior written permission. | |
| # | |
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
| # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | |
| # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | |
| # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | |
| # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | |
| # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | |
| # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |
| # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
| # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | |
| # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| # POSSIBILITY OF SUCH DAMAGE. | |
| # ----------------------------------------------------------------------------- | |
| # Author S. Siso, STFC Daresbury Lab | |
| # This workflow will use a self-hosted runner to perform the more expensive | |
| # integrations tests that are not run on GHA systems. | |
| name: NEMOv4 Integration Tests | |
| on: | |
| push | |
| env: | |
| HDF5_VERSION: 1.14 | |
| NETCDF_C_VERSION: 4.9 | |
| NETCDF_FORTRAN_VERSION: 4.6 | |
| NVFORTRAN_VERSION: 25.7 | |
| ONEAPI_VERSION: 2025.0 | |
| PERL_VERSION: 5.42 | |
| PYTHON_VERSION: 3.14 | |
| NUM_PARALLEL: 16 | |
| PREFIX: /archive/psyclone-tests/latest-run/ | |
| jobs: | |
| run_if_on_mirror: | |
| if: ${{ github.repository == 'stfc/PSyclone-mirror' }} | |
| runs-on: self-hosted | |
| outputs: | |
| nemo_omp_offload: ${{ steps.nemo_omp_offload.outputs.time }} | |
| nemo_acc_kernels: ${{ steps.nemo_acc_kernels.outputs.time }} | |
| nemo_acc_loops: ${{ steps.nemo_acc_loops.outputs.time }} | |
| nemo_omp_cpu: ${{ steps.nemo_omp_cpu.outputs.time }} | |
| nemo_omp_offload_async: ${{ steps.nemo_omp_offload_async.outputs.time }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| # This is required to get the commit history for merge commits for | |
| # the ci-skip check below. | |
| fetch-depth: '0' | |
| - name: Check for [skip ci] in commit message | |
| uses: mstachniuk/ci-skip@v1 | |
| with: | |
| # This setting causes the tests to 'fail' if [skip ci] is specified | |
| fail-fast: true | |
| commit-filter: '[skip ci]' | |
| - name: Install dependencies | |
| run: | | |
| module load python/${PYTHON_VERSION} | |
| python -m venv .runner_venv | |
| . .runner_venv/bin/activate | |
| python -m pip install --upgrade pip | |
| # Uncomment the below to use the submodule version of fparser rather | |
| # than the latest release from pypi. | |
| # pip install external/fparser | |
| pip install .[test] | |
| # Compile nvidia profiling tools | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| cd lib/profiling/nvidia/ | |
| F90=nvfortran make | |
| - name: Reset working directory | |
| run: | | |
| rm -rf ${PREFIX}/UKMO-NEMOv4 | |
| cp -r /archive/psyclone-tests/nemo-inputs/UKMO-NEMOv4 ${PREFIX}/UKMO-NEMOv4 | |
| rm -rf ${PREFIX}/ECMWF-NEMOv4 | |
| cp -r /archive/psyclone-tests/nemo-inputs/ECMWF-NEMOv4 ${PREFIX}/ECMWF-NEMOv4 | |
| # PSyclone passthrough for MetOffice NEMO | |
| - name: NEMO MetOffice Passthrough | |
| # Only bother doing passthrough if this is a re-run of a previous test. | |
| if: ${{ github.run_attempt != '1' }} | |
| run: | | |
| . .runner_venv/bin/activate | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export NEMO_DIR=${PREFIX}/UKMO-NEMOv4 | |
| export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script | |
| cd $PSYCLONE_NEMO_DIR | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION} | |
| module load perl/${PERL_VERSION} | |
| make -j ${NUM_PARALLEL} passthrough | |
| make -j ${NUM_PARALLEL} compile-passthrough | |
| make run-passthrough | |
| # Check for full numerical reproducibility with KGO results | |
| diff <(make -s output-passthrough) KGOs/run.stat.nemo4.spitz12.nvhpc.10steps | |
| # PSyclone, compile and run MetOffice NEMO with OpenMP for GPUs | |
| - name: NEMO MetOffice OpenMP for GPU | |
| id: nemo_omp_offload | |
| run: | | |
| . .runner_venv/bin/activate | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export NEMO_DIR=${PREFIX}/UKMO-NEMOv4 | |
| cd $PSYCLONE_NEMO_DIR | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION} | |
| module load perl/${PERL_VERSION} | |
| make clean | |
| export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script | |
| make -j ${NUM_PARALLEL} openmp_gpu | |
| make -j ${NUM_PARALLEL} compile-openmp_gpu | |
| export NV_ACC_POOL_THRESHOLD=75 | |
| export CUDA_VISIBLE_DEVICES=1 | |
| make run-openmp_gpu | |
| # Check for full numerical reproducibility with KGO results | |
| diff <(make -s output-openmp_gpu) KGOs/run.stat.nemo4.spitz12.nvhpc.10steps | |
| export VAR_TIME=$(grep -A 1 "Elapsed Time" <(make -s time-openmp_gpu) | head -n 2 | tail -n 1 | awk '{print $1}') | |
| echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" | |
| # PSyclone, compile and run MetOffice NEMO with OpenACC kernels for GPUs | |
| - name: NEMO MetOffice OpenACC kernels for GPU | |
| id: nemo_acc_kernels | |
| run: | | |
| . .runner_venv/bin/activate | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export PROFILE_HOME=${GITHUB_WORKSPACE}/lib/profiling/nvidia/ | |
| export NEMO_DIR=${PREFIX}/UKMO-NEMOv4 | |
| cd $PSYCLONE_NEMO_DIR | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION} | |
| module load perl/${PERL_VERSION} | |
| make clean | |
| make -j ${NUM_PARALLEL} openacc_kernels | |
| COMPILER_ARCH=linux_nvidia_acc_gpu make -j ${NUM_PARALLEL} compile-openacc_kernels | |
| export NV_ACC_POOL_THRESHOLD=75 | |
| export CUDA_VISIBLE_DEVICES=1 | |
| make run-openacc_kernels | |
| # Check the output is as expected (TODO #2895: improve numerical reproducibility) | |
| make output-openacc_kernels | grep -q " it : 10" || (echo "Error: 'it : 10' not found!" & false) | |
| make output-openacc_kernels | grep -q "|ssh|_max: 0.259483" || (echo "Error: '|ssh|_max: 0.259483' not found!" & false) | |
| make output-openacc_kernels | grep -q "|U|_max: 0.458515" || (echo "Error: '|U|_max: 0.458515' not found!" & false) | |
| make output-openacc_kernels | grep -q "S_min: 0.482686" || (echo "Error: 'S_min: 0.482686' not found!" & false) | |
| make output-openacc_kernels | grep -q "S_max: 0.407622" || (echo "Error: 'S_max: 0.407622' not found!" & false) | |
| export VAR_TIME=$(grep -A 1 "Elapsed Time" <(make -s time-openacc_kernels) | head -n 2 | tail -n 1 | awk '{print $1}') | |
| echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" | |
| # PSyclone, compile and run MetOffice NEMO with OpenACC loops for GPUs | |
| - name: NEMO MetOffice OpenACC loops for GPU | |
| id: nemo_acc_loops | |
| run: | | |
| . .runner_venv/bin/activate | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export PROFILE_HOME=${GITHUB_WORKSPACE}/lib/profiling/nvidia/ | |
| export NEMO_DIR=${PREFIX}/UKMO-NEMOv4 | |
| cd $PSYCLONE_NEMO_DIR | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION} | |
| module load perl/${PERL_VERSION} | |
| make clean | |
| make -j ${NUM_PARALLEL} openacc_loops | |
| COMPILER_ARCH=linux_nvidia_acc_gpu make -j ${NUM_PARALLEL} compile-openacc_loops | |
| export NV_ACC_POOL_THRESHOLD=75 | |
| export CUDA_VISIBLE_DEVICES=1 | |
| make run-openacc_loops | |
| # Check the output is as expected (TODO #2895: improve numerical reproducibility) | |
| make output-openacc_loops | grep -q " it : 10" || (echo "Error: 'it : 10' not found!" & false) | |
| make output-openacc_loops | grep -q "|ssh|_max: 0.259483" || (echo "Error: '|ssh|_max: 0.259483' not found!" & false) | |
| make output-openacc_loops | grep -q "|U|_max: 0.458515" || (echo "Error: '|U|_max: 0.458515' not found!" & false) | |
| make output-openacc_loops | grep -q "S_min: 0.482686" || (echo "Error: 'S_min: 0.482686' not found!" & false) | |
| make output-openacc_loops | grep -q "S_max: 0.407622" || (echo "Error: 'S_max: 0.407622' not found!" & false) | |
| export VAR_TIME=$(grep -A 1 "Elapsed Time" <(make -s time-openacc_loops) | head -n 2 | tail -n 1 | awk '{print $1}') | |
| echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" | |
| # PSyclone, compile and run ECMWF NEMO with OpenMP for CPUs. This uses | |
| # the Intel compiler and does not disable MPI. | |
| - name: NEMO ECMWF OpenMP for CPU | |
| id: nemo_omp_cpu | |
| run: | | |
| # Load environment | |
| source /archive/psyclone-spack/psyclone-spack-Jun25/spack-repo/share/spack/setup-env.sh | |
| spack unload && spack load nemo-build-environment%oneapi@${ONEAPI_VERSION} | |
| source .runner_venv/bin/activate | |
| # Set up envvars | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export PSYCLONE_COMPILER=$MPIF90 | |
| export MPIF90=psyclonefc | |
| export PSYCLONE_OPTS="--enable-cache -l output -s ${PSYCLONE_NEMO_DIR}/omp_cpu_trans.py -I ${MPI_HOME}/include" | |
| export FCFLAGS="-i4 -r8 -O2 -heap-arrays -fp-model=precise -g -qopenmp" | |
| export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script | |
| # Compile | |
| cd ${PREFIX}/ECMWF-NEMOv4 | |
| ./makenemo -r SPITZ12 -m linux_spack -n SPITZ12_psyclone \ | |
| add_key "IEEE_IS_NAN=ieee_is_nan key_nosignedzero" \ | |
| del_key "key_iomput" -j ${NUM_PARALLEL} | |
| # Run NEMO | |
| cd cfgs/SPITZ12_psyclone/EXP00/ | |
| ln -sf /archive/psyclone-tests/nemo-inputs/ECMWF-eORCA1_GO8/* . | |
| export OMP_NUM_THREADS=12 | |
| ./nemo | |
| diff run.stat $PSYCLONE_NEMO_DIR/KGOs/run.stat.nemo4.spitz12.oneapi.10steps | |
| export VAR_TIME=$(grep -A 1 "Elapsed Time" timing.output | head -n 2 | tail -n 1 | awk '{print $1}') | |
| echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" | |
| # PSyclone, compile and run MetOffice NEMO with OpenMP for GPUs with Asynchronous directives | |
| - name: NEMO MetOffice OpenMP for GPU with async | |
| id: nemo_omp_offload_async | |
| run: | | |
| . .runner_venv/bin/activate | |
| export PSYCLONE_NEMO_DIR=${GITHUB_WORKSPACE}/examples/nemo/scripts | |
| export NEMO_DIR=${PREFIX}/UKMO-NEMOv4 | |
| cd $PSYCLONE_NEMO_DIR | |
| module load nvidia-hpcsdk/${NVFORTRAN_VERSION} | |
| module load hdf5/${HDF5_VERSION} netcdf-c/${NETCDF_C_VERSION} netcdf-fortran/${NETCDF_FORTRAN_VERSION} | |
| module load perl/${PERL_VERSION} | |
| make clean | |
| export NEMOV4=1 # Enables specific NEMOV4 exclusions in the PSyclone transformation script | |
| export ASYNC_PARALLEL=1 | |
| make -j ${NUM_PARALLEL} openmp_gpu | |
| make -j ${NUM_PARALLEL} compile-openmp_gpu | |
| export NV_ACC_POOL_THRESHOLD=75 | |
| export CUDA_VISIBLE_DEVICES=1 | |
| make run-openmp_gpu | |
| # Check for full numerical reproducibility with KGO results | |
| diff <(make -s output-openmp_gpu) KGOs/run.stat.nemo4.spitz12.nvhpc.10steps | |
| export VAR_TIME=$(grep -A 1 "Elapsed Time" <(make -s time-openmp_gpu) | head -n 2 | tail -n 1 | awk '{print $1}') | |
| echo "time=${VAR_TIME}" >> "${GITHUB_OUTPUT}" | |
| upload_if_on_mirror: | |
| if: ${{ github.repository == 'stfc/PSyclone-mirror' }} | |
| runs-on: ubuntu-latest | |
| needs: run_if_on_mirror | |
| steps: | |
| - name: Install mongosh | |
| run: | | |
| sudo apt-get install gnupg | |
| wget -qO- https://www.mongodb.org/static/pgp/server-8.0.asc | sudo tee /etc/apt/trusted.gpg.d/server-8.0.asc | |
| echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list | |
| sudo apt-get update | |
| sudo apt-get install -y mongodb-mongosh | |
| - name: Upload results | |
| run: | | |
| export COMMON_FIELDS='branch_name: "'"$GITHUB_REF_NAME"'", commit: "'"$GITHUB_SHA"'", date: new Date()' | |
| export COMMON_FIELDS=${COMMON_FIELDS}', github_job: "'"$GITHUB_RUN_ID"'"-"'"$GITHUB_RUN_ATTEMPT"'"' | |
| export COMMON_FIELDS=${COMMON_FIELDS}', system: "Rupert"' | |
| mongosh \ | |
| "mongodb+srv://cluster0.x8ncpxi.mongodb.net/PerformanceMonitoring" \ | |
| --quiet --apiVersion 1 --username ${{ secrets.MONGODB_USERNAME }} \ | |
| --password ${{ secrets.MONGODB_PASSWORD }} \ | |
| --eval 'db.GitHub_CI.insertMany([ | |
| { | |
| ci_test: "NEMOv4 OpenMP for GPU", | |
| nemo_version: "NEMO MO 4.0.2", | |
| compiler:"nvhpc-'"$NVFORTRAN_VERSION"'", | |
| elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_omp_offload}}"', | |
| '"$COMMON_FIELDS"' | |
| }, | |
| { | |
| ci_test: "NEMOv4 OpenACC kernels for GPU", | |
| nemo_version: "MEMO MO 4.0.2", | |
| compiler:"nvhpc-'"$NVFORTRAN_VERSION"'", | |
| elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_acc_kernels}}"', | |
| '"$COMMON_FIELDS"' | |
| }, | |
| { | |
| ci_test: "NEMOv4 OpenACC loops for GPU", | |
| nemo_version: "MEMO MO 4.0.2", | |
| compiler:"nvhpc-'"$NVFORTRAN_VERSION"'", | |
| elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_acc_loops}}"', | |
| '"$COMMON_FIELDS"' | |
| }, | |
| { | |
| ci_test: "NEMOv4 OpenMP for CPU", | |
| nemo_version: "NEMO ECMWF 4.0 V40 with mpp", | |
| compiler:"intel-'"$ONEAPI_VERSION"'", | |
| elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_omp_cpu}}"', | |
| '"$COMMON_FIELDS"' | |
| }, | |
| { | |
| ci_test: "NEMOv4 OpenMP for GPU Async", | |
| nemo_version: "NEMO MO 4.0.2", | |
| compiler:"nvhpc-'"$NVFORTRAN_VERSION"'", | |
| elapsed_time: '"${{needs.run_if_on_mirror.outputs.nemo_omp_offload_async}}"', | |
| '"$COMMON_FIELDS"' | |
| }])' |