Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

ALLOCATORS

OpenMP* Fortran Compiler Directive: Specifies memory allocators to be used to allocate variables in the associated Fortran ALLOCATE statement and to use in their deallocation. This feature is only available for ifx.

Syntax

!$OMP ALLOCATORS [clause[[,] clause]... ]

   ALLOCATE statement

[!$OMP END ALLOCATORS]

clause

Is ALLOCATE.

An allocate object in the ALLOCATE statement cannot appear as a list item in more than one ALLOCATE clause in an ALLOCATORS directive. Each list item in the ALLOCATE clauses must have the ALLOCATABLE or POINTER attribute; therefore, it cannot be a common block name enclosed in slashes. Derived type components that have the ALLOCATABLE or POINTER attribute can appear as list items. List items cannot be associate names.

The ALLOCATORS construct associates an allocator with an allocate object in the associated ALLOCATE statement that is used for both allocation and deallocation of the object.

If an object appears as a list item of an ALLOCATE clause in an ALLOCATORS directive, it must also appear in the allocation list of the associated ALLOCATE statement. When an object is deallocated, it is deallocated using the same allocator used to allocate it. If an object is deallocated and reallocated during intrinsic assignment, the same allocator is used for the deallocation and reallocation. Otherwise, the allocator specified for a list item is used to allocate the list item only in the ALLOCATE statement associated with the ALLOCATE directive, and to deallocate it, either explicitly or implicitly, when it goes out of scope.

If an allocate object in an ALLOCATE statement associated with an OpenMP ALLOCATE directive does not appear as a list item in the directive, the allocate object is ALLOCATED as if it appeared in a Fortran ALLOCATE statement that was not associated with an OpenMP ALLOCATE directive.

The functionality of the ALLOCATORS construct is also provided by the ALLOCATE directive form that is associated with a Fortran ALLOCATE statement; this is described in the ALLOCATE directive description as the second form of the ALLOCATE directive. If multiple allocators are to be used for an ALLOCATE statement, each allocator requires its own ALLOCATE directive. This form of the ALLOCATE directive has been deprecated and replaced by the ALLOCATORS construct.