public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Mikael Morin <mikael.morin@sfr.fr>
Cc: fortran@gcc.gnu.org, gcc patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran] Support allocatable *scalar* coarrays
Date: Sat, 16 Jul 2011 22:57:00 -0000	[thread overview]
Message-ID: <4E21C86C.6000906@net-b.de> (raw)
In-Reply-To: <201107161843.39951.mikael.morin@sfr.fr>

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

      parent reply	other threads:[~2011-07-16 17:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 21:16 Tobias Burnus
2011-07-11  7:54 ` Tobias Burnus
2011-07-14  7:38   ` *ping* - " Tobias Burnus
2011-07-16 11:20     ` Tobias Burnus
2011-07-16 14:38   ` Mikael Morin
2011-07-16 15:45     ` Tobias Burnus
2011-07-16 17:05       ` Steve Kargl
2011-07-16 17:07       ` Mikael Morin
2011-07-16 19:59         ` Daniel Carrera
2011-07-16 22:57         ` Tobias Burnus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E21C86C.6000906@net-b.de \
    --to=burnus@net-b.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikael.morin@sfr.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).