-
Notifications
You must be signed in to change notification settings - Fork 15
174 lines (156 loc) · 5.64 KB
/
build-hpc.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: build-hpc
# Controls when the action will run
on:
# 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:
ECWAM_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 sp
- ac-cpu intel sp
include:
# - name: ac-gpu nvhpc sp
# site: ac-batch
# sbatch_options: |
# #SBATCH --time=00:20:00
# #SBATCH --nodes=1
# #SBATCH --ntasks=4
# #SBATCH --cpus-per-task=32
# #SBATCH --gpus-per-task=1
# #SBATCH --mem=0
# #SBATCH --qos=dg
# modules:
# - cmake
# - fcm
# - ninja
# - ecbuild
# - prgenv/nvidia
# - hpcx-openmpi/2.14.0-cuda
# - python3
# gpu: 1
- name: ac-cpu intel sp
site: ac-batch
sbatch_options: |
#SBATCH --time=00:20:00
#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --cpus-per-task=32
#SBATCH --hint=nomultithread
#SBATCH --mem=60GB
#SBATCH --qos=np
modules:
- cmake
- fcm
- ninja
- ecbuild
- prgenv/intel
- intel/2021.4.0
- hpcx-openmpi/2.9.0
- python3
gpu: 0
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.HPC_CI_SSH_USER }}
sbatch_options: ${{ matrix.sbatch_options }}
template_data: |
cmake_options:
- -DENABLE_MPI=ON
- -DENABLE_LOKI=${{ matrix.gpu }}
- -DENABLE_ACC=${{ matrix.gpu }}
- -DENABLE_CUDA=${{ matrix.gpu }}
- -DENABLE_GPU_AWARE_MPI=${{ matrix.gpu }}
- -DENABLE_SINGLE_PRECISION=ON
- -DBUILD_SHARED_LIBS=${{ !matrix.gpu }}
dependencies:
ecmwf/eccodes:
version: develop
cmake_options:
- -DENABLE_MEMFS=ON
- -DENABLE_JPG=OFF
- -DENABLE_PNG=OFF
- -DBUILD_SHARED_LIBS=${{ !matrix.gpu }}
ecmwf/fckit:
version: 0.13.0
cmake_options:
- -DENABLE_TESTS=OFF
- -DENABLE_FCKIT_VENV=ON
- -DBUILD_SHARED_LIBS=${{ !matrix.gpu }}
ecmwf-ifs/fiat:
version: 1.4.1
cmake_options:
- -DENABLE_MPI=ON
- -DENABLE_SINGLE_PRECISION=ON
- -DENABLE_DOUBLE_PRECISION=OFF
- -DBUILD_SHARED_LIBS=${{ !matrix.gpu }}
ecmwf-ifs/field_api:
version: v0.3.1
cmake_options:
- -DENABLE_TESTS=OFF
- -DENABLE_ACC=${{ matrix.gpu }}
- -DENABLE_CUDA=${{ matrix.gpu }}
- -DENABLE_SINGLE_PRECISION=ON
- -DENABLE_DOUBLE_PRECISION=OFF
- -DBUILD_SHARED_LIBS=${{ !matrix.gpu }}
ecmwf-ifs/loki:
version: v0.2.9
cmake_options:
- -DENABLE_NO_INSTALL=${{ !matrix.gpu }}
- -DENABLE_TESTS=OFF
template: |
{% for module in "${{ join(matrix.modules, ',') }}".split(',') %}
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 \
{% 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 installation
popd
{% endfor %}
REPO=${{ github.event.pull_request.head.repo.full_name || github.repository }}
SHA=${{ github.event.pull_request.head.sha || github.sha }}
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
cmake -G Ninja -S $REPO -B build \
{% for name in dependencies %}
{% set org, proj = name.split('/') %}
-D{{proj}}_ROOT=$BASEDIR/{{name}}/installation \
{% endfor %}
{{ cmake_options|join(' ') }}
cmake --build build
ctest --test-dir build