[Openmp-commits] [openmp] [openmp] Fix bug63197.c test with 3 cores (PR #183269)

via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 25 09:14:30 PST 2026


================
@@ -4,14 +4,15 @@
 #include <stdio.h>
 
 int main(int argc, char *argv[]) {
-#pragma omp parallel num_threads(3) if (0)
+  unsigned N = omp_get_max_threads() - 1;
+#pragma omp parallel num_threads(N) if (0)
----------------
jprotze wrote:

I think, to prove that the issue described in https://reviews.llvm.org/D152883 is not triggered, N should be `omp_get_max_threads() + 1`. This number will never be chosen in the second parallel, but it is valid to request this N in a `num_threads` clause.

https://github.com/llvm/llvm-project/pull/183269


More information about the Openmp-commits mailing list