Skip to content

Commit f161db9

Browse files
authored
CI tests: re-enable clang thread sanitizer test (#5826)
This PR re-enables the thread sanitizer CI test. The issues that we experienced (#5492) were ultimately caused by the fact that thread sanitizer is not able to automatically load `libarcher` under some Linux distributions like Ubuntu, and `libarcher` is required to avoid false positives with OpenMP ! The fix is adding this line ( see https://hpc-wiki.info/hpc/ThreadSanitizer ): ``` export OMP_TOOL_LIBRARIES=/usr/lib/llvm-17/lib/libarcher.so ``` In addition to this change, the PR adds some comments. Moreover, WarpX is now compiled always with EB support, since this is now the default and since this (slightly) reduces the time required to run this CI test.
1 parent 4a0af0a commit f161db9

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/clang_sanitizers.yml

+17-19
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ jobs:
7979
build_thread_sanitizer:
8080
name: Clang thread sanitizer
8181
runs-on: ubuntu-24.04
82-
# TODO Fix data race conditions and re-enable job
83-
if: 0 #github.event.pull_request.draft == false
82+
if: github.event.pull_request.draft == false
8483
env:
8584
CC: clang
8685
CXX: clang++
@@ -118,34 +117,33 @@ jobs:
118117
-DWarpX_QED=ON \
119118
-DWarpX_QED_TABLE_GEN=ON \
120119
-DWarpX_OPENPMD=ON \
121-
-DWarpX_EB=OFF \
122120
-DWarpX_PRECISION=DOUBLE \
123121
-DWarpX_PARTICLE_PRECISION=DOUBLE
124122
cmake --build build -j 4
125123
126-
cmake -S . -B build_EB \
127-
-GNinja \
128-
-DCMAKE_VERBOSE_MAKEFILE=ON \
129-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
130-
-DWarpX_DIMS="2" \
131-
-DWarpX_FFT=ON \
132-
-DWarpX_QED=ON \
133-
-DWarpX_QED_TABLE_GEN=ON \
134-
-DWarpX_OPENPMD=ON \
135-
-DWarpX_EB=ON \
136-
-DWarpX_PRECISION=DOUBLE \
137-
-DWarpX_PARTICLE_PRECISION=DOUBLE
138-
cmake --build build_EB -j 4
139-
140124
ccache -s
141125
du -hs ~/.cache/ccache
142126
143127
- name: run with thread sanitizer
144128
run: |
129+
# Disabling the gds/shmem component by using gds/hash instead
130+
# is required to avoid issues with shared memory.
145131
export PMIX_MCA_gds=hash
146-
export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
132+
133+
# Archer is a data race detector for OpenMP programs.
134+
# It is required to avoid false positives with OpenMP and it is
135+
# included in llvm. However with many Linux it is necessary
136+
# to define this environment variable to make sure that the
137+
# Archer library is actually used.
138+
# When the Archer library is used and ARCHER_OPTIONS="verbose=1",
139+
# the following message should be displayed:
140+
# Archer detected OpenMP application with TSan, supplying OpenMP synchronization semantics
141+
export OMP_TOOL_LIBRARIES=/usr/lib/llvm-17/lib/libarcher.so
147142
export ARCHER_OPTIONS="verbose=1"
148143
144+
# This option is required to avoid false positive reports from the OpenMP runtime
145+
export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
146+
149147
export OMP_NUM_THREADS=2
150148
151149
mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0
@@ -158,4 +156,4 @@ jobs:
158156
159157
ulimit -c unlimited
160158
161-
mpirun -n 2 ../../../build_EB/bin/warpx.2d inputs_test_2d_embedded_circle warpx.serialize_initial_conditions = 0
159+
mpirun -n 2 ../../../build/bin/warpx.2d inputs_test_2d_embedded_circle warpx.serialize_initial_conditions = 0

0 commit comments

Comments
 (0)