Re: Co-Array Fortran



gary.l.scott@xxxxxxxx wrote:
... I'm just not sure there aren't problems where it would be
critical to know whether the referenced array is a local one or a
remote one. It seems like there needs to be an inquiry routine to
tell whether it is local or remote and maybe in rare cases, copy local
for performance reasons or some other reason.

Well, included are two very critical intrinsic functions - NUM_IMAGES ()
and THIS_IMAGE (). As with MPIs MPI_COMM_SIZE () and MPI_COMM_RANK (),
just about every program will use them at least once.

If you really wanted to, you could say something like:

if (THIS_IMAGE () == np) then
a(i) = b(i) + c(i)
else
a(i) = b(i) + c(i)[np]
end if

I would think that if communications between the images was more
expensive than a simple memory reference, a decent compiler would
do the above for you.

Anyway, it isn't that
important that I understand since it's unlikely I'll ever use it.

You never know... There are a lot of folks who use MPI these days.
Coarrays should appeal to anyone who hates inserting all those
message passing calls in their programs.

W.

.