- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I compiled the factorial program from http://software.intel.com/en-us/articles/parallel-lint/#IDAUZY0E (see below) with ICC 12.0.1.096 from Parallel Studio 2011 using the options /Qopenmp and /Qdiag-enable:sc-parallel2. According to the manual, the compiler should emit a warning due to a dependency between the loop iterations in the example, but it doesn't. Any ideas why no warning is emitted?
Thanks, Peter
Thanks, Peter
- #include
- #include"omp.h"
- intmain(void)
- {
- inti;
- intfactorial[10];
- factorial[0]=1;
- #pragmaompparallelfor
- for(i=1;i<10;i++){
- factorial=i*factorial[i-1];//warning#12246
- }
- return0;
- }
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce the issue. I will investigate and get back to you.
Thanks,
--mark
Thanks,
--mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is indeed data dependence in the loop. The reason no dependency is reported is that per OpenMP specification, OpenMP is an assertion-based parallelization model, that is the compiler complies with whatever the user asserts/intends by the use of the OMP pragma so the compiler does not do any dependency checking. That was one of the reasons behind the development of the Intel Inspector XE 2011 available in the Intel Parallel Studio XE. If you run your test case under Intel Parallel Inspector, the inspector will report:
"One or more threads in the application accessed the stack of another thread.
This may indicate one or more bugs in your application. Setting the Intel Inspector XE 2011 to detect data races on stack accesses and running another analysis may help you locate these and other bugs. "
The Intel C++ Compiler Vectorizers will report the data dependency as follows:
"One or more threads in the application accessed the stack of another thread.
This may indicate one or more bugs in your application. Setting the Intel Inspector XE 2011 to detect data races on stack accesses and running another analysis may help you locate these and other bugs. "
The Intel C++ Compiler Vectorizers will report the data dependency as follows:
> icc -w -vec-report3 -c t.c
t.c(9): (col. 7) remark: loop was not vectorized: existence of vector dependence.
t.c(10): (col. 9) remark: vector dependence: assumed FLOW dependence between factorial line 10 and factorial line 10.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page