[all-commits] [llvm/llvm-project] 387ecb: [openmp] Fix bug63197.c test with 3 cores (#183269)

Joachim via All-commits all-commits at lists.llvm.org
Thu Mar 5 09:42:20 PST 2026


  Branch: refs/heads/release/22.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 387ecbac954db948b05bf6521a9ca9091f01ecfb
      https://github.com/llvm/llvm-project/commit/387ecbac954db948b05bf6521a9ca9091f01ecfb
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M openmp/runtime/test/parallel/bug63197.c

  Log Message:
  -----------
  [openmp] Fix bug63197.c test with 3 cores (#183269)

This test assumes that the number of available threads is not 3,
otherwise `#pragma omp parallel` and `#pragma omp parallel
num_thread(3)` are naturally going to do the same thing.

Instead use `omp_get_max_threads() - 1` as the number of threads in the
initial `omp parallel num_thread(N)` and then check that the number of
threads does not match the value in the later `omp parallel`.

(cherry picked from commit 368b884869651b69b14b836b25206aa62b501496)


  Commit: cc296598ee70fc4012476808842c074612a3551c
      https://github.com/llvm/llvm-project/commit/cc296598ee70fc4012476808842c074612a3551c
  Author: Joachim <jenke at itc.rwth-aachen.de>
  Date:   2026-03-05 (Thu, 05 Mar 2026)

  Changed paths:
    M openmp/runtime/test/parallel/bug63197.c

  Log Message:
  -----------
  [openmp][tests] Fix bug63197.c (#183508)

#183269 tried to fix the test, but the test can still randomly fail. The
OpenMP spec does not prevent the runtime to chose a smaller team size
than returned from omp_max_threads() for the second parallel region.

Using a larger value than `omp_max_threads()` in a `num_threads` clause
is valid OpenMP code. With a correct OpenMP implementation, the
team-size of the second parallel region must still be smaller or equal
the value returned from `omp_max_threads()`.

(cherry picked from commit d44e41794540d7fa85f857228a7616ec8592a7c4)


Compare: https://github.com/llvm/llvm-project/compare/ad30f6e88e65...cc296598ee70

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list