-
Notifications
You must be signed in to change notification settings - Fork 169
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
Open
lucafedeli88
wants to merge
46
commits into
ECP-WarpX:development
Choose a base branch
from
lucafedeli88:add_thread_sanitizer
base: development
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add thread sanitizer test in CI #4799
lucafedeli88
wants to merge
46
commits into
ECP-WarpX:development
from
lucafedeli88:add_thread_sanitizer
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
lucafedeli88
added
bug
Something isn't working
bug: affects latest release
Bug also exists in latest release version
labels
Apr 30, 2024
lucafedeli88
changed the title
[WIP] Add thread sanitizer test in CI
Add thread sanitizer test in CI
Apr 30, 2024
lucafedeli88
commented
Apr 30, 2024
Uh, is there a race condition using OpenMP threads in |
This could be related to: |
…into add_thread_sanitizer
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 (I suspect that there might be a race condition in the code relevant for this example due to the frequent random failures of this test in CI). In all cases the serialization of initial conditions is deactivated, although it does not seem to affect the thread sanitizer.the PR corrects also the race conditions found by the thread sanitizer tool, with minor changes in** Done in Fix two race conditions found with thread sanitizer #4932 **WarpX_PEC.cpp
andPhysicalParticleContainer.cpp
ParticleBoundaryBuffer.cpp
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.