Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Bug in ATOMIC_DEFINE (and most likely, other coarray procedures with a STAT specifier).

OP1
New Contributor III
574 Views

I believe that the behavior of the code shown below is incorrect.

Omitting the coindex for I is a syntactic shortcut for I[THIS_IMAGE()] and should be valid: The fortran standard says "Except in contexts where coindexed objects are disallowed, accessing a coarray on its own image by using a set of cosubscripts that specify that image has the same effect as accessing it without cosubscripts."

The code was compiled with IFX2025.1.0.

There may be other procedures impacted by this bug.

PROGRAM P
USE ISO_FORTRAN_ENV, ONLY : ATOMIC_INT_KIND
IMPLICIT NONE

INTEGER(KIND = ATOMIC_INT_KIND) :: I[*]
INTEGER :: STAT, VAL

STAT = -1
IF (THIS_IMAGE() == 1 ) THEN
    CALL ATOMIC_DEFINE(I, 100, STAT = STAT)
    WRITE(*, *) THIS_IMAGE(), I, STAT  ! STAT should be 0 here...
    CALL ATOMIC_DEFINE(I[1], 100, STAT = STAT)
    WRITE(*, *) THIS_IMAGE(), I, STAT  ! STAT is 0, as expected...
END IF

END PROGRAM P

 

1 Reply
taehunkim
Employee
452 Views

Hi,

We found an error and started triaging it with development team.

Thanks.

0 Kudos
Reply