Skip to content

Commit c6cd7b5

Browse files
committed
Merge branch 'development' into python_use_valid_for_fields_getitem
2 parents 1f50cb4 + 36b5544 commit c6cd7b5

File tree

1,748 files changed

+75045
-50017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,748 files changed

+75045
-50017
lines changed

.azure-pipelines.yml

Lines changed: 81 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,40 @@ pr:
99

1010
jobs:
1111
- job:
12+
# FIXME remove unused variables
1213
variables:
1314
BLASPP_HOME: '/usr/local'
1415
CEI_SUDO: 'sudo'
1516
CEI_TMP: '/tmp/cei'
1617
CMAKE_GENERATOR: 'Ninja'
1718
FFTW_HOME: '/usr'
1819
LAPACKPP_HOME: '/usr/local'
19-
OMP_NUM_THREADS: 1
2020
WARPX_CI_CCACHE: 'TRUE'
21-
WARPX_CI_NUM_MAKE_JOBS: 2
22-
WARPX_CI_OPENPMD: 'TRUE'
23-
WARPX_CI_TMP: '/tmp/ci'
21+
#WARPX_OPENPMD: 'TRUE'
2422

2523
strategy:
2624
matrix:
27-
cartesian1d:
28-
WARPX_CI_REGULAR_CARTESIAN_1D: 'TRUE'
29-
WARPX_CI_PSATD: 'FALSE'
30-
cartesian2d:
31-
WARPX_CI_REGULAR_CARTESIAN_2D: 'TRUE'
32-
cartesian3d:
33-
WARPX_CI_REGULAR_CARTESIAN_3D: 'TRUE'
34-
single_precision:
35-
WARPX_CI_SINGLE_PRECISION: 'TRUE'
36-
rz_or_nompi:
37-
WARPX_CI_RZ_OR_NOMPI: 'TRUE'
38-
qed:
39-
WARPX_CI_QED: 'TRUE'
40-
embedded_boundary:
41-
WARPX_CI_EB: 'TRUE'
25+
# Cartesian 1D
26+
cartesian_1d:
27+
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=1 -DWarpX_FFT=ON -DWarpX_PYTHON=ON
28+
# Cartesian 2D
29+
cartesian_2d:
30+
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=2 -DWarpX_FFT=ON -DWarpX_PYTHON=ON
31+
# Cartesian 3D
32+
cartesian_3d:
33+
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=3 -DWarpX_FFT=ON -DWarpX_PYTHON=ON
34+
WARPX_HEFFTE: 'TRUE'
35+
# Cylindrical RZ
36+
cylindrical_rz:
37+
WARPX_CMAKE_FLAGS: -DWarpX_DIMS=RZ -DWarpX_FFT=ON -DWarpX_PYTHON=ON
38+
WARPX_RZ_FFT: 'TRUE'
39+
# single precision
40+
#single_precision:
41+
# WARPX_CMAKE_FLAGS: -DWarpX_DIMS='1;2;3;RZ' -DWarpX_FFT=ON -DWarpX_PYTHON=ON -DWarpX_PRECISION=SINGLE
42+
# WARPX_RZ_FFT: 'TRUE'
4243

4344
# default: 60; maximum: 360
44-
timeoutInMinutes: 180
45+
timeoutInMinutes: 240
4546

