From bb16bc37f3baa8d7efe7158587689777b120d861 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 10:27:25 +0200 Subject: [PATCH 1/9] use ubuntu_24_04 for runners --- .github/workflows/clang_sanitizers.yml | 6 ++---- .github/workflows/clang_tidy.yml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 48d8068c80c..5e6d881a55f 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -13,8 +13,7 @@ concurrency: jobs: build_UB_sanitizer: name: Clang UB sanitizer - runs-on: ubuntu-22.04 - container: ubuntu:23.10 + runs-on: ubuntu-24.04 if: github.event.pull_request.draft == false env: CC: clang @@ -79,8 +78,7 @@ jobs: build_thread_sanitizer: name: Clang thread sanitizer - runs-on: ubuntu-22.04 - container: ubuntu:23.10 + runs-on: ubuntu-24.04 if: github.event.pull_request.draft == false env: CC: clang diff --git a/.github/workflows/clang_tidy.yml b/.github/workflows/clang_tidy.yml index 9088e3af134..ed99abcff9a 100644 --- a/.github/workflows/clang_tidy.yml +++ b/.github/workflows/clang_tidy.yml @@ -16,7 +16,7 @@ jobs: matrix: dim: [1, 2, RZ, 3] name: clang-tidy-${{ matrix.dim }}D - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 180 if: github.event.pull_request.draft == false steps: From a3b11b5401ea5eb1a141ef40e3189761c1cea041 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 10:29:00 +0200 Subject: [PATCH 2/9] remove lines that were necessary only because we were running in a container --- .github/workflows/clang_sanitizers.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 5e6d881a55f..e39a41353bc 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -62,10 +62,6 @@ jobs: - name: run with UB sanitizer run: | - # We need these two lines because these tests run inside a docker container - export OMPI_ALLOW_RUN_AS_ROOT=1 - export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - export OMP_NUM_THREADS=2 #MPI implementations often leak memory @@ -145,10 +141,6 @@ jobs: export TSAN_OPTIONS='ignore_noninstrumented_modules=1' export ARCHER_OPTIONS="verbose=1" - # We need these two lines because these tests run inside a docker container - export OMPI_ALLOW_RUN_AS_ROOT=1 - export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 - export OMP_NUM_THREADS=2 mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0 From e4926f86b6a2a896b3716f5eafb389e17df06569 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 11:16:57 +0200 Subject: [PATCH 3/9] remove lines only required to run in a container --- .github/workflows/dependencies/clang17.sh | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/dependencies/clang17.sh b/.github/workflows/dependencies/clang17.sh index d208a9f3f3b..fb04e2a5914 100755 --- a/.github/workflows/dependencies/clang17.sh +++ b/.github/workflows/dependencies/clang17.sh @@ -7,11 +7,6 @@ set -eu -o pipefail -# This dependency file is currently used within a docker container, -# which does not come with sudo. -apt-get -qqq update -apt-get -y install sudo - # `man apt.conf`: # Number of retries to perform. If this is non-zero APT will retry # failed files the given number of times. From f436f571615f86120e092119ff90da459d572a1d Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 12:34:30 +0200 Subject: [PATCH 4/9] bumpt to clang-19 for sanitizer tests --- .github/workflows/clang_sanitizers.yml | 12 ++++++------ .../dependencies/{clang17.sh => clang19.sh} | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) rename .github/workflows/dependencies/{clang17.sh => clang19.sh} (91%) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index e39a41353bc..d7832ab05c1 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - name: install dependencies run: | - .github/workflows/dependencies/clang17.sh + .github/workflows/dependencies/clang19.sh - name: CCache Cache uses: actions/cache@v4 with: @@ -39,8 +39,8 @@ jobs: export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-17) - export CC=$(which clang-17) + export CXX=$(which clang++-19) + export CC=$(which clang-19) export CXXFLAGS="-fsanitize=undefined,address,pointer-compare -fno-sanitize-recover=all" cmake -S . -B build \ @@ -85,7 +85,7 @@ jobs: - uses: actions/checkout@v4 - name: install dependencies run: | - .github/workflows/dependencies/clang17.sh + .github/workflows/dependencies/clang19.sh - name: CCache Cache uses: actions/cache@v4 with: @@ -100,8 +100,8 @@ jobs: export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-17) - export CC=$(which clang-17) + export CXX=$(which clang++-19) + export CC=$(which clang-19) export CXXFLAGS="-fsanitize=thread" cmake -S . -B build \ diff --git a/.github/workflows/dependencies/clang17.sh b/.github/workflows/dependencies/clang19.sh similarity index 91% rename from .github/workflows/dependencies/clang17.sh rename to .github/workflows/dependencies/clang19.sh index fb04e2a5914..6606cf68bd8 100755 --- a/.github/workflows/dependencies/clang17.sh +++ b/.github/workflows/dependencies/clang19.sh @@ -18,17 +18,17 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries sudo apt-get -qqq update sudo apt-get install -y \ cmake \ - clang-17 \ - clang-tidy-17 \ + clang-19 \ + clang-tidy-19 \ libblas-dev \ - libc++-17-dev \ + libc++-19-dev \ libboost-math-dev \ libfftw3-dev \ libfftw3-mpi-dev \ libhdf5-openmpi-dev \ liblapack-dev \ libopenmpi-dev \ - libomp-17-dev \ + libomp-19-dev \ ninja-build \ wget \ xz-utils \ @@ -37,9 +37,9 @@ sudo apt-get install -y \ ccache \ pkg-config -# Use clang 17 -export CXX=$(which clang++-17) -export CC=$(which clang-17) +# Use clang 19 +export CXX=$(which clang++-19) +export CC=$(which clang-19) # cmake-easyinstall # From 40aa86980fe612a3cb587bc29c83bc6cb2ad890e Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 12:37:32 +0200 Subject: [PATCH 5/9] use clang-18 --- .github/workflows/clang_sanitizers.yml | 12 ++++++------ .../dependencies/{clang19.sh => clang18.sh} | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) rename .github/workflows/dependencies/{clang19.sh => clang18.sh} (91%) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index d7832ab05c1..61bbb6012f0 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - name: install dependencies run: | - .github/workflows/dependencies/clang19.sh + .github/workflows/dependencies/clang18.sh - name: CCache Cache uses: actions/cache@v4 with: @@ -39,8 +39,8 @@ jobs: export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-19) - export CC=$(which clang-19) + export CXX=$(which clang++-18) + export CC=$(which clang-18) export CXXFLAGS="-fsanitize=undefined,address,pointer-compare -fno-sanitize-recover=all" cmake -S . -B build \ @@ -85,7 +85,7 @@ jobs: - uses: actions/checkout@v4 - name: install dependencies run: | - .github/workflows/dependencies/clang19.sh + .github/workflows/dependencies/clang18.sh - name: CCache Cache uses: actions/cache@v4 with: @@ -100,8 +100,8 @@ jobs: export CCACHE_MAXSIZE=100M ccache -z - export CXX=$(which clang++-19) - export CC=$(which clang-19) + export CXX=$(which clang++-18) + export CC=$(which clang-18) export CXXFLAGS="-fsanitize=thread" cmake -S . -B build \ diff --git a/.github/workflows/dependencies/clang19.sh b/.github/workflows/dependencies/clang18.sh similarity index 91% rename from .github/workflows/dependencies/clang19.sh rename to .github/workflows/dependencies/clang18.sh index 6606cf68bd8..0cc186ab000 100755 --- a/.github/workflows/dependencies/clang19.sh +++ b/.github/workflows/dependencies/clang18.sh @@ -18,17 +18,17 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries sudo apt-get -qqq update sudo apt-get install -y \ cmake \ - clang-19 \ - clang-tidy-19 \ + clang-18 \ + clang-tidy-18 \ libblas-dev \ - libc++-19-dev \ + libc++-18-dev \ libboost-math-dev \ libfftw3-dev \ libfftw3-mpi-dev \ libhdf5-openmpi-dev \ liblapack-dev \ libopenmpi-dev \ - libomp-19-dev \ + libomp-18-dev \ ninja-build \ wget \ xz-utils \ @@ -37,9 +37,9 @@ sudo apt-get install -y \ ccache \ pkg-config -# Use clang 19 -export CXX=$(which clang++-19) -export CC=$(which clang-19) +# Use clang 18 +export CXX=$(which clang++-18) +export CC=$(which clang-18) # cmake-easyinstall # From 584ccc7f9c358c26475c917a38cf7b8b6d278ec1 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 2 Oct 2024 16:12:13 +0200 Subject: [PATCH 6/9] try to fix possible linker issue --- .github/workflows/clang_sanitizers.yml | 48 ++++++++++++++------------ 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 61bbb6012f0..b4de22eaaba 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -104,31 +104,35 @@ jobs: export CC=$(which clang-18) export CXXFLAGS="-fsanitize=thread" - cmake -S . -B build \ - -GNinja \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DWarpX_DIMS="RZ;1;2;3" \ - -DWarpX_FFT=ON \ - -DWarpX_QED=ON \ - -DWarpX_QED_TABLE_GEN=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_EB=OFF \ - -DWarpX_PRECISION=DOUBLE \ + cmake -S . -B build \ + -GNinja \ + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ + -CMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWarpX_DIMS="RZ;1;2;3" \ + -DWarpX_FFT=ON \ + -DWarpX_QED=ON \ + -DWarpX_QED_TABLE_GEN=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_EB=OFF \ + -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build -j 4 - cmake -S . -B build_EB \ - -GNinja \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DWarpX_DIMS="2" \ - -DWarpX_FFT=ON \ - -DWarpX_QED=ON \ - -DWarpX_QED_TABLE_GEN=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_EB=ON \ - -DWarpX_PRECISION=DOUBLE \ + cmake -S . -B build_EB \ + -GNinja \ + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ + -CMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWarpX_DIMS="2" \ + -DWarpX_FFT=ON \ + -DWarpX_QED=ON \ + -DWarpX_QED_TABLE_GEN=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_EB=ON \ + -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build_EB -j 4 From 6b8be50ee84d86151dd30b4296bb973a1cee8c09 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 3 Oct 2024 15:51:16 +0200 Subject: [PATCH 7/9] fixed bug --- .github/workflows/clang_sanitizers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index e159467f4cf..874c50f4f15 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -107,7 +107,7 @@ jobs: cmake -S . -B build \ -GNinja \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ - -CMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWarpX_DIMS="RZ;1;2;3" \ @@ -123,7 +123,7 @@ jobs: cmake -S . -B build_EB \ -GNinja \ -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ - -CMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ + -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DWarpX_DIMS="2" \ From 5ea9675ac956b58cb5387e850e804bf4eb7d9280 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 3 Oct 2024 15:51:52 +0200 Subject: [PATCH 8/9] fix formatting --- .github/workflows/clang_sanitizers.yml | 48 +++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/clang_sanitizers.yml b/.github/workflows/clang_sanitizers.yml index 874c50f4f15..59d601e0de2 100644 --- a/.github/workflows/clang_sanitizers.yml +++ b/.github/workflows/clang_sanitizers.yml @@ -104,35 +104,35 @@ jobs: export CC=$(which clang-18) export CXXFLAGS="-fsanitize=thread" - cmake -S . -B build \ - -GNinja \ - -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ + cmake -S . -B build \ + -GNinja \ + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DWarpX_DIMS="RZ;1;2;3" \ - -DWarpX_FFT=ON \ - -DWarpX_QED=ON \ - -DWarpX_QED_TABLE_GEN=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_EB=OFF \ - -DWarpX_PRECISION=DOUBLE \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWarpX_DIMS="RZ;1;2;3" \ + -DWarpX_FFT=ON \ + -DWarpX_QED=ON \ + -DWarpX_QED_TABLE_GEN=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_EB=OFF \ + -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build -j 4 - cmake -S . -B build_EB \ - -GNinja \ - -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ + cmake -S . -B build_EB \ + -GNinja \ + -DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \ -DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DWarpX_DIMS="2" \ - -DWarpX_FFT=ON \ - -DWarpX_QED=ON \ - -DWarpX_QED_TABLE_GEN=ON \ - -DWarpX_OPENPMD=ON \ - -DWarpX_EB=ON \ - -DWarpX_PRECISION=DOUBLE \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DWarpX_DIMS="2" \ + -DWarpX_FFT=ON \ + -DWarpX_QED=ON \ + -DWarpX_QED_TABLE_GEN=ON \ + -DWarpX_OPENPMD=ON \ + -DWarpX_EB=ON \ + -DWarpX_PRECISION=DOUBLE \ -DWarpX_PARTICLE_PRECISION=DOUBLE cmake --build build_EB -j 4 From 44690382c8ec2a145f2bb9fb8fffe7a119c5a72a Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Thu, 3 Oct 2024 17:02:11 +0200 Subject: [PATCH 9/9] add tsan2 to the list of dependencies --- .github/workflows/dependencies/clang18.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dependencies/clang18.sh b/.github/workflows/dependencies/clang18.sh index 0cc186ab000..f503684299b 100755 --- a/.github/workflows/dependencies/clang18.sh +++ b/.github/workflows/dependencies/clang18.sh @@ -29,6 +29,7 @@ sudo apt-get install -y \ liblapack-dev \ libopenmpi-dev \ libomp-18-dev \ + libtsan2 \ ninja-build \ wget \ xz-utils \