unexpected load/store datatype

Hi, I have a problem with a small subroutine that is the only part a want to parallelize of my program. Compiler says

PGF90-S-0000-Internal compiler error. unexpected load datatype 92 (EMTparms_class_v3.f95: 605)
PGF90-S-0000-Internal compiler error. unexpected store datatype 92 (EMTparms_class_v3.f95: 605)

where line 605 is the ‘end subroutine’ statement. Here is the code

attributes(global) subroutine inner_loop(d_r0_lat, d_sigma_ll, d_cell, d_V_ll, rcut, &
                                         acut, kappadbeta_l, betas0_l, n_l, i, pars_l, &
                                         d_sigma_ll_i, d_sum_V_ll)
    ! 'device' means: implicitly private to the module
    ! INPUT
    integer, value                          ::  n_l, i
    real(8), device, dimension(:,:)         ::  d_r0_lat
    real(8), device, dimension(:)           ::  d_sigma_ll
    real(8), device, dimension(:)           ::  d_sigma_ll_i, d_sum_V_ll
    real(8), device, dimension(3)           ::  d_cell
    real(8), device                         ::  d_V_ll
    real(8), value                          ::  rcut, acut
    real(8), value                          ::  kappadbeta_l, betas0_l
    type(EMTparms), value                   ::  pars_l

    ! LOCAL VARIABLES
    real(8), device, dimension(3)           ::  r3temp
    real(8), device                         ::  r, theta, rtemp
    integer                                 ::  thid

    ! RUN INNER LOOP, RUN !
                          ! Only works if n_l <= 1024 lattice atoms.
    thid = threadIdx%x    ! Otherwise blockDim needs to be used additionally
                          ! e. g. (blockidx%x-1)*blockdim%x + threadidx%x

    if (thid > i .and. thid <= n_l) then
      r3temp(1) = d_r0_lat( 1,i ) - d_r0_lat( 1,thid )  &
                  - ( d_cell(1) * ANINT( (d_r0_lat(1,i) &
                  - d_r0_lat(1,thid)) / d_cell(1)) )

      r3temp(2) = d_r0_lat( 2,i ) - d_r0_lat( 2,thid )  &
                  - ( d_cell(2) * ANINT( (d_r0_lat(2,i) &
                  - d_r0_lat(2,thid)) / d_cell(2)) )

      r3temp(3) = d_r0_lat(3,i) - d_r0_lat(3,thid)

      r = sqrt( sum( r3temp**2 ) )

      theta = 1.0 / (1 + exp( acut * (r - rcut) ) )

      rtemp = theta*exp(-pars_l%eta2 * (r - betas0_l) )
      d_sigma_ll(thid) = d_sigma_ll(thid) + rtemp

      d_sigma_ll_i(thid) = rtemp

      rtemp = theta*exp(-kappadbeta_l * (r - betas0_l))
      d_sum_V_ll(thid) = rtemp

    else if (thid <= i) then
      d_sigma_ll_i(thid) = 0.0
      d_sum_V_ll(thid)   = 0.0
    else
        WRITE(*,*) "ERROR: thid > n_l"

    end if

end subroutine inner_loop

I’m relatively new to Fortran, so it might just be some stupid mistake, but I could find any help elsewhere. Thanks in advance!

Hi Ingo11,

An ICE is always a problem with the compiler. Can you put together a reproducing example and sent it to PGI Customer Service (trs@pgroup.com).

I can’t reproduce the error with the code you provided since the definition for EMTparams is missing, but my best guess is that the problem has to do with passing a dervived type by value. Can you try rewritting the code so you’re only passing the value of eta2 instead of pars_l?

Thanks,
Mat