Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Behavior of SIZE and ALLOCATED across coarray images

$
0
0

The program below shows a different behavior for SIZE and ALLOCATED across coarray images. Naively, I would assume that both work (SIZE does, ALLOCATED does not) if the only thing they do is read the array descriptor data. Is there an explanation for this?

PROGRAM MAIN
IMPLICIT NONE
TYPE TT
    INTEGER,ALLOCATABLE :: VALUES(:)
END TYPE TT
TYPE(TT) :: T[*]
INTEGER :: I
SYNC ALL
IF (THIS_IMAGE()>1) THEN
    ALLOCATE(T%VALUES(THIS_IMAGE()))
END IF
SYNC ALL
IF (THIS_IMAGE()==1) THEN
    DO I=2,NUM_IMAGES()
        WRITE(*,*) ALLOCATED(T[I]%VALUES)
        WRITE(*,*) SIZE(T[I]%VALUES)
    END DO
END IF
END PROGRAM MAIN

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>