It does the expected thing with NAG, at least, and NAG being
picky, I suspect this is OK.
> Note that coarrays
> of a type with ALLOCATABLE or POINTER components are permitted,
> although in general communication performance for these components
> will incur additional latencies and other performance issues due
> to the nonsymmetric nature of such objects.
> I cannot specifically say how an MPI based implementation would
> need to do this, but suspect that for this usage active-target
> RMA (one-sided MPI_Get on arr[...]%xyz%x with an MPI_Fence as
> synchronization) would provide the needed properties. I do not
> understand your reference to a "broadcast" though. Your code has
> ~n/2 Gets on all even images to the respective neighbour.
Sorry, wrong terminology about broadcast. Also, the question
regarding MPI was not really what I was after, some explanation
is in order.
The reason why I was asking is a design issue that we are currently
facing desiging the shared memory coarray implementation for gfortran.
To avoid all sorts of problems, the basic design allocates a large
shared memory segment and then does fork(). All coarrays are then
put into that segment, also all locally allocated allocatables
and pointers (like in the code above).
If code that knows nothing about coarrays allocates or frees
memory, it will (up to now) simply call malloc(), which will
not work. So, we are in discussion how to solve it, preferably
without an ABI change (or replacing malloc() from under