This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] Support allocatable *scalar* coarrays


On 07/16/2011 06:43 PM, Mikael Morin wrote:
Well, the current implementation supports effectively only a single
image - for -fcoarray=single on purpose and for -fcoarray=lib because it
has not yet been implemented.

Later, one has to add some function call for "scalar[<image_numer>]"
while "scalar" itself is the local variable and can be handled as above.
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?

I am no expert, but I'll try to answer: Yes.



Yes, network traffic happens whenever there are square brackets and no copies are stored locally. However, you have no guarantee of how far ahead other images are. For example:


real :: foo[:]

foo = this_image()

if (this_image() == 1) then
    foo = foo + foo[2]
end if
if (this_image() == 2) then
    foo = foo + foo[1]
end if


This program could do all sorts of crazy things. As you said, the SYNC is a idle wait, just to make processes wait for each other. The following program is predictable:


real :: foo[:]

foo = this_image()

sync all

if (this_image() == 1) then
    foo = foo + foo[2]
end if

sync all

if (this_image() == 2) then
    foo = foo + foo[1]
end if


Cheers, Daniel. -- I'm not overweight, I'm undertall.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]