4647
steps:
4748
# set up caches:
@@ -50,9 +51,8 @@ jobs:
5051
- task: Cache@2
5152
continueOnError: true
5253
inputs:
53-
key: 'Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake | run_test.sh'
54+
key: 'Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake'
5455
restoreKeys: |
55-
Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake | run_test.sh
5656
Ccache | "$(System.JobName)" | .azure-pipelines.yml | cmake/dependencies/AMReX.cmake
5757
Ccache | "$(System.JobName)" | .azure-pipelines.yml
5858
path: /home/vsts/.ccache
@@ -62,9 +62,8 @@ jobs:
6262
- task: Cache@2
6363
continueOnError: true
6464
inputs:
65-
key: 'Python3 | "$(System.JobName)" | .azure-pipelines.yml | run_test.sh'
65+
key: 'Python3 | "$(System.JobName)" | .azure-pipelines.yml'
6666
restoreKeys: |
67-
Python3 | "$(System.JobName)" | .azure-pipelines.yml | run_test.sh
6867
Python3 | "$(System.JobName)" | .azure-pipelines.yml
6968
path: /home/vsts/.local/lib/python3.8
7069
cacheHitVar: PYTHON38_CACHE_RESTORED
@@ -82,6 +81,8 @@ jobs:
8281
python3 python3-pandas python3-pip python3-venv python3-setuptools libblas-dev liblapack-dev
8382
ccache --set-config=max_size=10.0G
8483
python3 -m pip install --upgrade pip
84+
python3 -m pip install --upgrade build
85+
python3 -m pip install --upgrade packaging
8586
python3 -m pip install --upgrade setuptools
8687
python3 -m pip install --upgrade wheel
8788
python3 -m pip install --upgrade virtualenv
@@ -91,32 +92,72 @@ jobs:
9192
export PATH="$HOME/.local/bin:$PATH"
9293
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall
9394
sudo chmod a+x /usr/local/bin/cmake-easyinstall
94-
if [ "${WARPX_CI_OPENPMD:-FALSE}" == "TRUE" ]; then
95-
cmake-easyinstall --prefix=/usr/local \
96-
git+https://github.com/openPMD/openPMD-api.git@0.14.3 \
97-
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
98-
-DCMAKE_VERBOSE_MAKEFILE=ON \
99-
-DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
100-
python3 -m pip install --upgrade openpmd-api
101-
fi
102-
if [[ "${WARPX_CI_RZ_OR_NOMPI:-FALSE}" == "TRUE" ]]; then
103-
cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/blaspp.git \
95+
#if [ "${WARPX_OPENPMD:-FALSE}" == "TRUE" ]; then
96+
# cmake-easyinstall --prefix=/usr/local \
97+
# git+https://github.com/openPMD/openPMD-api.git@0.14.3 \
98+
# -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
99+
# -DCMAKE_VERBOSE_MAKEFILE=ON \
100+
# -DopenPMD_USE_PYTHON=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DBUILD_CLI_TOOLS=OFF
101+
# #python3 -m pip install --upgrade openpmd-api
102+
#fi
103+
if [ "${WARPX_RZ_FFT:-FALSE}" == "TRUE" ]; then
104+
# BLAS++
105+
cmake-easyinstall --prefix=/usr/local \
106+
git+https://github.com/icl-utk-edu/blaspp.git \
104107
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
105108
-DCMAKE_CXX_STANDARD=17 \
106109
-Duse_openmp=OFF -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
107-
cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/lapackpp.git \
108-
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
109-
-DCMAKE_CXX_STANDARD=17 \
110+
# LAPACK++
111+
cmake-easyinstall --prefix=/usr/local \
112+
git+https://github.com/icl-utk-edu/lapackpp.git \
113+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
114+
-DCMAKE_CXX_STANDARD=17 \
110115
-Duse_cmake_find_lapack=ON -Dbuild_tests=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
111116
fi
117+
if [ "${WARPX_HEFFTE:-FALSE}" == "TRUE" ]; then
118+
cmake-easyinstall --prefix=/usr/local git+https://github.com/icl-utk-edu/heffte.git@v2.4.0 \
119+
-DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache) \
120+
-DCMAKE_CXX_STANDARD=17 -DHeffte_ENABLE_DOXYGEN=OFF \
121+
-DHeffte_ENABLE_FFTW=ON -DHeffte_ENABLE_TESTING=OFF \
122+
-DHeffte_ENABLE_CUDA=OFF -DHeffte_ENABLE_ROCM=OFF \
123+
-DHeffte_ENABLE_ONEAPI=OFF -DHeffte_ENABLE_MKL=OFF \
124+
-DHeffte_ENABLE_PYTHON=OFF -DHeffte_ENABLE_FORTRAN=OFF \
125+
-DHeffte_ENABLE_MAGMA=OFF \
126+
-DCMAKE_VERBOSE_MAKEFILE=ON
127+
fi
128+
# Python modules required for test analysis
129+
python3 -m pip install --upgrade -r Regression/requirements.txt
130+
python3 -m pip cache purge
131+
# external repositories required for test analysis
132+
cd ..
133+
git clone --depth 1 https://github.com/ECP-WarpX/warpx-data.git
134+
# TODO select only specific datasets?
135+
git clone --depth 1 https://github.com/openPMD/openPMD-example-datasets.git
136+
cd -
112137
rm -rf ${CEI_TMP}
113138
df -h
114139
displayName: 'Install dependencies'
115140
116141
- bash: |
117142
set -eu -o pipefail
118143
df -h
119-
./run_test.sh
120-
rm -rf ${WARPX_CI_TMP}
144+
145+
# configure
146+
export AMReX_CMAKE_FLAGS="-DAMReX_ASSERTIONS=ON -DAMReX_TESTING=ON"
147+
cmake -S . -B build \
148+
${AMReX_CMAKE_FLAGS} \
149+
${WARPX_CMAKE_FLAGS} \
150+
-DWarpX_TEST_CLEANUP=ON \
151+
-DWarpX_TEST_FPETRAP=ON
152+
153+
# build
154+
cmake --build build -j 2
121155
df -h
122-
displayName: 'Build & test'
156+
displayName: 'Build'
157+
158+
- bash: |
159+
set -eu -o pipefail
160+
161+
# run tests (exclude pytest.AMReX when running Python tests)
162+
ctest --test-dir build --output-on-failure -E AMReX
163+
displayName: 'Test'

