Skip to content

Commit

Permalink
build-hpc template update and module parametrisation
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Dec 9, 2024
1 parent 5b369ae commit 5aa27e6
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions .github/workflows/build-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ jobs:
#SBATCH --gpus-per-task=1
#SBATCH --mem=200G
#SBATCH --qos=dg
modules:
- cmake
- ninja
- prgenv/nvidia
- hpcx-openmpi/2.14.0-cuda
- fftw

runs-on: [self-hosted, linux, hpc]
env:
Expand All @@ -55,18 +61,14 @@ jobs:
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
sbatch_options: ${{ matrix.sbatch_options }}
template_data: |
modules:
- cmake
- ninja
- ecbuild
- prgenv/nvidia
- hpcx-openmpi/2.14.0-cuda
- fftw
modules: [${{ join(matrix.modules, ', ' }}]
cmake_options:
- -DENABLE_MPI=ON
- -DENABLE_ACC=ON
- -DENABLE_GPU=ON
dependencies:
ecmwf/ecbuild:
version: develop
ecmwf-ifs/fiat:
version: develop
cmake_options:
Expand All @@ -75,36 +77,36 @@ jobs:
{% for module in modules %}
module load {{module}}
{% endfor %}
BASEDIR=$PWD
{% 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
cmake -G Ninja -S . -B build {{ options['cmake_options']|join(' ') }}
cmake -G Ninja -S . -B build \
{% for name in dependencies %}
{% set org, proj = name.split('/') %}
-D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
{% endfor %}
{{ options['cmake_options']|join(' ') }}
cmake --build build
cmake --install build --prefix install
cmake --install build --prefix installation
popd
{% endfor %}
mkdir -p ${{ github.repository }}
pushd ${{ github.repository }}
git init
git remote add origin ${{ github.server_url }}/${{ github.repository }}
git fetch origin ${{ github.sha }}
git reset --hard FETCH_HEAD
popd
cmake -G Ninja -S ${{ github.repository }} -B build \
{% for name in dependencies %}
{% set org, proj = name.split('/') %}
-D{{proj}}_ROOT=$PWD/{{name}}/install \
-D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
{% endfor %}
{{ cmake_options|join(' ') }}
cmake --build build
ctest --test-dir build

0 comments on commit 5aa27e6

Please sign in to comment.