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

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 25 09:13:00 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)
 #pragma omp single
   { printf("BBB %2d\n", omp_get_num_threads()); }
 
 #pragma omp parallel
 #pragma omp single
   {
-    if (omp_get_num_threads() != 3)
+    if (omp_get_num_threads() != N)
----------------
shiltian wrote:

If I understand correctly, the intention for this test was to test a bug that the number of threads was somehow impacted by the previous parallel region, even if it is not enabled.

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


More information about the Openmp-commits mailing list