I have a coarray of local size 5 (called AXC) and I am updating the object in the local memory of image #1 in two different ways (primarily to test my understanding ..or otherwise .. of coarrays). Firstly I do an array section update without explicitly referring to the coarray index 1
AXC(2:4) = AXC(1:3)[2]
and subsequently I do an array section update by using the square brackets with co-index 1.
AXC(2:4)[1] = AXC(1:3)[2]
In the latter case the local array in image #1 is updated with unexpected values. Ignoring efficiency issues, shouldn't the snippets above produce the same result when executed in image 1 ? Here's the entire code. I'm using Parallel Studio XE 2017 Update 5 Version 17.0.0053.14.
PROGRAM ArraySectionTest IMPLICIT NONE REAL AXC(5)
連結已複製
I tried your program with 18.0.1 and got the correct (and same) answers in both WRITEs. I know that in the past Intel Fortran's treatment of "same image" coindexed variables wasn't quite right in that they didn't always match the local variables, but maybe that has been fixed.
Many thanks for taking a look. I'll upgrade to v18 to see if it helps.
Steve Lionel (Ret.) wrote:
I tried your program with 18.0.1 and got the correct (and same) answers in both WRITEs. I know that in the past Intel Fortran's treatment of "same image" coindexed variables wasn't quite right in that they didn't always match the local variables, but maybe that has been fixed.
Unfortunately the upgrade to 18.0.1.156 did not address the problem.
I also upgraded the Intel MPI stuff to Intel(R) MPI Library for Windows* OS, Version 2018 Update 1 Build 20171011.
One more observation: if I use the following instead of the array section then I could get [1, 2, 2, 2, 1] as expected.
IF(THIS_IMAGE()==1) THEN
!AXC(2:4)[1] = AXC(1:3)[2]
AXC(2)[1] = AXC(1)[2]
AXC(3)[1] = AXC(2)[2]
AXC(4)[1] = AXC(3)[2]
AA = AXC(1:5)[1]
END IF