libgomp: Fix allocator handling for Linux when libnuma is not available

Follow up to r14-2462-g450b05ce54d3f0.  The case that libnuma was not
available at runtime was not properly handled; now it falls back to
the normal malloc.

libgomp/

	* allocator.c (omp_init_allocator): Check whether symbol from
	dlopened libnuma is available before using libnuma for
	allocations.
This commit is contained in:
Tobias Burnus 2023-07-14 09:14:37 +02:00
parent ad0518d97c
commit 407d68daed

View file

@ -377,8 +377,9 @@ omp_init_allocator (omp_memspace_handle_t memspace, int ntraits,
#ifdef LIBGOMP_USE_LIBNUMA
if (data.memkind == GOMP_MEMKIND_NONE && data.partition == omp_atv_nearest)
{
data.memkind = GOMP_MEMKIND_LIBNUMA;
libnuma_data = gomp_get_libnuma ();
if (libnuma_data->numa_alloc_local != NULL)
data.memkind = GOMP_MEMKIND_LIBNUMA;
}
#endif