Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29229 Discussions

Intel FORTRAN compiler (ifx) : threadprivate common block issue

apkumbhar
Beginner
352 Views

When Intel FORTRAN compiler (ifx) is used in combination with threadprivate common block then the memory location pointed by threadprivate variable is different when variable is used from different routines.

 

Let’s Say, I have a variable kou and it is part of threadprivate common block. When I am referring to the variable and checking it’s memory location from dominit.F and mrmain.f as below

write(*,*) "dominit.F loc 3 ",loc(kou),kou

 

dominit.F loc 2          2040460304416                     6
dominit.F loc 3          2040460304416                     6
mrmain.F loc 3          2040450520288                     0

 

Then memory location is different and hence value stored is also different. Note that the code is executing outside OpenMP parallel region. So expected that memory referred should be same from all subroutines.

 

0 Kudos
2 Replies
Ron_Green
Moderator
278 Views

This was reported to us a week or 2 ago and an existing bug report was opened.  We will be addressing this issue.

To be sure, do you have a simple reproducer that I could test once a fix has been promoted to our main branch?

0 Kudos
jimdempseyatthecove
Honored Contributor III
36 Views

Add to your existing code a module, with a threadprivate variable koukou.

Have mrmain and dominit print the loc of koukou in addition to the loc of kou

IOW see if the address issue is with module variables as well.

Note, I am assuming dominit is printing out the loc of the common variable as opposed to a dummy variable who's actual argument is the common variable. If not, please inform.

Jim Dempsey

 

0 Kudos
Reply