Auto-parallelization Threshold Control and Diagnostics

Threshold Control

The -par_threshold{n} option sets a threshold for auto-parallelization of loops based on the probability of profitable execution of the loop in parallel. The value of n can be from 0 to 100. The default value is 100. The -par_threshold{n} option should be used when the computation work in loops cannot be determined at compile-time.

The meaning for various values of n is as follows:

The compiler applies a heuristic that tries to balance the overhead of creating multiple threads versus the amount of work available to be shared amongst the threads.


The -par_report{0|1|2|3} option controls the auto-parallelizer's diagnostic levels 0, 1, 2, or 3 as follows:

-par_report0 = no diagnostic information is displayed.

-par_report1 = indicates loops successfully auto-parallelized (default). Issues a "LOOP AUTO-PARALLELIZED" message for parallel loops.

-par_report2 = indicates successfully auto-parallelized loops as well as unsuccessful loops.

-par_report3 = same as 2 plus additional information about any proven or assumed dependences inhibiting auto-parallelization (reasons for not parallelizing).

The following example shows an output generated by -par_report3 as a result from the command:

ifort -c -parallel -par_report3 myprog.f90

where the program myprog.f90 is as follows:

 program myprog

      integer a(10000), q

C Assumed side effects

      do i=1,10000

         a(i) = foo(i)


C Actual dependence

      do i=1,10000

         a(i) = a(i-1) + i



Example of -par_report Output:

program myprog
procedure: myprog
serial loop: line 5: not a parallel candidate
due to statement at line 6
serial loop: line 9
  flow data dependence from line 10 to line
10, due to "a"
12 Lines Compiled

Troubleshooting Tips