-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add thread sanitizer test in CI #4799
Merged
ax3l
merged 76 commits into
ECP-WarpX:development
from
lucafedeli88:add_thread_sanitizer
Aug 10, 2024
Merged
Add thread sanitizer test in CI #4799
ax3l
merged 76 commits into
ECP-WarpX:development
from
lucafedeli88:add_thread_sanitizer
Aug 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lucafedeli88
added
component: tests
Tests and CI
cleaning
Clean code, improve readability
labels
Mar 22, 2024
lucafedeli88
changed the title
[WIP] Add thread sanitizer
[WIP] Add thread sanitizer in CI
Mar 22, 2024
lucafedeli88
changed the title
[WIP] Add thread sanitizer in CI
[WIP] Add thread sanitizer test in CI
Mar 22, 2024
RemiLehe
reviewed
Jul 9, 2024
RemiLehe
reviewed
Jul 9, 2024
RemiLehe
reviewed
Jul 9, 2024
RemiLehe
reviewed
Jul 9, 2024
RemiLehe
reviewed
Jul 10, 2024
ax3l
approved these changes
Aug 10, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you! :)
We can run this over more of the fast tests once CTest is merged #5068
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug: affects latest release
Bug also exists in latest release version
bug
Something isn't working
cleaning
Clean code, improve readability
component: tests
Tests and CI
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a thread sanitizer test in CI.
Specifically:
clang_sanitizers.yml
workflow file is createdubuntu.yml
toclang_sanitizers.yml
workflowclang-17
. Therefore, for this test, we use aUbuntu 23.10
container and we installclang-17
with the instructions added to a new dependencies file (clang17.sh
).laser_acceleration
example in 1D,2D,3D, and RZ, as well as theembedded_circle
example in 2D. In all cases the serialization of initial conditions is deactivated, although it does not seem to affect the thread sanitizer. Note that WarpX is compiled in double precision, since theembedded_circle
example is not tested in single precision and seems to be numerically unstable unless double precision is used. Note also that WarpX is compiled without EB support for the 4laser_acceleration
tests because there seems to be bugs when WarpX with EB support is used to runlaser_acceleration
in 2D (this is currently under investigation).ParticleBoundaryBuffer.cpp
address
andpointer-compare
sanitizer checks have been added to UB sanitizer test.current_correction
is set totrue
(the default behavior) to fix an issue found by the UB sanitizer.The thread sanitizer test uses
libarcher
, which should theoretically avoid false positives withOpenMP
(see https://github.com/llvm/llvm-project/tree/main/openmp/tools/archer)Some additional comments:
export PMIX_MCA_gds=hash
I am not sure why this setting is required to be honest (I am still trying to understand). However, if I run without this setting I get an error message like:The gds/shmem component attempted to attach to a shared-memory segment at a particular base address, but was given a different one
, followed by a suggestion to disable thegds/shmem
component. It seems to be a relatively common issue.export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
should avoid false positives with libraries not compiled with the thread sanitizer. Archer documentation suggests using this setting.export ARCHER_OPTIONS="verbose=1"
makes WarpX print the message:Archer detected OpenMP application with TSan, supplying OpenMP synchronization semantics
, which confirms thatlibarcher
is in use.export OMPI_ALLOW_RUN_AS_ROOT=1
andexport OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
are needed because we are running the test in a docker container.export "ASAN_OPTIONS=detect_leaks=0"
is required to disable leak checks: MPI implementations leak memory