Coarray bug?

Coarray bug?

The following example may just reflect my poor understanding of how coarrays work... or it could be a bug. Compiled with the IVF 15.0 update 0, using VS2013 shell... any comments?

PROGRAM TEST
IMPLICIT NONE

TYPE T_A
    INTEGER :: VALUE
END TYPE T_A

TYPE T_B
    TYPE(T_A),ALLOCATABLE :: ARRAY(:)
END TYPE T_B

TYPE(T_B) :: COARRAY[*]

! This section leads to an access violation error.
!IF (THIS_IMAGE()==1) THEN
!    ALLOCATE(COARRAY[1]%ARRAY(10))
!END IF

! This section works.
IF (THIS_IMAGE()==1) THEN
    ALLOCATE(COARRAY%ARRAY(10))
END IF

END PROGRAM TEST

 

4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Best Reply

The commented out allocate statement is not legal fortran - if you are allocating a structure component then the thing that designates the particular parent of the component cannot be coindexed.  But the compiler should diagnose this at compile time (C644).

(If you think about it conceptually - with the [xx] coindexing you are directing the current image to go and do a local allocation on image xx (image xx and the current image happen to be the same here, but the syntax you are using implies that they could be different) of something that isn't itself a coarray (it is a component of a coarray), and that doesn't really make sense - it is remote specification of an executable action.  If you want image xx to do a local allocation, then get image xx to execute an allocate statement on a local object as part of its sequence of execution (which is exactly what you have in the not commented out bit).  Note this situation is different from all images executing a synchronised allocate statement for a coarray proper.)

Thank IanH for your explanation. It seems this compiler check is not implemented yet.

Portrait de Steve Lionel (Intel)

I entered issue DPD200360195 about the missing constraint check.

Steve

Connectez-vous pour laisser un commentaire.