gcc/libgomp/config
Tobias Burnus 450b05ce54 libgomp: Use libnuma for OpenMP's partition=nearest allocation trait
As with the memkind library, it is only used when found at runtime;
it does not need to be present when building GCC.

The included testcase does not check whether the memory has been placed
on the nearest node as the Linux kernel memory handling too often ignores
that hint, using a different node for the allocation.  However, when
running with 'numactl --preferred=<node> ./executable', it is clearly
visible that the feature works by comparing malloc/default vs. nearest
placement (using get_mempolicy to obtain the node for a mem addr).

libgomp/ChangeLog:

	* allocator.c: Add ifdef for LIBGOMP_USE_LIBNUMA.
	(enum gomp_numa_memkind_kind): Renamed from gomp_memkind_kind;
	add GOMP_MEMKIND_LIBNUMA.
	(struct gomp_libnuma_data, gomp_init_libnuma, gomp_get_libnuma): New.
	(omp_init_allocator): Handle partition=nearest with libnuma if avail.
	(omp_aligned_alloc, omp_free, omp_aligned_calloc, omp_realloc): Add
	numa_alloc_local (+ memset), numa_free, and numa_realloc calls as
	needed.
	* config/linux/allocator.c (LIBGOMP_USE_LIBNUMA): Define
	* libgomp.texi: Fix a typo; use 'fi' instead of its ligature char.
	(Memory allocation): Renamed from 'Memory allocation with libmemkind';
	updated for libnuma usage.
	* testsuite/libgomp.c-c++-common/alloc-11.c: New test.
	* testsuite/libgomp.c-c++-common/alloc-12.c: New test.
2023-07-12 13:50:21 +02:00
..
accel Update copyright years. 2023-01-16 11:52:17 +01:00
bsd Update copyright years. 2023-01-16 11:52:17 +01:00
darwin Update copyright years. 2023-01-16 11:52:17 +01:00
gcn libgomp: Honor OpenMP's nteams-var ICV as upper limit on num teams [PR109875] 2023-05-21 20:37:15 +02:00
hpux Update copyright years. 2023-01-16 11:52:17 +01:00
linux libgomp: Use libnuma for OpenMP's partition=nearest allocation trait 2023-07-12 13:50:21 +02:00
mingw32 Update copyright years. 2023-01-16 11:52:17 +01:00
nvptx libgomp: Honor OpenMP's nteams-var ICV as upper limit on num teams [PR109875] 2023-05-21 20:37:15 +02:00
posix Update copyright years. 2023-01-16 11:52:17 +01:00
rtems Update copyright years. 2023-01-16 11:52:17 +01:00
t-aix aix: remove libgomp and libatomic archives before creating FAT archives 2020-10-11 17:30:24 -04:00