Auto-parallelization: Threshold Control and Diagnostics

Threshold Control

The -par-threshold{n} (Linux*) or /Qpar-threshold[:n] (Windows*) 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.

Diagnostics

The -par-report (Linux) or /Qpar-report (Windows) option controls the diagnostic levels 0, 1, 2, or 3 of the auto-parallelizer. Specify level 3 to get the most information possible from the option.

For example, assume you want a full diagnostic report on the following example code:

Example 1: Sample code

void no_par(void)

{

  int i;

  int a[1000];

  for (i=1; i<1000; i++) {

    a[i] = (i * 2) % i * 1 + sqrt(i);

    a[i] = a[i-1] + i;

  }

}

You can use -par-report3 (Linux) or /Qpar-report3 (Windows) by entering a command similar to the following:

Platform

Commands

Linux

icpc -parallel -par-report3 -c diag_prog.c

Windows

icl /Qparallel /Qpar-report3 /c diag_prog.c

where -c (Linux) or /c (Windows) instructs the compiler to compile the example without generating an executable.

The following example output illustrates the diagnostic report generated by the compiler for the example code shown above.

Example 2: Sample Code Report Output

procedure: no_par

serial loop: line 29

  flow data dependence from line 30 to line 31, due to "a"

  flow data dependence from line 31 to line 31, due to "a"

Troubleshooting Tips