OffTarget

Observed issues › oop/cce-pdt-default-mapper-rejected

Appears not to supportRefused at compile time · Fortran · OpenMP · Open

a derived type with a length type parameter cannot be mapped

Legality: contested. An independent adjudicating reading finds the result not required: The program is valid Fortran 2003 and breaks no OpenMP restriction. The error is on the module's parameterized type definition, a base-language feature. The specification does not require an implementation to support a construct its base-language implementation lacks, so the refusal violates no requirement. How this is checked

Mapping a variable of a parameterized derived type with a length type parameter (type(lv(16)) :: x; map(tofrom: x)) is rejected by CCE 19, 20 and 21 with ftn-1853 'Missing type parameter value' in the compiler's generated default mapper. The same program with a fixed size in place of the length parameter works.

Affected variants

CompilerMI300A gfx942
unified memory (XNACK 1)
MI300A gfx942
copy (XNACK 0)
MI250X gfx90a
copy (XNACK 0)
MI300X gfx942
copy (XNACK 0)
MI350X gfx950
copy (XNACK 0)
A100 sm_80
separate memory
A100 sm_80
managed memory
AFAR 24.3.0fails another wayfails another wayunknown
not run
fails another wayfails another wayn/an/a
CCE 19.0.0not supportednot supportedunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 20.0.2not supportednot supportedunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.3not supportednot supportedunknown
not run
unknown
not run
unknown
not run
n/an/a
CCE 21.0.4not supportednot supportedunknown
not run
unknown
not run
unknown
not run
n/an/a
NVHPC 25.11n/an/an/an/an/afails another waycorrect
NVHPC 26.9n/an/an/an/an/afails another waycorrect
GCC 16.2.0correctfails another wayfails another wayfails another wayfails another wayfails another wayn/a

"behaves incorrectly" / "not supported": this issue, confirmed in up to four environments (another build directory, another node, a repeat). "fails another way": a different failure, not counted as this issue. "unknown": not run there, or the runs disagree.

Messages

ResultCompiler and GPUMessage
not supportedCCE 19.0.0, MI300A unified
CCE 19.0.0, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
module oop_m
       ^     
ftn-855 ftn: ERROR OOP_M, File = site-oop--cce-pdt-default-mapper-rejected.f90, Line = 21, Column = 8 
  The compiler has detected errors in module "OOP_M".  No module information file will be created for this module.
  type lv(m)
          ^  
not supportedCCE 20.0.2, MI300A unified
CCE 20.0.2, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
module oop_m
       ^     
ftn-855 ftn: ERROR OOP_M, File = site-oop--cce-pdt-default-mapper-rejected.f90, Line = 21, Column = 8 
  The compiler has detected errors in module "OOP_M".  No module information file will be created for this module.
  type lv(m)
          ^  
not supportedCCE 21.0.3, MI300A unified
CCE 21.0.3, MI300A copy
CCE 21.0.4, MI300A unified
CCE 21.0.4, MI300A copy
show
Warning:
 Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
module oop_m
       ^     
ftn-855 ftn: ERROR OOP_M, File = site-oop--cce-pdt-default-mapper-rejected.f90, Line = 21, Column = 8 
  The compiler has detected errors in module "OOP_M".  No module information file will be created for this module.
  type lv(m)
          ^  
fails another wayAFAR 24.3.0, MI300A unified
AFAR 24.3.0, MI300A copy
show
error: loc("site-oop--cce-pdt-default-mapper-rejected.f90":24:8): /__w/TheRock/TheRock/compiler/amd-llvm/flang/lib/Lower/ConvertType.cpp:470: not yet implemented: parameterized derived types
LLVM ERROR: aborting
fails another wayAFAR 24.3.0, MI300X
AFAR 24.3.0, MI350X
show
error: loc("site-oop--cce-pdt-default-mapper-rejected.f90":29:8): /__w/TheRock/TheRock/compiler/amd-llvm/flang/lib/Lower/ConvertType.cpp:470: not yet implemented: parameterized derived types
LLVM ERROR: aborting
fails another wayNVHPC 25.11, A100 separate
NVHPC 26.9, A100 separate
show
Failing in Thread:1
Accelerator Fatal Error: call to cuMemcpyDtoHAsync returned error 700 (CUDA_ERROR_ILLEGAL_ADDRESS): Illegal address during kernel execution
 File: <dir>
 Function: oop:31
 Line: 52
