Intel® Fortran Compiler 18.0 Developer Guide and Reference

FOR_SET_FASTMEM_POLICY

Run-Time Function: Sets or gets the value of the Fortran Run-Time Library (RTL) FASTMEM/MEMKIND:HBW policy mode, which is the desired action to occur when an ALLOCATE statement requests FASTMEM/HBW memory, but it is not available to the program or node.

Module

USE IFCORE

result = FOR_SET_FASTMEM_POLICY(mode)

mode

Must be of type INTEGER(4). It is either a new policy value, or a request to return the current value. It must be one of the following:

  • FOR_K_FASTMEM_INFO - Tells the Fortran RTL to return the current FASTMEM policy value.

  • FOR_K_FASTMEM_NORETRY - Tells the Fortran RTL to issue an error if FASTMEM is not available.

  • FOR_K_FASTMEM_RETRY_WARN - Tells the Fortran RTL to warn if FASTMEM is not available, then use the default memory allocator.

  • FOR_K_FASTMEM_RETRY - Tells the Fortran RTL that if FASTMEM is not available, silently use the default memory allocator.

Results

The result type is INTEGER(4). The return value represents the previous setting of the Fortran Run-Time Library FASTMEM policy mode, unless the argument is FOR_K_FASTMEM_INFO, in which case the return value represents the current setting.

Example

Consider the following:

program fastmem_policy

  use ifcore
  integer(4) :: old_policy

  print *,"Print the current Results of initial for_set_fastmem_policy(FOR_K_FASTMEM_INFO):"
  old_policy = for_set_fastmem_policy(FOR_K_FASTMEM_INFO)
  select case (i4_old_policy)
      case (FOR_K_FASTMEM_NORETRY)
          print *,"    Issue a Severe error if FASTMEM is not available."
      case (FOR_K_FASTMEM_RETRY_WARN)
          print *,"    Issue a Warning if FASTMEM is not available, then use the default memory allocator."
      case (FOR_K_FASTMEM_RETRY)
          print *,"    If FASTMEM is not available, then silently use the default memory allocator."
  end select

  print *,"Set the FASTMEM policy to RETRY_WARN:"
  old_policy = for_set_fastmem_policy(FOR_K_FASTMEM_RETRY_WARN)

end program fastmem_policy

See Also