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

ID 767251
Date 9/08/2022
Public

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

Document Table of Contents

GAP Message (Diagnostic ID 30526)

NOTE:
This feature is only available for ifort.

Message

To parallelize the loop at line %d, annotate the routine %s with %s.

Advice

If the loop contains a call to a function, the compiler cannot parallelize the loop without more information about the function being called.

However, if the function being called in the loop is an elemental function or a function specified with ATTRIBUTES CONCURRENCY_SAFE, then the call does not inhibit parallelization of the loop.

Example

Consider the following:

      subroutine foo ()
      integer, parameter :: N2 = 10000
      real (8) :: A(N2), B(N2)
      interface
         function bar (k)
         integer :: bar, k
         end function bar
      end interface
       
      integer :: i
      do i =1, N2
         A(i) = B(i) * bar(N2)
      end do
      end subroutine foo
In this case, to parallelize the loop at line 11, declare the routine bar as elemental.

If you determine it is safe to do so, an alternative way you can modify the program code is as follows:

      subroutine foo ()
      integer, parameter :: N2 = 10000
      real (8) :: A(N2), B(N2)
      interface
         function bar (k)
      !dir$ attributes concurrency_safe : profitable :: bar
         integer :: bar, k
         end function bar
      end interface
       
      integer :: i
      do i =1, N2
         A(i) = B(i) * bar(N2)
      end do
      end subroutine foo

Verify

Confirm the routine satisfies the semantics of this annotation. A weaker annotation able to achieve a similar effect is ATTRIBUTES CONCURRENCY_SAFE(PROFITABLE).