Analyzing Guided Auto Parallelism Reports

In this step, you will analyze the results to determine if you want to implement the report recommendations.

The report applies to the following loop in the source code file scalar_dep.cpp:

for (i=0; i<n; i++) {
    if (A[i] > 0) {b=A[i]; A[i] = 1 / A[i]; }
    if (A[i] > 1) {A[i] += b;}
  }

The report recommends the following:

You can add the -parallel option and then run another analysis to see the result.

Note

You will implement the second recommendation in the next step of this tutorial.

In the sample code directory, compile the source code with the following command:

icpc -c -parallel -guide scalar_dep.cpp

Find the following in the compiler output.

scalar_dep.cpp(79) remark #30523: (PAR) Assign a value to the variable(s)
"b" at the beginning of the body of the loop in line 79. This will allow 
the loop to be parallelized. [VERIFY] Make sure that, in the original 
program, the variable(s) "b" read in any iteration of the loop has been
defined earlier in the same iteration. [ALTERNATIVE] Another way is to 
use "#pragma parallel private(b)" to parallelize the loop. [VERIFY] The 
same conditions described previously must hold.

scalar_dep.cpp(79): remark #30525: (PAR) Insert a "#pragma loop count 
min(256)" statement right before the loop at line 79 to parallelize the 
loop. [VERIFY] Make sure that the loop has a minimum of 256 iterations.

Note

Your remark and line numbers in the output may be different.

In the next step, you will implement the recommendations.

Previous: Running Guided Auto-parallelization Next: Implementing GAP Recommendations


Submit feedback on this help topic