[Openmp-commits] [PATCH] D16532: Make runtime/test/barrier/omp_barrier.c pass on 2-core machines

Daniel Sanders via Openmp-commits openmp-commits at lists.llvm.org
Mon Jan 25 07:17:51 PST 2016


dsanders created this revision.
dsanders added a reviewer: AndreyChurbanov.
dsanders added subscribers: llvm-commits, openmp-commits, hans.
dsanders set the repository for this revision to rL LLVM.

This test currently expects omp_get_thread_num() to return 1 and 2, effectively requiring three threads. 2-core machines only seem to spawn two threads, preventing omp_get_thread_num() from returning 2. This patch changes the expected thread numbers to 0 and 1 so that it passes on 2-core machines.

This fixes the last issue in the x86_64-linux-gnu-debian8 build of the 3.8.0 release.

Repository:
  rL LLVM

http://reviews.llvm.org/D16532

Files:
  runtime/test/barrier/omp_barrier.c

Index: runtime/test/barrier/omp_barrier.c
===================================================================
--- runtime/test/barrier/omp_barrier.c
+++ runtime/test/barrier/omp_barrier.c
@@ -14,12 +14,12 @@
   {
     int rank;
     rank = omp_get_thread_num ();
-    if (rank ==1) {
+    if (rank == 0) {
       my_sleep(SLEEPTIME);
       result2 = 3;
     }
     #pragma omp barrier
-    if (rank == 2) {
+    if (rank == 1) {
       result1 = result2;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16532.45863.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160125/f92a3912/attachment.bin>


More information about the Openmp-commits mailing list