Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Accsessing data from another image

abhimodak
New Contributor I
704 Views

Hi

I think this is novice-level question in Co-Array usage.

The test program below crashes...What am I missing? If the lines printing the variable OBJ from different imagesare commented out, it works. Thus, the bounds can be accessed and printed but not the values.

Abhi


=========

[fortran]      Program Test
         
         Implicit None
         
         Type Base
            Integer, Allocatable :: M(:)
         End Type Base
         Type(Base) :: OBJ
  • Integer :: myImageNum Integer :: is(1), ie(1) Integer :: i, n myImageNum = THIS_IMAGE() is(1) = myImageNum; ie(1) = myImageNum+1 Allocate(OBJ%M(is(1):ie(1))) SYNC ALL do i=is(1),ie(1) OBJ%M(i) = 10*myImageNum + i*i !print *, THIS_IMAGE(), i, OBJ%M(i) end do SYNC ALL if (myImageNum == 1) then do n=1,NUM_IMAGES() is = LBOUND(OBJ%M); ie = UBOUND(OBJ%M) print *, is(1), ie(1) do i=is(1),ie(1) print *, OBJ%M(i) end do end do end if SYNC ALL DeAllocate(OBJ%M) End Program Test[/fortran]
  • 0 Kudos
    5 Replies
    Steven_L_Intel1
    Employee
    704 Views
    In the compiler release notes section on Coarrays, there is a list of features known to not work. One of them is:

    Coarrays of derived type where the type contains an ultimate component that is ALLOCATABLE or POINTER

    You have coarray OBJ which is of derived type with an ultimate ALLOCATABLE component, and are running into this problem. Some aspects of it may work, others do not.

    While your program doesn't quite do this, another feature listed as not working is:

    Output (WRITE, PRINT, etc.) of an array slice of a coarray referencing another image. A whole array reference, or a single element works.

    This will be resolved in a future version - we apologize for the inconvenience.
    0 Kudos
    abhimodak
    New Contributor I
    704 Views
    Oops. Thanks and my sincere apologies, Steve,for not reading the release notes first. It is very good that IVF is putting in the CoArrays.

    Abhi
    0 Kudos
    abhimodak
    New Contributor I
    704 Views
    Hi

    As per the release notes of update 6 I thought that this will work. However, it does not.

    If I replace the print out inside the do loop to "print *, OBJ%M" i.e whole-array statement it works (as mentioned in the release note". However, as is i.e. referencing an element does not work.

    Also, no matter which way I do the above, the program seems to crash. That is, I get "program has stopped working" dialogue pops up.

    Did I mistakenly assume that this issue was fixed by update 6?

    Abhi
    0 Kudos
    Steven_L_Intel1
    Employee
    704 Views
    I too would have thought this should work. I'll let the developers know.

    I find that the results are unpredictable. In tests I did, sometimes it would work, sometimes I'd get zero values and sometimes the processes would go CPU bound. This was with either the whole array or elements. Escalated as DPD200173725.
    0 Kudos
    Steven_L_Intel1
    Employee
    704 Views
    I am told that this is fixed for an update later this year, probably October.
    0 Kudos
    Reply