- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got redirected here from the Intel® oneAPI Math Kernel Library forum.
Is thread sanitizer supposed to work with Intel OpenMP?
I get thousands of errors. Possibly genuine errors as our code is old and has just about never been tested for thread hazards. We're using GCC 5.3 and GCC 13.2. Using the Intel compilers isn't really an option at the moment (it's a fairly big project and we have to integrate with several other projects).
One of my coleagues and myself have been investigating. He's been trying to use LLVM OpenMP (which I believe Intel OpenMP is based on) and is starting to get things to work when LLVM OpenMP is built for thread sanitizer.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please provide a reproducer to demonstrate what you're trying to achieve?
Just based on your description and limited information--it might work, since GCC sanitizer is ported from LLVM, it should be similar to LLVM sanitizer in Intel compiler. If you give it a try and see any errors, you can give us more information on what the errors are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Our product is huge so I can't reproduce anything from that.
I can reproduce errors with one of the Valgrind DRD tests.
I know that this test should run cleanly.
If I compile it with
gcc -g -o test omp_matinv.c -fopenmp -fsanitize=thread -Wl,--as-needed -L/path/to/lib/Linux_x86_64 -liomp5 -pthread -lm -Wl,-rpath,/path/to/lib/Linux_x86_64
And run it with
./test -t 15 -q 30
That gives me 8 data races like
WARNING: ThreadSanitizer: data race (pid=441552)
Read of size 8 at 0x7da000004598 by main thread:
#0 gj /home/paulf/test/omp_matinv.c:188 (test+0x000000401a8d)
#1 invert_matrix /home/paulf/test/omp_matinv.c:238 (test+0x000000401d88)
#2 main /home/paulf/test/omp_matinv.c:327 (test+0x00000040217f)
Previous write of size 8 at 0x7da000004598 by thread T1:
#0 gj._omp_fn.1 /home/paulf/test/omp_matinv.c:220 (test+0x000000402716)
#1 __kmp_invoke_microtask <null> (libiomp5.so+0x0000000b0d12)
I get similar things with both GCC 5.3 and 13.2.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page