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

seems threadprivate is broken with ifc version 8.0 on Linux

wong_david-c
Beginner
828 Views
Hi,

I have encountered a problem (producing incorrect answer) with threadprivate using ifc 8.0 on Linux. I have constructed a small test case and am able to demonstrate the problem. I am also using the example (as shown below) listed in the OpenMP API version 2.5, Nov 2004 documentation (p177). It shows the same problem. I wonder there is a bug in the ifc. Thanks.

Best regards,
David Wong

PS: here is how I compile the code:

/share/linux/intel8.0/bin/ifc -quiet -static -cpp -openmp -o t.x t.f

module a30_module8
real, pointer :: work(:)
save :: work
!$omp threadprivate(work)
end module a30_module8

subroutine sub1(n)
use a30_module8
!$omp parallel private(the_sum)
allocate(work(n))
call sub2(n,the_sum)
write (*,*) the_sum
!$omp end parallel
end subroutine sub1

subroutine sub2 (n, the_sum)
use a30_module8
work = 10
the_sum = sum(work)
end subroutine sub2

program a30_8_good
use a30_module8
n = 10
call sub1(n)
end program a30_8_good
0 Kudos
4 Replies
Steven_L_Intel1
Employee
828 Views
We have had some threadprivate issues in the past, but version 8.0 was replaced with 8.1 last August. The current version is 8.1.026. Please try that out and, if it still doesn't work for you, submit the problem through Intel Premier Support. I tried it on a recent compiler and got the result 100.
0 Kudos
wong_david-c
Beginner
828 Views
Hi Mr. Lionel,

A moment ago, we have installed ifc 8.1 (8.1.024), and it looks like it works even with my another test case. I will try it on the original code. Thanks.

Best regards,
David Wong
0 Kudos
wong_david-c
Beginner
828 Views


sblionel wrote:
We have had some threadprivate issues in the past, but version 8.0 was replaced with 8.1 last August. The current version is 8.1.026. Please try that out and, if it still doesn't work for you, submit the problem through Intel Premier Support. I tried it on a recent compiler and got the result 100.




Hi Mr. Lionel,

Does the same threadprivate issue occur in the Intel compiler 8.1.028 on Windows? One of my colleagues claims he is experiencing that problem on Windows. Please advise.

Thanks,
David Wong
0 Kudos
Steven_L_Intel1
Employee
828 Views
The thing with such issues is that it's impossible to say that something is "the same problem" without actually seeing an example. Many times I have thought that two programs which exhibited the same symptom were the same problem, but they weren't.

I know we have fixed THREADPRIVATE issues in the past. That does not mean that there aren't other such issues with programs that do things differently. My advice is the same - send an example to Intel Premier Support.
0 Kudos
Reply