Mikael Morin wrote:
On Saturday 16 July 2011 17:25:36 Tobias Burnus wrote:
integer, save :: A[4:6, 7:*]
is a scalar variable on each image, but it has a coarank of 2 with
lcobound(A) == [4, 7] and ucobound(A, dim=1) == 7.
ucobound(A, dim=1) == 6 ? Otherwise I'm even more confused.
Sorry for the typo. It's indeed 6.
Ah, OK; that's where I was misunderstanding coarrays. I was thinking that a
(possibly out of date) copy of remote images was available locally, like a
normal array; and with any network exchanges happening during the SYNC* calls
only. In fact network traffic happens anywhere there are square brackets, and
SYNC*
are mere iddle waits, right?
In terms of the Fortran standard: Yes. In terms of the implementation:
It depends. For the front end: It simply requests to receive (or send)
remote data when it sees a "[...]" - for pushing data to an remote
image, it might even be asynchrnous.
However, the current plan for libcaf_mpi is that one has two-sided
communication; the image which wants to have the content of a remote
image sends a request - and waits for the answer while continuing to
process incoming requests. Thus, if the image is unlucky, it has to wait
until the other image hits a SYNC and can then answer requests. If it is
lucky, the other image also has some remove access and can directly
process the request.
Via a helper process, the answer could be provided faster - or via
one-sided communication - or in case of a shared memory implementation.
While it seems to work well, we would probably have gained some clarity by
using a separate struct for coarray references.
For example with the current scheme, array[1,2] has type ARRAY_FULL, but some
dimen_type are of type DIMEN_ELEMENT. Odd.
Presumably. The problem is that codimensions act on one hand like normal
dimensions but on the other hand they are different. When declaring
them, "rank + corank <= 15", adding them as extra dimension is also
logical etc. On the other hand, when referencing a local coarray, one
has no brackets and if there is a bracket, one can only give an element
(single coarray) and not a range or vector.
Thanks for all the clarifications. Patch is OK (I guess).
Thanks for the review!
Tobias