Help with OMP

Help with OMP

I have some code, stripped example below, which is causing a R/W data race condition reported by Inspector XE 2011 thread checking inside my function do_work.
The data1 and data2 arrays are arrays of C++ objects and are pased by reference to do_work
The objects do memory allocation operations inside do_work, but I am compiling /MD so memory allocate/deallocate is thread-safe.
All objects in do_work are local, there is no shared, global, data.
The XE tools are great , but I am baffled!

[cpp]#ifdef _OPENMP
#pragma omp parallel for
#endif
	for(int kxIndex=0;kxIndex  

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

I found the solution to my problem, and it is a bit "odd".
my do_work() function called a function in another compilation unit that was compiled /Qparallel
This instructs the Intel compiler to attempt some auto-parallelism
Once I removed /Qparallel the problems went away.

I am not sure why /Qparallel and opemp paralleism would conflict in such a way....

And by the way, Parallel Studio Advisor and Parallel Studio Inspector XE 2011 are absolutely fantastic. Absolutely indispensible tools.

Login to leave a comment.