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 30525)

NOTE:
This feature is only available for ifort.

Message

Insert a "%s loop count min(%d)" statement right before the loop at line %d to parallelize the loop.

Advice

Add "!DIR$ LOOP COUNT" before the specified loop. This directive indicates the minimum trip count (number of iterations) of the loop that enables the parallelization of the loop.

Example

Consider the following:

      subroutine foo (n)
      integer, parameter :: N2 = 10000
      real (8) :: A(N2), B(N2)
      integer :: i, n
      do i =1, n
         A(i) = B(i) * B(i)
      end do
      end subroutine foo

In this case, if the trip count of the loop at line 5 is greater than 128, then use the LOOP COUNT directive to parallelize this loop.

If you determine it is safe to do so, you can add the directive as follows:

      subroutine foo (n)
      integer, parameter :: N2 = 10000
      real (8) :: A(N2), B(N2)
      integer :: i, n
      !dir$ loop count min(128)
      do i =1, n
         A(i) = B(i) * B(i)
      end do
      end subroutine foo
Make sure that the loop has a minimum of 128 iterations.

Verify

Confirm that the loop has the minimum number of iterations, as specified in the diagnostic message.

See Also