Advisor - wrong correctness report

Advisor - wrong correctness report


I tried Adivsor (latest release update 1 - VS 2008 - Intel C++ 12) on an app which hasone for loop to check its correctnes report feature. Advisor does not seem to recognize problems in this case.

Here is the very simple pi numerical integration code :

double sum = 0.0;
static double step = 1.0/(double) ITERATIONS;
double x;

//#pragma omp parallel for
for (int i=0; i< ITERATIONS; i++){
x = ((double)i+0.5)*step;
sum += 4.0/(1.0 + x*x);
pi = step * sum;

Having ommited the private and reduction clauses, there are obviously two problems, x should be declared private or declared inside the for loop and sum should undergo a reduction or be protected with an atomic lock. However, Advisor reports the code above as being OK - it finds no problems. If I uncomment the pragma, comment out the annotations and recompile for OpenMP, Inspector does find two problems : a data race and a cross thread stack access.

It seems to me that Advisor needs to be worked on some more, or could it be that it is just not yet able to handle for loops as it may consider that there is only one thread running with the annotated code hence no potential problems ? This would explain the wrong suitability report as I reported in my previous post and the absence of data access conflicts since the code would be running on only one thread as perAdvisor annotations.

Advisor would be a great tool for analyzing existing code if it could realiably indicate potential gains (see my previous post on Advisor) within the constext of both task parallelization and data parallelization.


4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hello Michle,

Again, thank you for taking the time to let us know of your detailed feedback. We appreciate it.

Regarding the correctness issues, please note the following:
* We currently do not detect data sharing issues on local variables (the reason being thatsuch support wouldlead to many false-positives). This is documented in the Intel Parallel Advisor 2011 documentation. I'd be glad to provide youmore information on the relevant sections, if needed. Please let me know.
* Would it have helped reassure you better if we provided more feedback during correctness analysis that data sharing issues on Local variables is not supported? If so, I'd be happy to explore incorporation of this in future versions of our product.
* Would it be possible for you to share the test program so that I can investigate further? You can send me an email at "ravi DOT vemuri AT intel DOT com" if you'd like to provide the test program.

We expect Intel Parallel Advisor to help with both task- and data-parallelism. If you can provide more specific feedback on what you did and why it didnt meet your expectations, well be happy to address it.

Again, your input here is valuable and I will be sure to forward it to Engineering.

Thank you!



Thanks for your quick response.

I have several comments on what you say :
- The sample code is in the post - all you need to do is copy paste it into any Hello World program and run it.
- The variables Advisor should have detected are not local to the thread. Inspector does detect the data conflicts but Advisor correctness does not.
- The Intel Parallel Advisor documentation could be improved greatly - there is no reference as to how to use Advisor on loops. There is an example but it uses TASK annotations which yield wrong results.

Please consider this post closed as I have expanded on the issue in my other Advisor post: Problem with for loops.


Hello Michle,

Thank you for your note and additional feedback. I will be sure to respond to your other forum post shortly.



Leave a Comment

Please sign in to add a comment. Not a member? Join today