|
TRIQS/mpi 2.0.0
C++ interface to MPI
|
LLVM sanitizers (ASan / UBSan / TSan / MSan) are incompatible with Open MPI 5+'s default UCX transport. mpi detects this combination and automatically works around it.
With a sanitizer-enabled build linked against Open MPI 5+, every MPI process crashes early in MPI_Init with a SEGV inside libucs.so (ucs_handle_error / ucs_debug_print_backtrace near the top of the stack). The same code on Open MPI 4.x runs cleanly.
Open MPI 5+ uses the pml/ucx layer by default. UCX's libucm installs malloc/mmap relocation hooks to track RDMA buffers; LLVM sanitizers install their own interceptors on the same symbols. The double-patched malloc table desynchronizes ASan's shadow map, and the next allocation routed through the wrong path lands on an unmapped page.
This is a known upstream issue with no fix at the time of writing:
When c++/mpi/CMakeLists.txt sees Open MPI 5+ and any of ASAN/UBSAN/MSAN/TSAN set in the cache, it appends
to the MPIEXEC_PREFLAGS cache variable. These flags route Open MPI through the ob1 PML and shared-memory BTLs, so libucm is never loaded. Because every TRIQS-ecosystem add_test already threads ${MPIEXEC_PREFLAGS} to mpiexec, the workaround reaches mpi, nda, triqs, and any downstream project with no per-project change.
Confirm it's active by looking for this configure-time line:
If you launch MPI by hand (raw mpiexec, Slurm scripts, CI without ctest), pass the same flags:
The detection is gated on MPI_CXX_LIBRARY_VERSION_STRING matching Open MPI v<N>, so Intel MPI, MPICH, and other implementations are unaffected.