Hello,
I have a need that uses multi-GPU to calculte the simulation. So, I am trying to do it using OpenMP and OpenAcc. But, there is the error “NVFORTRAN-F-0000-Internal compiler error. gen_llvm_expr(): no incoming ili 0”, when I switch off the annotation of “!$omp”. The codes work well when I cancel the annotation of it.
Here is the part of original codes:
PROGRAM MAIN
USE CONSTANTPARAMETERS
USE ELECTROMAGNETIC_VARIABLES
USE RES_MODEL_PARAMETER
USE TIME_PARAMETERS
use openacc
use omp_lib
use cudafor
IMPLICIT none
INTEGER(KIND = 4) :: numblocks, tid, istart, iend, k, j, i, N, blocks
REAL(KIND=8) :: a(3), b, c, d,f(200,200,200)
N = 0
a = 0
c = 0
d = 1
f=0
istat = cudaGetDeviceCount( numblocks )
call acc_init(acc_device_nvidia)
write(*,*) numblocks
! numblocks = acc_get_num_devices(acc_device_nvidia)
! print*, "numblocs =", numblocks
!!$omp parallel do num_threads(numblocks) private(b,c,N,tid)
do blocks = 0, 1
b = d + blocks
! istat = cudaSetDevice(0)
tid = omp_get_thread_num()
call acc_set_device_num(1,acc_device_nvidia)
!$acc data create(f) copyin(tid) copy(N)
!$acc kernels loop
do k = 1, 3
N = N + tid
enddo
!$acc end kernels
! !$acc kernels
! c = a(1)+a(2)+a(3)
! !$acc end kernels
!!$acc update host(N)
!$acc end data
c = N + b
write(*,*)"The device is :",tid,"The Result is :",blocks,b,N,c
enddo
!!$omp end parallel do
stop
end program main