Software Archive
Read-only legacy content
17061 Discussions

Segfault with asynchronous offload

aketh_t_
Beginner
207 Views

Hi

I am facing a segmentation fault problem when I try to perform asynchronous offload at a later point which I believe is the time when the function returned.

here is the code

function A

real :: WORKN(X,Y,Z)

!dir$ offload begin target(MIC:0)signal(1)out(WORKN)
   do k=1,km
           .
           !Lots of code
!dir$ end offload

end function A


function B

real :: Dummy

.
.
! Do Whatever

.
.
.
end function B




program run

!$OMP PARALLEL DO DEFAULT(SHARED) !this OMP is dummy i.e num_blockblock is 1, can be removed

do iblock=1,num_blocks

      call functionA(iblock) !here is the async offload

enddo

!$OMP END PARALLEL DO


!$OMP PARALLEL DO DEFAULT(SHARED)

do iblock=1,num_blocks

      call functionB(iblock) get segfault when B is running

enddo

!$OMP END PARALLEL DO

end program run
    

 
 

 

0 Kudos
0 Replies
Reply