Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

Detection of a data race in OpenMP

In the following code, there is a data race.

I would like to know which compiler option must be turn on in order to see that Intel C++ compiler detects this data race. And what will be the expected message from the compiler.

 # pragma omp parallel for {

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

          a(i) = a(i) + a(i – 1)

 }

Thanks in advance

Ami

   

0 Kudos
1 Reply
Highlighted
Black Belt
9 Views

If you compile with -parallel -opt-report this should be flagged as a dependency preventing parallelization and vectorization.  OpenMP per se is weak on this point of diagnostics.

Intel Inspector tool should diagnose this at run time.  Ideally, with static analysis, it should also be diagnosed without running.  Advisor tool should flag this as ineligible for parallelism as it stands.

0 Kudos