HOME
| OPENMP API Specification: Version 5.1 November 2020

6.22  OMP_ALLOCATOR

The OMP_ALLOCATOR environment variable sets the initial value of the def-allocator-var ICV that specifies the default allocator for allocation calls, directives and clauses that do not specify an allocator.

The following grammar describes the values accepted for the OMP_ALLOCATOR environment variable.

       ⟨allocator⟩  |=   ⟨predef- allocator⟩ |  ⟨predef- mem -space⟩  |
                     ⟨predef- mem -space⟩:⟨traits⟩
          ⟨traits⟩  |=   ⟨trait⟩=⟨value⟩ | ⟨trait⟩=⟨value⟩,⟨traits⟩
  ⟨predef-allocator⟩  |=   oneofthe predefinedallocatorsfrom Table2.10
⟨predef-mem -space⟩  |=   oneofthe predefinedmemory spacesfrom Table2.8

           ⟨trait⟩  |=   oneofthe allocatortraitnamesfrom Table 2.9
          ⟨value⟩  |=   oneofthe allowedvaluesfromTable2.9 | non- negativeinteger |
                     ⟨predef- allocator⟩

value can be an integer only if the trait accepts a numerical value, for the fb_datatrait the value can only be predef-allocator. If the value of this environment variable is not a predefined allocator, then a new allocator with the given predefined memory space and optional traits is created and set as the def-allocator-var ICV. If the new allocator cannot be created, the def-allocator-var ICV will be set to omp_default_mem_alloc.

Example:  

 
setenv OMP_ALLOCATOR omp_high_bw_mem_alloc 
setenv OMP_ALLOCATOR omp_large_cap_mem_space:alignment=16,\ 
pinned=true 
setenv OMP_ALLOCATOR omp_high_bw_mem_space:pool_size=1048576,\ 
fallback=allocator_fb,fb_data=omp_low_lat_mem_alloc  

Cross References