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

libomp fails runtime/test/barrier/omp_barrier.c for X86 #26627

Closed
llvmbot opened this issue Jan 22, 2016 · 3 comments
Closed

libomp fails runtime/test/barrier/omp_barrier.c for X86 #26627

llvmbot opened this issue Jan 22, 2016 · 3 comments
Labels
bugzilla Issues migrated from bugzilla openmp

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 22, 2016

Bugzilla Link 26253
Resolution FIXED
Resolved on Jan 26, 2016 07:22
Version unspecified
OS Linux
Blocks #26433
Attachments Pre-processed source, Assembly
Reporter LLVM Bugzilla Contributor
CC @hfinkel

Extended Description

I don't know OpenMP or X86 very well so I'd appreciate some help debugging this.

I've attached the pre-processed source and I'll attach the assembly shortly (bugzilla only allows one attachment during submit).

Here's the llvm-lit output:
/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/./bin/clang -fopenmp=libomp -I /home/das-local/llvm-release-3.8/release/rc1/llvm.src/projects/openmp/runtime/test -I /home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/src -L /home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/lib /home/das-local/llvm-release-3.8/release/rc1/openmp.src/runtime/test/barrier/omp_barrier.c -o /home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/test/barrier/Output/omp_barrier.c.tmp -lm && /home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/test/barrier/Output/omp_barrier.c.tmp

Exit Code: 10

Command Output (stdout):

Command 0: "/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/./bin/clang" "-fopenmp=libomp" "-I" "/home/das-local/llvm-release-3.8/release/rc1/llvm.src/projects/openmp/runtime/test" "-I" "/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/src" "-L" "/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/lib" "/home/das-local/llvm-release-3.8/release/rc1/openmp.src/runtime/test/barrier/omp_barrier.c" "-o" "/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/test/barrier/Output/omp_barrier.c.tmp" "-lm"
Command 0 Result: 0
Command 0 Output:

Command 0 Stderr:

Command 1: "/home/das-local/llvm-release-3.8/release/rc1/Phase3/Release/llvmCore-3.8.0-rc1.obj/projects/openmp/runtime/test/barrier/Output/omp_barrier.c.tmp"
Command 1 Result: 10
Command 1 Output:

Command 1 Stderr:

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 23, 2016

From my understanding, inside a parallel region the return value of omp_get_thread_num() varies from 0 to omp_get_num_threads()-1 inclusive. However,
the rank variable, which holds the return value from that function, is tested for equality only with 1 and 2. If the total number of threads is 2, as it was in my case when testing on CI20 board with 2 cores, then this test will fail either way.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 25, 2016

I think you're right, I'm running on a 2-core machine too and this test assumes there are at least three threads. I've tried it on a 4-core machine and the test passes there unless I limit it to two threads with OMP_NUM_THREADS.

I've read a small amount of the openmp spec and it seems that this test doesn't really need the third thread so I've posted http://reviews.llvm.org/D16532.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Jan 26, 2016

Fixed in r258695 and merged in r258719

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla openmp
Projects
None yet
Development

No branches or pull requests

1 participant