Merge branch 'release/1.8.0' #3
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
| name: build-hpc | |
| # Controls when the action will run | |
| on: | |
| # Trigger the workflow on all pushes to main and develop, except on tag creation | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| tags-ignore: | |
| - '**' | |
| # Trigger the workflow on all pull requests | |
| pull_request: ~ | |
| # Allow workflow to be dispatched on demand | |
| workflow_dispatch: ~ | |
| # Trigger after public PR approved for CI | |
| pull_request_target: | |
| types: [labeled] | |
| env: | |
| ECTRANS_TOOLS: ${{ github.workspace }}/.github/tools | |
| CTEST_PARALLEL_LEVEL: 1 | |
| CACHE_SUFFIX: v1 # Increase to force new cache to be created | |
| jobs: | |
| ci-hpc: | |
| name: ci-hpc | |
| if: ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }} | |
| strategy: | |
| fail-fast: false # false: try to complete all jobs | |
| matrix: | |
| name: | |
| - ac-gpu nvhpc | |
| - lumi-g cce | |
| include: | |
| - name: ac-gpu nvhpc | |
| site: ac-batch | |
| troika_user_secret: HPC_CI_SSH_USER | |
| sbatch_options: | | |
| #SBATCH --time=00:30:00 | |
| #SBATCH --nodes=1 | |
| #SBATCH --ntasks=4 | |
| #SBATCH --cpus-per-task=32 | |
| #SBATCH --gpus-per-task=1 | |
| #SBATCH --mem=200G | |
| #SBATCH --qos=dg | |
| modules: | |
| - cmake | |
| - ninja | |
| - prgenv/nvidia | |
| - nvidia/24.5 | |
| - hpcx-openmpi/2.19.0-cuda | |
| - fftw | |
| env_vars: | |
| - CMAKE_GENERATOR=Ninja | |
| - name: lumi-g cce | |
| site: lumi | |
| troika_user_secret: LUMI_CI_SSH_USER | |
| account_secret: LUMI_CI_PROJECT | |
| sbatch_options: | | |
| #SBATCH --time=01:10:00 | |
| #SBATCH --nodes=1 | |
| #SBATCH --ntasks-per-node=8 | |
| #SBATCH --gpus-per-task=1 | |
| #SBATCH --partition=standard-g | |
| #SBATCH --account={0} | |
| modules: | |
| - LUMI/25.03 | |
| - cce/19.0.0 | |
| - craype-accel-amd-gfx90a | |
| - rocm/6.3.4 | |
| - cray-fftw | |
| - buildtools | |
| output_dir: /scratch/{0}/github-actions/ectrans/${{ github.run_id }}/${{ github.run_attempt }} | |
| workdir: /scratch/{0}/github-actions/ectrans/${{ github.run_id }}/${{ github.run_attempt }} | |
| env_vars: | |
| - ROCFFT_RTC_CACHE_PATH=$PWD/../../rocfft_kernel_cache.db | |
| - MPICH_GPU_SUPPORT_ENABLED=1 | |
| - MPICH_SMP_SINGLE_COPY_MODE=NONE | |
| - CMAKE_BUILD_PARALLEL_LEVEL=1 | |
| runs-on: [self-hosted, linux, hpc] | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: ecmwf-actions/reusable-workflows/ci-hpc-generic@v2 | |
| with: | |
| site: ${{ matrix.site }} | |
| troika_user: ${{ secrets[matrix.troika_user_secret] }} | |
| sbatch_options: ${{ format(matrix.sbatch_options, secrets[matrix.account_secret]) }} | |
| output_dir: ${{ format(matrix.output_dir, secrets[matrix.account_secret]) || '' }} | |
| workdir: ${{ format(matrix.workdir, secrets[matrix.account_secret]) || '' }} | |
| template_data: | | |
| site: ${{ matrix.site }} | |
| cmake_options: | |
| - -DENABLE_MPI=ON | |
| - -DENABLE_GPU=ON | |
| - -DENABLE_ETRANS=ON | |
| - -DENABLE_GPU_GRAPHS_GEMM=OFF | |
| - -DENABLE_GPU_GRAPHS_FFT=OFF | |
| ctest_options: ${{ matrix.ctest_options || '' }} | |
| dependencies: | |
| ecmwf/ecbuild: | |
| version: develop | |
| ecmwf-ifs/fiat: | |
| version: develop | |
| cmake_options: | |
| - -DENABLE_MPI=ON | |
| template: | | |
| REPO=${{ github.event.pull_request.head.repo.full_name || github.repository }} | |
| SHA=${{ github.event.pull_request.head.sha || github.sha }} | |
| # Cleanup function | |
| cleanup() { | |
| {% for name in dependencies.keys() %} | |
| rm -r {{name}} | |
| {% endfor %} | |
| rm -r $REPO | |
| rm -r build | |
| } | |
| error_trap() { | |
| cleanup | |
| echo "Finished: FAILURE" | |
| exit 1 | |
| } | |
| trap error_trap ERR | |
| {% for module in "${{ join(matrix.modules, ',') }}".split(',') %} | |
| module load {{module}} | |
| {% endfor %} | |
| {% for var in "${{ join(matrix.env_vars, ',') }}".split(',') %} | |
| export {{var}} | |
| {% endfor %} | |
| export CMAKE_TEST_LAUNCHER="srun;-n;1" | |
| export DR_HOOK_ASSERT_MPI_INITIALIZED=0 | |
| BASEDIR=$PWD | |
| # Fetch dependencies | |
| {% for name, options in dependencies.items() %} | |
| mkdir -p {{name}} | |
| pushd {{name}} | |
| git init | |
| git remote add origin ${{ github.server_url }}/{{name}} | |
| git fetch origin {{options['version']}} | |
| git reset --hard FETCH_HEAD | |
| popd | |
| {% endfor %} | |
| # Fetch ecTrans | |
| mkdir -p $REPO | |
| pushd $REPO | |
| git init | |
| git remote add origin ${{ github.server_url }}/$REPO | |
| git fetch origin $SHA | |
| git reset --hard FETCH_HEAD | |
| popd | |
| # Build dependencies | |
| {% for name, options in dependencies.items() %} | |
| pushd {{name}} | |
| cmake -S . -B build \ | |
| {% for name in dependencies %} | |
| {% set org, proj = name.split('/') %} | |
| -D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \ | |
| {% endfor %} | |
| -DCMAKE_TOOLCHAIN_FILE=$BASEDIR/$REPO/.github/arch/{{ site }}.cmake \ | |
| {{ options['cmake_options']|join(' ') }} | |
| cmake --build build | |
| cmake --install build --prefix installation | |
| popd | |
| {% endfor %} | |
| # Build ecTrans | |
| cmake -S $REPO -B build \ | |
| {% for name in dependencies %} | |
| {% set org, proj = name.split('/') %} | |
| -D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \ | |
| {% endfor %} | |
| -DCMAKE_TOOLCHAIN_FILE=$BASEDIR/$REPO/.github/arch/{{ site }}.cmake \ | |
| {{ cmake_options|join(' ') }} | |
| cmake --build build | |
| ctest --test-dir build --output-on-failure {{ ctest_options }} | |
| cleanup | |