@@ -2,106 +2,143 @@ name: build-hpc
22
33# Controls when the action will run
44on :
5-
6- # Trigger the workflow on all pushes to main, except on tag creation
75 push :
86 branches :
9- - main
7+ - main
108 tags-ignore :
11- - ' **'
12-
9+ - ' **'
1310 # Trigger the workflow on all pull requests
1411 pull_request : ~
15-
1612 # Allow workflow to be dispatched on demand
1713 workflow_dispatch : ~
18-
1914 # Trigger after public PR approved for CI
2015 pull_request_target :
2116 types : [labeled]
2217
2318jobs :
2419 ci-hpc :
25- name : ci-hpc
26- if : ${{ !github.event.pull_request.head.repo.fork && github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci' }}
20+ name : ci-hpc - ${{ matrix.name }}
21+ if : ${{ ( !github.event.pull_request.head.repo.fork) && ( github.event.action != 'labeled' || github.event.label.name == 'approved-for-ci') }}
2722
2823 strategy :
2924 fail-fast : false # false: try to complete all jobs
30-
3125 matrix :
32- cuda : [False, True]
33- openmp : [False, True]
34- name :
35- - ac-gpu nvhpc
36-
26+ build_type : [RelWithDebInfo]
27+ site : [ac-batch]
28+ name :
29+ - " ac-cpu intel"
30+ - " ac-cpu gnu"
31+ - " ac-gpu nvhpc OpenACC + CUDA"
32+ - " ac-gpu nvhpc OMP offload"
33+ - " ac-gpu nvhpc OpenACC"
34+ - " ac-gpu nvhpc OMP offload + CUDA"
35+
3736 include :
38- - name : ac-gpu nvhpc
39- site : ac-batch
40- sbatch_options : |
37+
38+ # ------------------
39+ # CPU builds
40+ # ------------------
41+ - name : " ac-cpu intel"
42+ compiler : intel-classic
43+ cuda : false
44+ openmp : false
45+ # Define CPU sbatch once, reuse via *sbatch_cpu
46+ sbatch_options : &sbatch_cpu |
4147 # SBATCH --time=00:20:00
4248 # SBATCH --nodes=1
43- #SBATCH --ntasks=1
49+ # SBATCH --ntasks=2
50+ # SBATCH --cpus-per-task=32
51+ # SBATCH --hint=nomultithread
52+ # SBATCH --qos=np
53+ envfile : arch/ecmwf/hpc2020/intel/2021.4.0/env.sh
54+
55+ - name : " ac-cpu gnu"
56+ compiler : gnu-14
57+ cuda : false
58+ openmp : false
59+ sbatch_options : *sbatch_cpu
60+ envfile : arch/ecmwf/hpc2020/gnu/14.2.0/env.sh
61+
62+
63+ # ------------------
64+ # GPU builds (nvhpc)
65+ # ------------------
66+ - name : " ac-gpu nvhpc OpenACC + CUDA"
67+ compiler : nvhpc
68+ cuda : true
69+ openmp : false
70+ # Define GPU sbatch once, reuse in the next GPU entries
71+ sbatch_options : &sbatch_gpu |
72+ # SBATCH --time=00:20:00
73+ # SBATCH --nodes=1
74+ # SBATCH --ntasks=2
4475 # SBATCH --cpus-per-task=32
4576 # SBATCH --gpus-per-task=1
4677 # SBATCH --mem=100G
4778 # SBATCH --qos=dg
79+ cmake_toolchain : &nvhpc_toolchain -DCMAKE_TOOLCHAIN_FILE=arch/ecmwf/hpc2020/nvhpc/24.5/toolchain.cmake
80+ envfile : &nvhpc_envfile arch/ecmwf/hpc2020/nvhpc/24.5/env.sh
81+
82+ - name : " ac-gpu nvhpc OMP offload"
83+ compiler : nvhpc
84+ cuda : false
85+ openmp : true
86+ sbatch_options : *sbatch_gpu
87+ cmake_toolchain : *nvhpc_toolchain
88+ envfile : *nvhpc_envfile
89+
90+ - name : " ac-gpu nvhpc OMP offload + CUDA"
91+ compiler : nvhpc
92+ cuda : true
93+ openmp : true
94+ sbatch_options : *sbatch_gpu
95+ cmake_toolchain : *nvhpc_toolchain
96+ envfile : *nvhpc_envfile
97+
98+ - name : " ac-gpu nvhpc OpenACC"
99+ compiler : nvhpc
100+ cuda : false
101+ openmp : false
102+ sbatch_options : *sbatch_gpu
103+ cmake_toolchain : *nvhpc_toolchain
104+ envfile : *nvhpc_envfile
48105
49106 runs-on : [self-hosted, linux, hpc]
107+
50108 env :
51109 GH_TOKEN : ${{ github.token }}
110+
52111 steps :
53112 - uses : ecmwf-actions/reusable-workflows/ci-hpc-generic@v2
54113 with :
55114 site : ${{ matrix.site }}
56115 troika_user : ${{ secrets.HPC_CI_SSH_USER }}
57116 sbatch_options : ${{ matrix.sbatch_options }}
58117 template_data : |
59- modules:
60- - cmake
61- - ninja
62- - ecbuild
63- - prgenv/nvidia
64- - nvidia/24.5
65- - python3
66118 cmake_options:
67119 - -DENABLE_OMP_OFFLOAD=${{ matrix.openmp }}
68120 - -DENABLE_CUDA=${{ matrix.cuda }}
121+ - -DENABLE_IO_PARALLEL=ON
122+ - -DENABLE_MPI=ON
69123 - -DENABLE_SINGLE_PRECISION=ON
70124 - -DENABLE_DOUBLE_PRECISION=ON
71- - -DCMAKE_TOOLCHAIN_FILE=arch/ecmwf/hpc2020/nvhpc/24.5/toolchain.cmake
125+ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}${{ matrix.cmake_toolchain || '' }}
72126 dependencies:
73127 ecmwf/fckit:
74- version: 0.13 .0
128+ version: 0.14 .0
75129 cmake_options:
76130 - -DENABLE_TESTS=OFF
77131 - -DENABLE_FCKIT_VENV=ON
132+ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
78133 ecmwf-ifs/fiat:
79- version: 1.4 .1
134+ version: 1.6 .1
80135 cmake_options:
136+ - -DENABLE_TESTS=OFF
81137 - -DENABLE_SINGLE_PRECISION=ON
82138 - -DENABLE_DOUBLE_PRECISION=ON
139+ - -DENABLE_MPI=ON
140+ - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
83141 template : |
84- {% for module in modules %}
85- module load {{module}}
86- {% endfor %}
87- BASEDIR=$PWD
88- {% for name, options in dependencies.items() %}
89- mkdir -p {{name}}
90- pushd {{name}}
91- git init
92- git remote add origin ${{ github.server_url }}/{{name}}
93- git fetch origin {{options['version']}}
94- git reset --hard FETCH_HEAD
95- cmake -G Ninja -S . -B build \
96- {% for name in dependencies %}
97- {% set org, proj = name.split('/') %}
98- -D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
99- {% endfor %}
100- {{ options['cmake_options']|join(' ') }}
101- cmake --build build
102- cmake --install build --prefix installation
103- popd
104- {% endfor %}
105142 REPO=${{ github.event.pull_request.head.repo.full_name || github.repository }}
106143 SHA=${{ github.event.pull_request.head.sha || github.sha }}
107144 mkdir -p $REPO
@@ -110,12 +147,32 @@ jobs:
110147 git remote add origin ${{ github.server_url }}/$REPO
111148 git fetch origin $SHA
112149 git reset --hard FETCH_HEAD
150+ source ${{ matrix.envfile }}
113151 popd
114- cmake -G Ninja -S $REPO -B build \
152+ BASEDIR=$PWD
153+ {% for name, options in dependencies.items() %}
154+ mkdir -p {{ name }}
155+ pushd {{ name }}
156+ git init
157+ git remote add origin ${{ github.server_url }}/{{ name }}
158+ git fetch origin {{ options['version'] }}
159+ git reset --hard FETCH_HEAD
160+ cmake -G Ninja -S . -B build \
161+ {% for name in dependencies %}
162+ {% set org, proj = name.split('/') %}
163+ -D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
164+ {% endfor %}
165+ {{ options['cmake_options']|join(' ') }}
166+
167+ cmake --build build
168+ cmake --install build --prefix installation
169+ popd
170+ {% endfor %}
171+ cmake -G "Unix Makefiles" -S $REPO -B build \
115172 {% for name in dependencies %}
116173 {% set org, proj = name.split('/') %}
117174 -D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
118175 {% endfor %}
119176 {{ cmake_options|join(' ') }}
120177 cmake --build build
121- ctest -- test-dir build
178+ ctest -VV -- test-dir build --output-on-failure
0 commit comments