aboutsummaryrefslogtreecommitdiff
path: root/libgomp/env.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-10-15 12:16:50 +0200
committerJakub Jelinek <jakub@redhat.com>2021-10-15 12:16:50 +0200
commite7ce32c783c8d38ef8a1ab227fd05cbab41da75b (patch)
tree574280be16a3a47f6e06e653f26c4f185085e7ad /libgomp/env.c
parent5809be05a2813f2a95d9787f388185fa31fbf3a2 (diff)
downloadgcc-e7ce32c783c8d38ef8a1ab227fd05cbab41da75b.zip
gcc-e7ce32c783c8d38ef8a1ab227fd05cbab41da75b.tar.gz
gcc-e7ce32c783c8d38ef8a1ab227fd05cbab41da75b.tar.bz2
openmp: Add support for OMP_PLACES=numa_domains
This adds support for numa_domains abstract name in OMP_PLACES, also new in OpenMP 5.1. Way to test this is OMP_PLACES=numa_domains OMP_DISPLAY_ENV=true LD_PRELOAD=.libs/libgomp.so.1 /bin/true and see what it prints on OMP_PLACES line. For non-NUMA machines it should print a single place that covers all CPUs, for NUMA machine one place for each NUMA node with corresponding CPUs. 2021-10-15 Jakub Jelinek <jakub@redhat.com> * env.c (parse_places_var): Handle numa_domains as level 5. * config/linux/affinity.c (gomp_affinity_init_numa_domains): New function. (gomp_affinity_init_level): Use it instead of gomp_affinity_init_level_1 for level == 5. * testsuite/libgomp.c/places-5.c: New test.
Diffstat (limited to 'libgomp/env.c')
-rw-r--r--libgomp/env.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libgomp/env.c b/libgomp/env.c
index 38903c7..7eb895f 100644
--- a/libgomp/env.c
+++ b/libgomp/env.c
@@ -701,6 +701,11 @@ parse_places_var (const char *name, bool ignore)
env += 9;
level = 4;
}
+ else if (strncasecmp (env, "numa_domains", 12) == 0)
+ {
+ env += 12;
+ level = 5;
+ }
if (level)
{
count = ULONG_MAX;