Detection of a data race in OpenMP

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



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

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.

Leave a Comment

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