- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank IanH for your explanation. It seems this compiler check is not implemented yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I entered issue DPD200360195 about the missing constraint check.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This will be fixed in a release later this year.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page