Software Archive
Read-only legacy content

Help with OMP

AndrewC
New Contributor III
605 Views

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  

0 Kudos
2 Replies
AndrewC
New Contributor III
605 Views
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....
0 Kudos
AndrewC
New Contributor III
605 Views
And by the way, Parallel Studio Advisor and Parallel Studio Inspector XE 2011 are absolutely fantastic. Absolutely indispensible tools.
0 Kudos
Reply