-
Notifications
You must be signed in to change notification settings - Fork 256
Expand file tree
/
Copy path.azure-pipelines.yml
More file actions
225 lines (213 loc) · 8.32 KB
/
.azure-pipelines.yml
File metadata and controls
225 lines (213 loc) · 8.32 KB
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# -*- mode: yaml -*-
pool:
vmImage: 'ubuntu-24.04'
trigger:
branches:
include:
- development
paths:
exclude:
- 'Docs/**'
- 'Tools/machines/**'
- '**/*.rst'
- '**/*.md'
pr:
autoCancel: true
drafts: false
paths:
exclude:
- 'Docs/**'
- 'Tools/machines/**'
- '**/*.rst'
- '**/*.md'
jobs:
- job:
# FIXME remove unused variables
variables:
BLASPP_HOME: '/usr/local'
CEI_SUDO: 'sudo'
CEI_TMP: '/tmp/cei'
CMAKE_GENERATOR: 'Ninja'
FFTW_HOME: '/usr'
PETSC_ARCH: 'arch-opt'
LAPACKPP_HOME: '/usr/local'
WARPX_CI_CCACHE: 'TRUE'
#WARPX_OPENPMD: 'TRUE'
strategy:
matrix:
# 1D Cartesian, Cylindrical, Spherical
1d:
WARPX_CMAKE_FLAGS: -DWarpX_DIMS='1;RCYLINDER;RSPHERE' -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PETSC=ON
# Cartesian 2D
cartesian_2d:
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=2 -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PETSC=ON
# Cartesian 3D
cartesian_3d:
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=3 -DWarpX_FFT=ON -DWarpX_PYTHON=ON
# Cylindrical RZ
cylindrical_rz:
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=RZ -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PETSC=ON
WARPX_RZ_FFT: 'TRUE'
# single precision
#single_precision:
# WARPX_CMAKE_FLAGS: -DWarpX_DIMS='1;2;3;RZ' -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PRECISION=SINGLE
# WARPX_RZ_FFT: 'TRUE'
# default: 60; maximum: 360
timeoutInMinutes: 240
steps:
# Ccache caching:
# - once stored under a key, they become immutable (even if cache content changes)
# - for a refresh the key has to change, e.g., hash of a tracked file in the key
- bash: |
mkdir -p /home/vsts/.ccache
displayName: 'Create Ccache Directory'
- task: Cache@2
continueOnError: true
inputs:
# unique per commit, so effectively never an exact hit; a new cache is saved each build
key: 'Ccache | "$(System.JobName)" | dependencies.json | "$(Build.SourceVersion)"'
# progressively less specific fallbacks:
# 1. same job + same dependencies (best match)
# 2. same job, any dependencies (broader fallback)
# Azure Piplines implicitly scope to current branch first,
# then the target branch for PRs.
restoreKeys: |
Ccache | "$(System.JobName)" | dependencies.json
Ccache | "$(System.JobName)"
path: /home/vsts/.ccache
cacheHitVar: CCACHE_CACHE_RESTORED
displayName: 'Cache Ccache Objects'
- bash: |
set -o nounset errexit pipefail
cat /proc/cpuinfo | grep "model name" | sort -u
df -h
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
sudo apt update
sudo apt install -y ccache curl gcc gfortran git g++ ninja-build \
openmpi-bin libopenmpi-dev \
libfftw3-dev libfftw3-mpi-dev libhdf5-openmpi-dev pkg-config make \
python3 python3-pandas python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev libsuperlu-dev libsuperlu-dist-dev
ccache --set-config=max_size=1G
ccache --set-config=compression=1
ccache --set-config=compression_level=10
ccache -z
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade build
python3 -m pip install --upgrade packaging
python3 -m pip install --upgrade setuptools[core]
python3 -m pip install --upgrade wheel
python3 -m pip install --upgrade virtualenv
python3 -m pip install --upgrade pipx
python3 -m pipx install cmake
python3 -m pipx ensurepath
export PATH="$HOME/.local/bin:$PATH"
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall
sudo chmod a+x /usr/local/bin/cmake-easyinstall
#if [ "${WARPX_OPENPMD:-FALSE}" == "TRUE" ]; then
# cmake-easyinstall --prefix=/usr/local \
# git+https://github.com/openPMD/openPMD-api.git@0.14.3 \
# -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
# -DCMAKE_VERBOSE_MAKEFILE=ON \
# -DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
# #python3 -m pip install --upgrade openpmd-api
#fi
if [[ "${WARPX_CMAKE_FLAGS}" == *"-DWarpX_PETSC=ON"* ]]; then
git clone --depth 1 --shallow-submodules -b release https://gitlab.com/petsc/petsc.git petsc
cd petsc
./configure \
--prefix=/usr \
--with-fortran-bindings=no \
--with-x=no \
--with-cc="ccache mpicc" \
--with-fc="ccache mpif90" \
--with-cxx="ccache mpicxx" \
--with-debugging=0 \
--with-superlu=1 \
--with-superlu-include=/usr/include/superlu \
--with-superlu-lib="-lsuperlu" \
--with-superlu_dist=1 \
--with-superlu_dist-include=/usr/include/superlu-dist \
--with-superlu_dist-lib="-lsuperlu_dist"
make -j 2
sudo make install
cd -
fi
if [ "${WARPX_RZ_FFT:-FALSE}" == "TRUE" ]; then
# BLAS++
cmake-easyinstall --prefix=/usr/local \
git+https://github.com/icl-utk-edu/blaspp.git \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_STANDARD=20 \
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
# LAPACK++
cmake-easyinstall --prefix=/usr/local \
git+https://github.com/icl-utk-edu/lapackpp.git \
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
-DCMAKE_CXX_STANDARD=20 \
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
fi
# Remove system copy of Matplotlib to avoid conflict
# with version set in the requirements file - see, e.g.,
# https://github.com/matplotlib/matplotlib/issues/28768.
sudo apt remove python3-matplotlib
# Python modules required for test analysis
python3 -m pip install --upgrade -r Regression/requirements.txt
python3 -m pip cache purge
# external repositories required for test analysis
cd ..
git clone --depth 1 https://github.com/BLAST-WarpX/warpx-data.git
# TODO select only specific datasets?
git clone --depth 1 https://github.com/openPMD/openPMD-example-datasets.git
cd -
rm -rf ${CEI_TMP}
df -h
displayName: 'Install dependencies'
- bash: |
# set options
set -o nounset errexit pipefail
# display disk space usage
df -h
# configure
export AMReX_CMAKE_FLAGS="-DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON"
export WARPX_TEST_FLAGS="-DWarpX_TEST_CLEANUP=ON -DWarpX_TEST_FPETRAP=ON -DWarpX_BACKTRACE_INFO=ON"
cmake -S . -B build \
${AMReX_CMAKE_FLAGS} \
${WARPX_CMAKE_FLAGS} \
${WARPX_TEST_FLAGS}
# build
cmake --build build -j 2
displayName: 'Build'
- bash: |
# display disk space usage
df -h
# display ccache hits & size
ccache -s
displayName: 'CCache Hits'
- bash: |
# set options
set -o nounset errexit pipefail
# determine if the build was triggered by a push to the development branch
if [[ "$(Build.SourceBranch)" == "refs/heads/development" ]]; then
# run tests (exclude pytest.AMReX when running Python tests)
# and submit results to CDash as Experimental
ctest --test-dir build --output-on-failure -E AMReX \
-D ExperimentalTest -D ExperimentalSubmit
else
# run tests (exclude pytest.AMReX when running Python tests)
ctest --test-dir build --output-on-failure -E AMReX
fi
displayName: 'Test'
- bash: |
# set options
set -o nounset errexit pipefail
# find and print backtrace
find build/bin/ -type f -name "Backtrace*" \
-exec echo -e "\nBacktrace\n---------\n{}\n---------" \; \
-exec cat {} \;
displayName: 'Logs'
condition: always()
- bash: |
# clean out so the Post-job Cache "tar" command has more disk space available
rm -rf build
displayName: 'Clean Build Directory'
condition: always()