fails another wayGCC 16.2.0, MI300A copy
show
Memory access fault by GPU node-5 (Agent handle: 0x590c10) on address 0x53d000. Reason: Unknown.
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0  0x15555469662f in ???
#1  0x1555546965af in ???
#2  0x155554669ee4 in ???
#3  0x1555540d6bfe in ???
#4  0x1555540d4288 in ???
fails another wayGCC 16.2.0, MI250X
show
Memory access fault by GPU node-7 (Agent handle: 0x7830d0) on address 0x737000. Reason: Unknown.
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0  0x15555469662f in ???
#1  0x1555546965af in ???
#2  0x155554669ee4 in ???
#3  0x1555540d6bfe in ???
#4  0x1555540d4288 in ???
fails another wayGCC 16.2.0, MI300X
show
Memory access fault by GPU node-1 (Agent handle: 0xa98f50) on address 0xa79000. Reason: Unknown.
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0  0x7f78a2e3ebef in ???
#1  0x7f78a2e8bedc in ???
#2  0x7f78a2e3eb45 in ???
#3  0x7f78a2e28832 in ???
#4  0x7f78a2a89a5e in ???
fails another wayGCC 16.2.0, MI350X
show
Memory access fault by GPU node-1 (Agent handle: 0x2421610) on address 0x2400000. Reason: Unknown.
Program received signal SIGABRT: Process abort signal.
Backtrace for this error:
#0  0x7f901be3fc2f in ???
#1  0x7f901be8d02c in ???
#2  0x7f901be3fb85 in ???
#3  0x7f901be29872 in ???
#4  0x7f901ba89a5e in ???
fails another wayGCC 16.2.0, A100 separate
show
libgomp: cuCtxSynchronize error: an illegal memory access was encountered
libgomp: cuModuleGetFunction (__do_global_dtors__entry) error: an illegal memory access was encountered
libgomp: cuMemFree_v2 error: an illegal memory access was encountered
libgomp: device finalization failed

Reproduce

CCE 19.0.0, MI300A unified

module load cce/19.0.0 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

CCE 20.0.2, MI300A unified

module load cce/20.0.2 craype-accel-amd-gfx942 rocm/6.4.3
module unload cray-mpich
ftn -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

CCE 21.0.3, MI300A unified

module load cce/21.0.3 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

CCE 21.0.4, MI300A unified

module load cce/21.0.4 craype-accel-amd-gfx942 rocm/7.2.0
module unload cray-mpich
ftn -fopenmp -O2 repro.f90 -o repro
HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro

NVHPC 25.11, A100 managed (runs correctly)

export LD_LIBRARY_PATH=$NVHPC_25_11/compilers/lib
nvfortran -mp=gpu -gpu=cc80 -gpu=mem:managed -O2 repro.f90 -o repro
OMP_TARGET_OFFLOAD=mandatory ./repro
Program (64 lines)
! # Finding (fortran-oop): a derived type with a length type parameter in a map clause is rejected (ftn-1853 in the default mapper)
!
! - toolchains and modes that fail: cce19 (CCE 19.0.0: copy, unified), cce20 (CCE 20.0.2: copy, unified), cce21 (CCE 21.0.3: copy,
!   unified), cce21_4 (CCE 21.0.4: copy, unified); -O2
! - build: ftn -fopenmp -O2 (module load cce/<v> craype-accel-amd-gfx942 rocm/<r>; OpenACC: ftn -h acc)
! - failure: rejected (diagnostic); OMP_TARGET_OFFLOAD=mandatory
! - observed: `ftn-1853 ftn: ERROR default$mapper$lv$oop_m_ ... Missing type parameter value for type` at the type definition,
!   every CCE release: the compiler-generated default mapper of the type lacks the length parameter
! - expected: compiles; `r1= 16 r2= 1496`
! - rule: 5.2 §5.8.3 p.155 l.5-7 (the new list item has the type parameters of the original); a parameterized derived type is
!   mappable (5.2 §1.2.6 p.18-19)
! - same-compiler control: the same program with the type's length parameter replaced by a fixed size
!   (controls/pdt-len-unparameterized.f90, one change): correct (check=pass) on CCE 19, 20, 21.0.3 and 21.0.4 in both modes in the
!   stored run and the gate's four environments a-d, (c) on another node or GPU
!   (results/oop/probe/ctl2.*.pdt-len-unparameterized.*.jsonl); a kind type parameter alone (controls/pdt-kind.f90) is correct too
!   (results/oop/main/rows.part*.jsonl)
! - other families: AFAR: 'not yet implemented' for length parameters (afar-pdt-length-parameter-not-implemented.f90); GCC 16.2
!   compiles them and aborts (gcc-pdt-length-parameter-abort.f90)
! - gate and confirmer: 32 cells, 32 confirmed in the gate's four environments (a-d; results/oop/main/gate_reruns*.jsonl);
!   confirmer (results/oop/main/confirm.jsonl): compiler_bug (R11-compile-rejection) 16, unsupported_everywhere
!   (R12-every-family-rejects) 16
! - programs (4): oop-pdt-len, oop-pdt-deferred, oop-pdt-array, oop-pdt-kindlen (offload/engine/oop_gen.py; this file is the first
!   one)
! - legality: for the cce cells: the rules (offload.engine.rules, with the fortran-oop restrictions) and AFAR's flang front end
!   (-fsyntax-only) and NVHPC 26.9 nvfortran (compile only) (tools/campaigns/oop.py legality, results/oop/main/legality.json)
module oop_m
  implicit none
  integer, parameter :: n = 64
  type lv(m)
  integer, len :: m
  integer :: a(m)
  end type lv
