Add ThreadSanitizer build type
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 18 Oct 2013 15:47:25 +0000 (17:47 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 26 Feb 2014 02:47:10 +0000 (03:47 +0100)
commitb94ae775ee72ffb48eaa2d920f524d6e639d404e
tree0372effc160335754d1dfb8e824c15361d1d7e5b
parent3f0c1bdefbfe11145f371c023989c3c4635b8efd
Add ThreadSanitizer build type

This might be useful for helping detect misuse of thread
operations.

It does run quite slowly, so use in an automatic per-patch Jenkins
build is probably not a good idea. In any case, it should be run
on a real workload, as well as toy examples.

As discussed in the CMake file that manages the new build type, using
TSan requires that CMake can demand that atomic operations are not
used. Accordingly, the atomic.h functionality and the CMake atomics
testing that uses it have some changes so all the ways atomic.h is
used work correctly. Documentation of how and why things work is
expanded.

A benign race condition with the (unused) return value of
mdrunner_start_threads is fixed.

Change-Id: I0da01c0bedeec2e49d4456d757c54fbe58c56ef4
CMakeLists.txt
cmake/ThreadMPI.cmake
cmake/gmxBuildTypeThreadSanitizer.cmake [new file with mode: 0644]
src/gromacs/legacyheaders/thread_mpi/atomic.h
src/programs/mdrun/runner.c