- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Minimal reproducer for an Intel oneAPI Fortran (ifx) bug observed in DAMASK (https://github.com/eisenforschung/DAMASK). In discretization_grid.f90 the line
materialAt_global = materialAt_global + 1corrupted the material-ID array when compiled with oneAPI, while the array-section form materialAt_global(:) = materialAt_global(:) + 1 worked.
Pattern
- A BIND(C) subroutine declared as integer(C_INT), allocatable, intent(out) :: data(:) is called from Fortran.
- C allocates the array via CFI_allocate and fills it (fill.c).
- Fortran performs a whole-array assignment to the returned allocatable: a = a + 1.
- The whole unit is compiled with -fiopenmp.
With -fiopenmp, values in the LHS array are silently corrupted for arrays above a certain size (seen from ~4000 elements up; the failure is not monotonic in size — n=8000 passed in one run while n=4000 failed). Elements are overwritten with garbage. Without -fiopenmp, or with the array-section form, the result is correct.
Which (:) matters
Only the combination where both sides are whole-array triggers the bug; (:) on either side alone is sufficient to avoid it:
Form mismatches at n=29760
| a = a + 1 (both whole) | 29712 BROKEN |
| a = a(:) + 1 (LHS whole) | 0 OK |
| a(:) = a + 1 (RHS whole) | 0 OK |
| a(:) = a(:) + 1 (both sect) | 0 OK |
Reproduce
source /path/to/oneapi/setvars.sh make run # BROKEN: whole-array assignment with -fiopenmp make run-workaround # OK: array-section assignment make run-noopenmp # OK: whole-array assignment without -fiopenmp make run-small # OK: small array (n=1000) make run-variants # LHS/RHS section combination matrix (n=29760)
Environment
- ifx 2026.1.0 (20260617), icx 2026.1.0 (20260617)
- oneAPI HPC toolkit 2026.1, Linux x86_64
- Trigger flag: -fiopenmp (any -O level reproduces)
Link Copied
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page