]> git.ipfire.org Git - thirdparty/gcc.git/commit
openmp: Fix up handling of OMP_PLACES=threads(1)
authorJakub Jelinek <jakub@redhat.com>
Fri, 15 Oct 2021 21:31:13 +0000 (23:31 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 15 Oct 2021 21:31:13 +0000 (23:31 +0200)
commit372e0273080638bfa3b02e30558581a1b82f1500
treec6c99065535345837d4918534febf9a2a2c7e18e
parentc0a91dff3902eb00ff1ac8755f1b20a27b721728
openmp: Fix up handling of OMP_PLACES=threads(1)

When writing the places-*.c tests, I've noticed that we mishandle threads
abstract name with specified num-places if num-places isn't a multiple of
number of hw threads in a core.  It then happily ignores the maximum count
and overwrites for the remaining hw threads in a core further places that
haven't been allocated.

2021-10-15  Jakub Jelinek  <jakub@redhat.com>

* config/linux/affinity.c (gomp_affinity_init_level_1): For level 1
after creating count places clean up and return immediately.
* testsuite/libgomp.c/places-6.c: New test.
* testsuite/libgomp.c/places-7.c: New test.
* testsuite/libgomp.c/places-8.c: New test.
* testsuite/libgomp.c/places-9.c: New test.
* testsuite/libgomp.c/places-10.c: New test.

(cherry picked from commit 4764049dd620affcd3e2658dc7f03a6616370a29)
libgomp/ChangeLog.omp
libgomp/config/linux/affinity.c
libgomp/testsuite/libgomp.c/places-10.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/places-6.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/places-7.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/places-8.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/places-9.c [new file with mode: 0644]