(j3.2006) Does synchronization occur?
Malcolm Cohen
malcolm
Tue Oct 7 20:27:30 EDT 2014
This one seems ok at least. Though the standard seems to have extra unnecessary
words to confuse the unwary.
Is X%C%A not a coarray?
Is it not being deallocated?
Then by 6.7.3.2p12
"There is [also] an implicit synchronization of all images in association
with the deallocation of a coarray ... caused by execution of a RETURN or END
statement ..."
Apart from the unnecessary "or coarray subcomponent" (why on earth is this
here?), one might also take issue with the words "in association with"! What's
that intended to mean?
In fact why is the entire p12 not simply
"When execution or a RETURN or END statement or termination of a BLOCK
construct causes deallocation of a coarray, an implicit synchronization of all
images occurs."
???
I agree with Van that p11 seems confusing; it looks like
DEALLOCATE(X%C)
would not cause a synchronisation because X%C is not a coarray, even though
X%C%A which is a coarray will also get deallocated (assuming that it was
allocated in the first place). Luckily p10 saves us here, but is easy to
overlook.
We could consider replacing the first sentence of p11 to be something along the
lines of
"Execution of a statement that causes deallocation of a coarray causes an
implicit synchronization of all images."
(the rest of p11 looks basically ok), and deleting p12. That would simplify the
description and remove the reliance on p10 to get the semantics right.
Cheers,
-----Original Message-----
From: Van Snyder
Date: ?? 26?10?8? 8:09
To: j3
Subject: (j3.2006) Does synchronization occur?
Given
type :: T1
real, allocatable :: A(:)[*]
end type T1
type :: T2
type(t1), allocatable :: C
end type T2
contains
subroutine S
type(t2), allocatable :: X
... assume X%C%A gets allocated
end subroutine S
Does deallocation of X%C%A cause synchronization?
6.7.3.2p12 says there's synchronization when a subcomponent gets
deallocated by execution of an END statement, but X%C%A is not a
subcomponent because X%C is allocatable.
Does an argument by induction save us?
1. X gets deallocated by execution of the END statement.
2. X%C gets deallocated because X gets deallocated.
3. X%C%A gets deallocated because X%C gets deallocated.
6.7.3.2p11-12 only address the case of executing a deallocate statement
for which an <allocate-object> is a coarray. 6.7.3.2p6-7 don't mention
coarrays. Does 6.7.3.2p10 save us?
This would be a lot clearer if 6.7.3.2p11-12 simply said "deallocation"
instead of mentioning only two of at least five reasons something might
be deallocated.
_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org
http://mailman.j3-fortran.org/mailman/listinfo/j3
________________________________________________________________________
This e-mail has been scanned for all viruses by Star.
________________________________________________________________________
--
................................Malcolm Cohen, Nihon NAG, Tokyo.
More information about the J3
mailing list