[Openmp-commits] [PATCH] D21842: Fix omp_sections_nowait.c test to address Bugzilla Bug 28336

Hal Finkel via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 29 11:05:05 PDT 2016


hfinkel added inline comments.

================
Comment at: test/worksharing/sections/omp_sections_nowait.c:23
@@ +22,3 @@
+    " and waits.\n", rank);
+  while (release == 0);
+  #pragma omp atomic
----------------
AndreyChurbanov wrote:
> hfinkel wrote:
> > I don't recall how this part of OpenMP's memory model is specified. Do you technically need an omp flush(release) here too to force this thread to synchronize its local memory view with the global one?
> In theory all accesses to "release" variable are data races here. And flush won't change this.  So theoretically atomic reads/writes could help the test be absolutely correct.
> 
> But in practice these data races are benign, so I think it is OK to rely on compiler to honor volatile keyword and the fact that int type has all reads and writes atomic (unless you artificially align it on odd boundary).
> 
> So I would not introduce complication with omp atomic read/write for variable "release" now.
> 
> Just my 2 cents.
> 
Fair enough; fine by me. I'm fine with our test suite testing non-standard guarantees we expect our implementation (and any reasonable implementation) to provide.


Repository:
  rL LLVM

http://reviews.llvm.org/D21842





More information about the Openmp-commits mailing list