Observed issues › fresh/cce-common-block-name-in-map-rejected
ftn: a common block name in a map clause is rejected (ftn-534)
Legality: independently confirmed. 2 independent readings find the program legal and the result required. How this is checked
Affected variants
| Compiler | MI300A 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.0 | correct | correct | correct | correct | correct | n/a | n/a |
| CCE 19.0.0 | not supported | not supported | not supported | unknown not run | unknown not run | n/a | n/a |
| CCE 20.0.2 | not supported | not supported | not supported | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.3 | not supported | not supported | not supported | unknown not run | unknown not run | n/a | n/a |
| CCE 21.0.4 | not supported | not supported | not supported | unknown not run | unknown not run | n/a | n/a |
| NVHPC 25.11 | n/a | n/a | n/a | n/a | n/a | fails another way | fails another way |
| NVHPC 26.9 | n/a | n/a | n/a | n/a | n/a | fails another way | fails another way |
| GCC 16.2.0 | fails another way | fails another way | fails another way | fails another way | fails another way | fails another way | n/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
| Result | Compiler and GPU | Message |
|---|---|---|
| not supported | CCE 19.0.0, MI300A unified CCE 19.0.0, MI300A copy CCE 19.0.0, MI250X | showWarning:
Headers and libraries from cray-libsci/25.03.0 will be ignored because depends on PE_MPICH which is unavailable..
!$omp target map(to: /mycommon/) map(from: r)
^
ftn-534 ftn: ERROR MAIN, File = cce-common-block-name-in-map-rejected.f90, Line = 7, Column = 26
Common block "MYCOMMON" must not be specified on the MAP clause on directive !$OMP TARGET.
Cray Fortran : 15 source lines
Cray Fortran : 1 errors, 0 warnings, 0 other messages, 0 ansi |
| not supported | CCE 20.0.2, MI300A unified CCE 20.0.2, MI300A copy CCE 20.0.2, MI250X | showWarning:
Headers and libraries from cray-libsci/25.09.0 will be ignored because depends on PE_MPICH which is unavailable..
!$omp target map(to: /mycommon/) map(from: r)
^
ftn-534 ftn: ERROR MAIN, File = cce-common-block-name-in-map-rejected.f90, Line = 7, Column = 26
Common block "MYCOMMON" must not be specified on the MAP clause on directive !$OMP TARGET.
Cray Fortran : 15 source lines
Cray Fortran : 1 errors, 0 warnings, 0 other messages, 0 ansi |
| not supported | CCE 21.0.3, MI300A unified CCE 21.0.3, MI300A copy CCE 21.0.3, MI250X CCE 21.0.4, MI300A unified CCE 21.0.4, MI300A copy CCE 21.0.4, MI250X | showWarning:
Headers and libraries from cray-libsci/26.03.0 will be ignored because depends on PE_MPICH which is unavailable..
!$omp target map(to: /mycommon/) map(from: r)
^
ftn-534 ftn: ERROR MAIN, File = cce-common-block-name-in-map-rejected.f90, Line = 7, Column = 26
Common block "MYCOMMON" must not be specified on the MAP clause on directive !$OMP TARGET.
Cray Fortran : 15 source lines
Cray Fortran : 1 errors, 0 warnings, 0 other messages, 0 ansi |
| fails another way | NVHPC 25.11, A100 separate | showPresent table dump for device[1]: NVIDIA Tesla GPU 0, compute capability 8.0, threadid=1 Hint: specify 0x800 bit in NV_ACC_DEBUG for verbose info. host:0x411fc0 device:0x7283452fa000 size:8 presentcount:0+1 line:7 name:a(:) allocated block device:0x7283452fa000 size:512 thread:1 Present table errors: /mycommon/ lives at 0x411fc0 size 16 partially present in host:0x411fc0 device:0x7283452fa000 size:8 presentcount:0+1 line:7 name:a(:) file:<dir>/cce-common-block-name-in-map-rejected.f90 FATAL ERROR: variable in data clause is partially present on the device: name=/mycommon/ |
| fails another way | NVHPC 25.11, A100 managed | showPresent table dump for device[1]: NVIDIA Tesla GPU 0, compute capability 8.0, threadid=1 Hint: specify 0x800 bit in NV_ACC_DEBUG for verbose info. host:0x412fc0 device:0x7d7b3d2fa000 size:8 presentcount:0+1 line:7 name:a(:) allocated block device:0x7d7b3d2fa000 size:512 thread:1 Present table errors: /mycommon/ lives at 0x412fc0 size 16 partially present in host:0x412fc0 device:0x7d7b3d2fa000 size:8 presentcount:0+1 line:7 name:a(:) file:<dir>/cce-common-block-name-in-map-rejected.f90 FATAL ERROR: variable in data clause is partially present on the device: name=/mycommon/ |
| fails another way | NVHPC 26.9, A100 separate | showPresent table dump for device[1]: NVIDIA Tesla GPU 0, compute capability 8.0, threadid=1 Hint: specify 0x800 bit in NV_ACC_DEBUG for verbose info. host:0x4189c0 device:0x72b1012fa000 size:8 presentcount:0+1 line:7 name:a(:) allocated block device:0x72b1012fa000 size:512 thread:1 Present table errors: /mycommon/ lives at 0x4189c0 size 16 partially present in host:0x4189c0 device:0x72b1012fa000 size:8 presentcount:0+1 line:7 name:a(:) file:<dir>/cce-common-block-name-in-map-rejected.f90 FATAL ERROR: variable in data clause is partially present on the device: name=/mycommon/ |
| fails another way | NVHPC 26.9, A100 managed | showPresent table dump for device[1]: NVIDIA Tesla GPU 0, compute capability 8.0, threadid=1 Hint: specify 0x800 bit in NV_ACC_DEBUG for verbose info. host:0x4199c0 device:0x7cc5dd2fa000 size:8 presentcount:0+1 line:7 name:a(:) allocated block device:0x7cc5dd2fa000 size:512 thread:1 Present table errors: /mycommon/ lives at 0x4199c0 size 16 partially present in host:0x4199c0 device:0x7cc5dd2fa000 size:8 presentcount:0+1 line:7 name:a(:) file:<dir>/cce-common-block-name-in-map-rejected.f90 FATAL ERROR: variable in data clause is partially present on the device: name=/mycommon/ |
| fails another way | GCC 16.2.0, MI300A unified GCC 16.2.0, MI300A copy GCC 16.2.0, MI250X GCC 16.2.0, MI300X GCC 16.2.0, MI350X GCC 16.2.0, A100 separate | showcce-common-block-name-in-map-rejected.f90:7:25:
7 | !$omp target map(to: /mycommon/) map(from: r)
| 1
Error: Syntax error in OpenMP variable list at (1)
cce-common-block-name-in-map-rejected.f90:9:19:
9 | !$omp end target
| 1
Error: Unexpected !$OMP END TARGET statement at (1) |
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
AFAR 24.3.0, MI300A unified (runs correctly)
$AFAR/bin/amdflang -fopenmp --offload-arch=gfx942 -O2 repro.f90 -o repro HSA_XNACK=1 OMP_TARGET_OFFLOAD=mandatory ./repro
Program (42 lines)
! # Finding (from the data/bench/fresh draft fresh-097): CCE rejects a common block name in a
! map clause
!
! - source: data/bench/fresh/fresh-097.f90 (GCC Bugzilla 115577 with the reader of GCC PR 115559): a
! common block in declare target link, mapped by name on target enter data. CCE rejects the map
! clause with or without declare target, with or without a map type, on target enter data and on
! target; this reproducer is the shortest form
! - compilers: CCE 19.0.0, 20.0.2 and 21.0.3 ftn, -fopenmp -O2
! - expected: compiles and prints wild-check: pass. A Fortran list item may be "a common block name
! (enclosed in slashes)" (OpenMP 5.2 §3.2.1 p.61 l.6), and "When a named common block appears in
! an OpenMP argument list, it has the same meaning and restrictions as if every explicit member of
! the common block appeared in the list" (l.11-13); the map clause takes a locator list (§5.8.3
! p.150), whose items are variable list items (§3.2.1 p.61 l.7-8). OpenMP 5.0, which HPE claims in
! full ("CCE supports full OpenMP 5.0", intro_openmp(7)), already says it: "A list item is a
! variable, array section or common block name (enclosed in slashes) ... a common block name
! specified in a data-sharing attribute, a data copying or a data-mapping attribute clause must be
! declared to be a common block in the same scoping unit" (5.0 §2.1 p.39 l.11-20)
! - actual: ftn-534: 'Common block "MYCOMMON" must not be specified on the MAP clause on directive
! !$OMP TARGET.' (and "... TARGET ENTER DATA." for the draft), every release, both memory modes
! - control (same compiler): the members named instead, map(to: A, B, C), compile and print
! wild-check: pass (data/reports/fresh-drafts/d097-target-members.f90, d097-members.f90)
! - other families: AFAR compiles and prints wild-check: pass (MI300A HSA_XNACK 1 and 0; MI250X).
! NVHPC 25.11 rejects the draft's declare target link(/mycommon/) as a syntax error and 26.9 says
! LINK is not implemented
! - legality: legal by reading (5.0 and 5.2 text above; the common block is declared in the scoping
! unit of the clause)
! - evidence: results/fresh-drafts/tuo-p1.jsonl, tuo2-q4.jsonl, tuo3-r*-c.jsonl, tioga/tioga-d.jsonl (review)
program main
integer :: A(2), C, r
real :: B
common /mycommon/ A, B, C
A = [1, 2]; B = 2.0; C = 7
r = 0
!$omp target map(to: /mycommon/) map(from: r)
if (A(1) == 1 .and. A(2) == 2 .and. B == 2.0 .and. C == 7) r = 1
!$omp end target
if (r == 1) then
print *, 'wild-check: pass'
else
print *, 'wild-check: fail'
end if
end program main
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..
!$omp target map(to: /mycommon/) map(from: r)
^
ftn-534 ftn: ERROR MAIN, File = cce-common-block-name-in-map-rejected.f90, Line = 7, Column = 26
Common block "MYCOMMON" must not be specified on the MAP clause on directive !$OMP TARGET.
Cray Fortran : 15 source lines
Cray Fortran : 1 errors, 0 warnings, 0 other messages, 0 ansiWhat the specification requires
The specification text this program relies on and the compiler is expected to support.
OpenMP 5.2 §3.2.1 p.61 l.6
a common block name (enclosed in slashes)
OpenMP 5.2 §5.8.3 p.150
OpenMP 5.2 §3.2.1 p.61 l.7-8
OpenMP 5.0 §2.1 p.39 l.11-20
A list item is a variable, array section or common block name (enclosed in slashes) ... a common block name specified in a data-sharing attribute, a data copying or a data-mapping attribute clause must be declared to be a common block in the same scoping unit
Evidence
Same compiler, one change
- the members named instead: map(to: A, B, C): AFAR 24.3.0: correct; CCE 19.0.0: correct; CCE 20.0.2: correct; CCE 21.0.3: correct; CCE 21.0.4: correct
Control program
program main integer :: A(2), C, r real :: B common /mycommon/ A, B, C A = [1, 2]; B = 2.0; C = 7 r = 0 !$omp target map(to: A, B, C) map(from: r) if (A(1) == 1 .and. A(2) == 2 .and. B == 2.0 .and. C == 7) r = 1 !$omp end target if (r == 1) then print *, 'wild-check: pass' else print *, 'wild-check: fail' end if end program main
Other compilers run it correctly
AFAR 24.3.0