openmp: Fix up handling of OMP_PLACES=threads(1)
authorJakub Jelinek <jakub@redhat.com>
Fri, 15 Oct 2021 14:25:25 +0000 (16:25 +0200)
committerJakub Jelinek <jakub@redhat.com>
Fri, 15 Oct 2021 14:25:25 +0000 (16:25 +0200)
commit4764049dd620affcd3e2658dc7f03a6616370a29
tree825118894e654bfef2f48c44024bc73ddd875920
parentf3d64372d777d7d6068df8167b6751c289963e85
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.
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]