end module oop_m

program oop
  use omp_lib
  use oop_m
  implicit none
  integer :: host_flag
  logical :: ok
  integer :: r1, r2
  type(lv(16)) :: x
  integer :: i
  host_flag = 1
  !$omp target map(from: host_flag)
  host_flag = merge(1, 0, omp_is_initial_device())
  !$omp end target
  do i = 1, 16
    x%a(i) = i
  end do
  !$omp target map(tofrom: x) map(from: r1)
  r1 = x%m
  do i = 1, x%m
    x%a(i) = x%a(i) * x%a(i)
  end do
  !$omp end target
  r2 = sum(x%a)
  ok = .true.
  ok = ok .and. (r1 == 16)
  ok = ok .and. (r2 == 1496)
  print '(a,i0)', 'r1= ', r1
  print '(a,i0)', 'r2= ', r2
  print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', merge('pass', 'fail', ok)
end program oop

Source in the repository

Something to add? Dispute its legality · Report it fixed in a newer release · Report a mistake on this page

Expected and observed

Observed where it behaves incorrectly

Warning:
 Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
module oop_m
       ^     
ftn-855 ftn: ERROR OOP_M, File = site-oop--cce-pdt-default-mapper-rejected.f90, Line = 21, Column = 8 
  The compiler has detected errors in module "OOP_M".  No module information file will be created for this module.
  type lv(m)
          ^  

What the specification requires

The specification text this program relies on and the compiler is expected to support.

OpenMP 5.2 §5.8.3 p.155 l.5-7

OpenMP 5.2 §1.2.6 p.18-19

Evidence

Same compiler, one change

  • the same program; the type has no length parameter (a fixed size instead): not run yet
    Control program
    ! control for oop-pdt-len: the same program; one change: the type has no length parameter (a component m = 16 and a
    ! fixed a(16) in its place; type(lv) :: x for type(lv(16)) :: x), so x%m reads the component
    ! fortran-oop pdt/len (OpenMP 5.2, free-form Fortran):
    ! a derived type with a length type parameter (constant), its value read on the device
    ! spec: OpenMP 5.2 §5.8.3 p.151-155 (map clause); OpenMP 5.2 §5.8.3 p.155 l.5-7
    ! legality: defined
    ! expected (computed by compliance/oop_gen.py): r1= 16, r2= 1496
    module oop_m
      implicit none
      integer, parameter :: n = 64
      type lv
      integer :: m = 16
      integer :: a(16)
      end type lv
    end module oop_m
    
    program oop
      use omp_lib
      use oop_m
      implicit none
      integer :: host_flag
      logical :: ok
      integer :: r1, r2
      type(lv) :: x
      integer :: i
      host_flag = 1
      !$omp target map(from: host_flag)
      host_flag = merge(1, 0, omp_is_initial_device())
      !$omp end target
      do i = 1, 16
        x%a(i) = i
      end do
      !$omp target map(tofrom: x) map(from: r1)
      r1 = x%m
      do i = 1, x%m
        x%a(i) = x%a(i) * x%a(i)
      end do
      !$omp end target
      r2 = sum(x%a)
      ok = .true.
      ok = ok .and. (r1 == 16)
      ok = ok .and. (r2 == 1496)
      print '(a,i0)', 'r1= ', r1
      print '(a,i0)', 'r2= ', r2
      print '(a,i0,a,a)', 'RESULT ran_on_host=', host_flag, ' check=', merge('pass', 'fail', ok)
    end program oop
    

Other compilers run it correctly

NVHPC 25.11, NVHPC 26.9, GCC 16.2.0