You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A variable labeled threadprivate in a fortran module lose his state after a use instruction follow by : only, in user module. A simple test case attached to this email
This test case do not compile with flang and openmp(fland -fopenmp -…… -march=…. Main.f90)
F90-S-0155-tab is not THREADPRIVATE (main.f90: 7)
If we remove : only in mod1_m then the issue disappear.
here is a test case to reproduce :
module mod_m
implicit none
integer, pointer, dimension(:) :: tab=>null()
!$omp threadprivate(tab)
integer, parameter :: info=4
integer:: autre=6
contains
subroutine create(n)
implicit none
integer, intent(in) ::n
integer::i
allocate (tab(n))
do i=1,n
tab(i)=i
end do
print*,"alloue"
end subroutine create
end module mod_m
module mod1_m
use mod_m, only : tab, create
implicit none
end module mod1_m
program main
use mod1_m
implicit none
call create(4)
!$omp parallel default(private) copyin(tab)
if (associated(tab)) then
print*,"associe"
else
print*,"pas associe"
endif
!$omp end parallel
end program main
The text was updated successfully, but these errors were encountered:
Hi,
A variable labeled threadprivate in a fortran module lose his state after a use instruction follow by : only, in user module. A simple test case attached to this email
This test case do not compile with flang and openmp(fland -fopenmp -…… -march=…. Main.f90)
F90-S-0155-tab is not THREADPRIVATE (main.f90: 7)
If we remove : only in mod1_m then the issue disappear.
here is a test case to reproduce :
The text was updated successfully, but these errors were encountered: