Skip to content
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

Data races in OpenMP thread-parallel implementation #53

Open
buech opened this issue Aug 10, 2023 · 0 comments
Open

Data races in OpenMP thread-parallel implementation #53

buech opened this issue Aug 10, 2023 · 0 comments

Comments

@buech
Copy link

buech commented Aug 10, 2023

The liborpar example in ADOL-C/examples/additional_examples/openmp_exam often fails with an error message like:

ADOL-C error: forward sweep on tape 12  aborted!
Number of dependent(1) and/or independent(120) variables passed to forward is
inconsistent with number recorded on tape (1, 112)
terminate called after throwing an instance of 'FatalError'
  what():  errorcode=-1 function=zos_forward file=./uni5_for.c line=1112 what=
Aborted

Running the example through ThreadSanitizer hints at data races in ADOL-C/src/tape_handling.cpp.

The following is an excerpt from the full log file for quick reference:

==================
WARNING: ThreadSanitizer: data race (pid=2993043)
  Write of size 1 at 0x7f858c6ccaea by main thread:
    #0 beginParallel() ../../../../ADOL-C/src/tape_handling.cpp:1227 (libadolc.so.2+0x32323)
    #1 ADOLC_OpenMP::ADOLC_OpenMP(ADOLC_OpenMP const&) ../../../../ADOL-C/include/adolc/adolc_openmp.h:36 (liborpar+0x4
02b19)
    #2 main._omp_fn.0 ../../../../ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp:166 (liborpar+0x402b19)
    #3 GOMP_parallel ../../../libgomp/parallel.c:178 (libgomp.so.1+0x15295)
    #4 __libc_start_main ../csu/libc-start.c:308 (libc.so.6+0x24082)

  Previous read of size 1 at 0x7f858c6ccaea by thread T3:
    #0 beginParallel() ../../../../ADOL-C/src/tape_handling.cpp:1229 (libadolc.so.2+0x31969)
    #1 ADOLC_OpenMP::ADOLC_OpenMP(ADOLC_OpenMP const&) ../../../../ADOL-C/include/adolc/adolc_openmp.h:36 (liborpar+0x4
02b19)
    #2 main._omp_fn.0 ../../../../ADOL-C/examples/additional_examples/openmp_exam/liborpar.cpp:166 (liborpar+0x402b19)
    #3 gomp_thread_start ../../../libgomp/team.c:125 (libgomp.so.1+0x1da55)

  Location is global 'waitForMaster_begin' of size 1 at 0x7f858c6ccaea (libadolc.so.2+0x000000177aea)

  Thread T3 (tid=2993063, running) created by main thread at:
    #0 pthread_create ../../../../libsanitizer/tsan/tsan_interceptors_posix.cpp:969 (libtsan.so.0+0x5edc5)
    #1 gomp_team_start ../../../libgomp/team.c:845 (libgomp.so.1+0x1e06b)
    #2 __libc_start_main ../csu/libc-start.c:308 (libc.so.6+0x24082)

SUMMARY: ThreadSanitizer: data race ../../../../ADOL-C/src/tape_handling.cpp:1227 in beginParallel()
==================
@buech buech changed the title Data races in thread-parallel implementation Data races in OpenMP thread-parallel implementation Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant