https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95150
Bug ID: 95150
Summary: Some offloaded programs crash with openmp
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
Assignee: unassigned at gcc dot gnu.org
Reporter: chinoune.mehdi at hotmail dot com
CC: jakub at gcc dot gnu.org
Target Milestone: ---
This is the reduced program:
$ cat matmul.F90
program main
implicit none
integer, parameter :: sp = selected_real_kind(6,37)
integer, parameter :: l = 1024, m = 1024, n = 1024
real(sp), allocatable :: a(:,:), b(:,:), c(:,:)
integer :: i, j, k, t1, t2
real(sp) :: tic
!
call system_clock( t1, tic)
!
allocate( a(l,m), b(m,n), c(l,n) )
!
call random_number(a)
call random_number(b)
c = 0._sp
!
!$acc data copyin(a,b) copyout(c)
!$acc parallel loop collapse(3)
!$omp target teams distribute collapse(3) map( to:a,b ) map( tofrom:c)
do j = 1, n
do k = 1, m
do i = 1, l
c(i,j) = a(i,k)*b(k,j) + c(i,j)
end do
end do
end do
!$acc end data
!
call system_clock(t2)
print*, (t2-t1)/tic
!
end program main
This program compiles successfully with both OpenMP and OpenACC but it crashs
with OpenMP after a short time of running, throwing this error message:
$ gfortran-10 -fopenmp -foffload=nvptx-none="-lm -lgfortran" matmul.F90 -o
test.x
$ $ ./test.x
libgomp: cuCtxSynchronize error: the launch timed out and was terminated
The same message appears with gfortran-9