11.3 Memory allocation

The description below applies to:

For the available predefined allocators and, as applicable, their associated predefined memory spaces and for the available traits and their default values, see OMP_ALLOCATOR – Set the default allocator. Predefined allocators without an associated memory space use the omp_default_mem_space memory space.

For the memory spaces, the following applies:

On Linux systems, where the memkind library (libmemkind.so.0) is available at runtime, it is used when creating memory allocators requesting

On Linux systems, where the numa library (libnuma.so.1) is available at runtime, it used when creating memory allocators requesting

Note that the numa library will round up the allocation size to a multiple of the system page size; therefore, consider using it only with large data or by sharing allocations via the pool_size trait. Furthermore, the Linux kernel does not guarantee that an allocation will always be on the nearest NUMA node nor that after reallocation the same node will be used. Note additionally that, on Linux, the default setting of the memory placement policy is to use the current node; therefore, unless the memory placement policy has been overridden, the partition trait environment (the default) will be effectively a nearest allocation.

Additional notes regarding the traits:

See also: Offload-Target Specifics