Intel compiler V11 and OpenMP - problem

FDSUser
Total Points:
165
Status Points:
0
Green Belt
November 23, 2008 3:29 AM PST
Rate
 
#8 Reply to #7

>>The Z_VECTOR variable is correctly allocated in another module,

Then Z_VECTOR cannot be private (unless it is also automatic)

Whats happening is your Z_VECTOR is being allocated in another module. i.e. The array descriptor for Z_VECTOR resides in the other module, and the allocation of Z_VECTOR data initializes the array descriptor of foo::Z_VECTOR. By making Z_VECTOR and OpenMP PRIVATE variable you are instantiating an uninitialized array descriptor of the name Z_VECTOR in the scope of the thread and within the context of the openmp parallel region. When compiling without OpenMP (and without the private) you will be using the modules copy of Z_VECTOR.

If each thread needs a seperate copy of Z_VECTOR and if you cannot stack allocate or you do not desire the overhead of allocation/deallocation as you enter and leave the parallel region then either place Z_VECTOR into thread private data or generate the approprate Z_VECTOR reference for passing to the subroutine. e.g. use pointer to array of Z_VECTORs indexed by a thread unique sequence number. Note, when you use OpenMP nested parallelization you cannot use omp_thread_num() to obtain a unique thread number (generate your own and place it into thread private data).

Jim Dempsey

 

Jim,

after some changes today that's what I found out. I copied the values of YYP directly to the subroutine GET_CP without using the Z_VECTOR and it works. Allocation of Z_VECTOR in the same MODULE where the DO-Loops are helps also. But if I read the OpenMP 3.0 specs, I find no definition of this problem. I found only example A.30.2.f in the specs, but I think this is different from my construct, because my Z_VECTOR is only allocated one time and not two times like in this example. I will ask this question at the OpenMP forum, maybe it can be answered how it has to work and to be implemented based on the specification.

Thanks for your help!



Intel Software Network Forums Statistics

8458 users have contributed to 31572 threads and 100535 posts to date.
In the past 24 hours, we have 18 new thread(s) 131 new posts(s), and 154 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Quoting - rase if (k.eq.0

Please welcome our newest member soundmyth