[llvm-bugs] [Bug 27877] New: ordered clause on pragma for does not respect semantics

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 25 08:20:11 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27877

            Bug ID: 27877
           Summary: ordered clause on pragma for does not respect
                    semantics
           Product: OpenMP
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Runtime Library
          Assignee: unassignedbugs at nondot.org
          Reporter: carlo.bertolli at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The following testcase:
#include <stdio.h>

int main() {

  int s[10];
  int count = 0;

#pragma omp target if(0)
#pragma omp parallel num_threads(8)
  {
    #pragma omp for ordered
    {
      for (int i=0;i<10;i++) {
        s[i] = count;
        count++;
      }
    }
  }

  for (int i=0;i<10;i++) {
    printf("%d\n", s[i]);
  }

  return 1;
}

prints out:

2
4
1
5
6
0
7
4
3
8

on latest clang+openMP from git repositories. Successive re-runs show different
orders.
I would have instead expected an ordered print of numbers from 0 to 9.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160525/4e77cda3/attachment.html>


More information about the llvm-bugs mailing list