- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I just want to report a very strange OpenMP related bug.
The program listed below produces random output within the parallel region, e.g.
> ifort -openmp omp_strange.F90 && OMP_NUM_THREADS=1 ./a.out
42
-261231752
The bug occurs with Intel Fortran 11.1 20101201
Versions 11.0 20090609 and 12.0.0 20101116 are not affected.
The following things seem to be necessary to reproduce the bug:
- the default initialization of the pointer in the derived type
- declaring a variable of type tt in the main program (which may be unused)
- parallel region in a subroutine with a local variable of type tt
Here's the code:
The program listed below produces random output within the parallel region, e.g.
> ifort -openmp omp_strange.F90 && OMP_NUM_THREADS=1 ./a.out
42
-261231752
The bug occurs with Intel Fortran 11.1 20101201
Versions 11.0 20090609 and 12.0.0 20101116 are not affected.
The following things seem to be necessary to reproduce the bug:
- the default initialization of the pointer in the derived type
- declaring a variable of type tt in the main program (which may be unused)
- parallel region in a subroutine with a local variable of type tt
Here's the code:
[fortran]program omp_strange
implicit none
type tt
integer :: i
integer, pointer :: ip => null()
end type tt
type(tt) :: unused_variable
call test()
contains
subroutine test
type(tt) :: v
v%i = 42
print*,v%i
!$omp parallel shared(v)
print*,v%i
!$omp end parallel
end subroutine test
end program omp_strange[/fortran] Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the problem is not in 12.0, it won't be looked at. Please use the current version. I tried this in the forthcoming Update 6 and it worked ok there as well.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page