.clang-tidy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ Checks: '
77
-bugprone-unchecked-optional-access,
88
cert-*,
99
-cert-err58-cpp,
10+
clang-analyzer-*,
11+
-clang-analyzer-optin.performance.Padding,
12+
-clang-analyzer-optin.mpi.MPI-Checker,
13+
-clang-analyzer-osx.*,
14+
-clang-analyzer-optin.osx.*,
1015
clang-diagnostic-*,
1116
cppcoreguidelines-*,
1217
-cppcoreguidelines-avoid-c-arrays,
@@ -30,8 +35,6 @@ Checks: '
3035
-modernize-use-trailing-return-type,
3136
mpi-*,
3237
performance-*,
33-
-performance-unnecessary-copy-initialization,
34-
-performance-unnecessary-value-param,
3538
portability-*,
3639
readability-*,
3740
-readability-convert-member-functions-to-static,
@@ -41,7 +44,6 @@ Checks: '
4144
-readability-implicit-bool-conversion,
4245
-readability-isolate-declaration,
4346
-readability-magic-numbers,
44-
-readability-make-member-function-const,
4547
-readability-named-parameter,
4648
-readability-uppercase-literal-suffix
4749
'
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: 🧴 clang sanitizers
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.ref }}-${{ github.head_ref }}-clangsanitizers
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build_UB_sanitizer:
11+
name: Clang UB sanitizer
12+
runs-on: ubuntu-22.04
13+
container: ubuntu:23.10
14+
if: github.event.pull_request.draft == false
15+
env:
16+
CC: clang
17+
CXX: clang++
18+
# On CI for this test, Ninja is slower than the default:
19+
#CMAKE_GENERATOR: Ninja
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: install dependencies
23+
run: |
24+
.github/workflows/dependencies/clang17.sh
25+
- name: CCache Cache
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.cache/ccache
29+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
30+
restore-keys: |
31+
ccache-${{ github.workflow }}-${{ github.job }}-git-
32+
- name: build WarpX
33+
run: |
34+
export CCACHE_COMPRESS=1
35+
export CCACHE_COMPRESSLEVEL=10
36+
export CCACHE_MAXSIZE=100M
37+
ccache -z
38+
39+
export CXX=$(which clang++-17)
40+
export CC=$(which clang-17)
41+
export CXXFLAGS="-fsanitize=undefined,address,pointer-compare -fno-sanitize-recover=all"
42+
43+
cmake -S . -B build \
44+
-GNinja \
45+
-DCMAKE_VERBOSE_MAKEFILE=ON \
46+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
47+
-DWarpX_DIMS="RZ;1;2;3" \
48+
-DWarpX_FFT=ON \
49+
-DWarpX_QED=ON \
50+
-DWarpX_QED_TABLE_GEN=ON \
51+
-DWarpX_OPENPMD=ON \
52+
-DWarpX_PRECISION=SINGLE \
53+
-DWarpX_PARTICLE_PRECISION=SINGLE
54+
cmake --build build -j 4
55+
56+
ccache -s
57+
du -hs ~/.cache/ccache
58+
59+
- name: run with UB sanitizer
60+
run: |
61+
62+
# We need these two lines because these tests run inside a docker container
63+
export OMPI_ALLOW_RUN_AS_ROOT=1
64+
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
65+
66+
export OMP_NUM_THREADS=2
67+
68+
#MPI implementations often leak memory
69+
export "ASAN_OPTIONS=detect_leaks=0"
70+
71+
mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz
72+
mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration
73+
mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d
74+
mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d
75+
76+
build_thread_sanitizer:
77+
name: Clang thread sanitizer
78+
runs-on: ubuntu-22.04
79+
container: ubuntu:23.10
80+
if: github.event.pull_request.draft == false
81+
env:
82+
CC: clang
83+
CXX: clang++
84+
# On CI for this test, Ninja is slower than the default:
85+
#CMAKE_GENERATOR: Ninja
86+
steps:
87+
- uses: actions/checkout@v4
88+
- name: install dependencies
89+
run: |
90+
.github/workflows/dependencies/clang17.sh
91+
- name: CCache Cache
92+
uses: actions/cache@v4
93+
with:
94+
path: ~/.cache/ccache
95+
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
96+
restore-keys: |
97+
ccache-${{ github.workflow }}-${{ github.job }}-git-
98+
- name: build WarpX
99+
run: |
100+
export CCACHE_COMPRESS=1
101+
export CCACHE_COMPRESSLEVEL=10
102+
export CCACHE_MAXSIZE=100M
103+
ccache -z
104+
105+
export CXX=$(which clang++-17)
106+
export CC=$(which clang-17)
107+
export CXXFLAGS="-fsanitize=thread"
108+
109+
cmake -S . -B build \
110+
-GNinja \
111+
-DCMAKE_VERBOSE_MAKEFILE=ON \
112+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
113+
-DWarpX_DIMS="RZ;1;2;3" \
114+
-DWarpX_FFT=ON \
115+
-DWarpX_QED=ON \
116+
-DWarpX_QED_TABLE_GEN=ON \
117+
-DWarpX_OPENPMD=ON \
118+
-DWarpX_EB=OFF \
119+
-DWarpX_PRECISION=DOUBLE \
120+
-DWarpX_PARTICLE_PRECISION=DOUBLE
121+
cmake --build build -j 4
122+
123+
cmake -S . -B build_EB \
124+
-GNinja \
125+
-DCMAKE_VERBOSE_MAKEFILE=ON \
126+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
127+
-DWarpX_DIMS="2" \
128+
-DWarpX_FFT=ON \
129+
-DWarpX_QED=ON \
130+
-DWarpX_QED_TABLE_GEN=ON \
131+
-DWarpX_OPENPMD=ON \
132+
-DWarpX_EB=ON \
133+
-DWarpX_PRECISION=DOUBLE \
134+
-DWarpX_PARTICLE_PRECISION=DOUBLE
135+
cmake --build build_EB -j 4
136+
137+
ccache -s
138+
du -hs ~/.cache/ccache
139+
140+
- name: run with thread sanitizer
141+
run: |
142+
export PMIX_MCA_gds=hash
143+
export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
144+
export ARCHER_OPTIONS="verbose=1"
145+
146+
# We need these two lines because these tests run inside a docker container
147+
export OMPI_ALLOW_RUN_AS_ROOT=1
148+
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
149+
150+
export OMP_NUM_THREADS=2
151+
152+
mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0
153+
mpirun -n 2 ./build/bin/warpx.1d Examples/Physics_applications/laser_acceleration/inputs_test_1d_laser_acceleration warpx.serialize_initial_conditions = 0
154+
mpirun -n 2 ./build/bin/warpx.2d Examples/Physics_applications/laser_acceleration/inputs_base_2d warpx.serialize_initial_conditions = 0
155+
mpirun -n 2 ./build/bin/warpx.3d Examples/Physics_applications/laser_acceleration/inputs_base_3d warpx.serialize_initial_conditions = 0
156+
157+
git clone https://github.com/ECP-WarpX/warpx-data ../warpx-data
158+
cd Examples/Tests/embedded_circle
159+
160+
ulimit -c unlimited
161+
162+
mpirun -n 2 ../../../build_EB/bin/warpx.2d inputs_test_2d_embedded_circle warpx.serialize_initial_conditions = 0

0 commit comments

Comments
 (0)