PGI 19.10 compiler error: parse redefinition of global

I get a strange error when compiling.
Here is a reduced testcase with two source files. First one:

$ cat modA.F90

MODULE o_PARAM
integer, parameter            :: WP=8        ! Working precision
integer, dimension(100)        :: tracer_ID  = RESHAPE((/0, 1/), (/100/), (/0/)) 

END MODULE o_PARAM

Second one:

$ cat modB.F90

MODULE i_ARRAYS
USE o_PARAM
implicit none
END MODULE i_ARRAYS

!=====================================================================
module i_therm_param
USE o_PARAM
  implicit none

REAL(kind=WP)    :: h0=1.0_WP      ! Lead closing parameter [m] ! 0.5
!$acc declare copyin (h0)

end module i_therm_param

and then compiling together:

$ which pgfortran
/compilers/pgi/19.10/bin/pgfortran
$ pgfortran -acc modA.F90 modB.F90 
modA.F90:
modB.F90:
nvvmCompileProgram error: 9.
Error: /tmp/pgaccwNibc1HHjFf1.gpu (16, 0): parse redefinition of global '@_o_param_21'
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (modB.F90: 1)
PGF90/x86-64 Linux 19.10-0: compilation aborted

If you remove one of the elements or concatenate the files, the compile error (‘parse redefinition of global’) disappears.
This looks like a compiler bug to me.

Cheers,
John

Hi John,

Agreed, that it was most likely a device code generation issue. While I don’t see any similar reports, it does appear to have been fixed in 20.1.

% pgfortran -c modA.f90 modB.f90 -acc -V19.10
modA.f90:
modB.f90:
nvvmCompileProgram error: 9.
Error: /tmp/pgacc9J8e3dgrQlcX.gpu (16, 0): parse redefinition of global '@_o_param_21'
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (modB.f90: 1)
PGF90/x86-64 Linux 19.10-0: compilation aborted
% pgfortran -c modA.f90 modB.f90 -acc -V20.1
modA.f90:
modB.f90:

If you can, consider applying for the NVIDIA HPC SDK 20.5 early access release which includes the PGI re-branded NVIDIA HPC compilers. (The final PGI branded release was 20.4).

The SDK is free, but does require registration.

Best Regards,
Mat