Skip to content

Commit 00f4cd2

Browse files
committed
Enable ASAN for mpi4py in CI
Run mpi4py with ASAN, with a separate step that aborts on errors. The existing steps should run to completion even if an error is detected. Signed-off-by: Joseph Schuchart <joseph.schuchart@stonybrook.edu>
1 parent 3e00498 commit 00f4cd2

1 file changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/ompi_mpi4py.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ on:
1818
permissions:
1919
contents: read
2020

21+
env:
22+
# ASAN needs to come first
23+
LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libasan.so
24+
# disable ODR violation detection until #13469 is fixed
25+
# and don't abort on error by default
26+
ASAN_OPTIONS: detect_odr_violation=0,abort_on_error=0
27+
# enable leak detection but do not fail on leaks
28+
LSAN_OPTIONS: detect_leaks=1,exitcode=0
29+
2130
jobs:
2231
test:
2332
runs-on: ubuntu-22.04
@@ -59,7 +68,8 @@ jobs:
5968
--disable-oshmem
6069
--disable-silent-rules
6170
--prefix=/opt/openmpi
62-
LDFLAGS=-Wl,-rpath,/opt/openmpi/lib
71+
CFLAGS="-g -O0 -fsanitize=address"
72+
LDFLAGS="-Wl,-rpath,/opt/openmpi/lib -fsanitize=address"
6373
working-directory: mpi-build
6474

6575
- name: Build MPI
@@ -158,3 +168,18 @@ jobs:
158168
if: ${{ true }}
159169
timeout-minutes: 10
160170

171+
- name: Test mpi4py (np=1)
172+
env:
173+
# run again and abort if ASAN detects an error
174+
ASAN_OPTIONS: detect_odr_violation=0,abort_on_error=1
175+
run: mpiexec -n 1 python test/main.py -v -x TestExcErrhandlerNull
176+
if: ${{ true }}
177+
timeout-minutes: 10
178+
179+
- name: Test mpi4py (np=4)
180+
env:
181+
# run again and abort if ASAN detects an error
182+
ASAN_OPTIONS: detect_odr_violation=0,abort_on_error=1
183+
run: mpiexec -n 4 python test/main.py -v -f -x TestExcErrhandlerNull
184+
if: ${{ true }}
185+
timeout-minutes: 10

0 commit comments

Comments
 (0)