(j3.2006) DEALLOCATE and image control

Bill Long longb
Sun Apr 6 11:31:36 EDT 2014

On Apr 6, 2014, at 1:18 AM, Malcolm Cohen <malcolm at nag-j.co.jp> wrote:

> I wrote:
>> Well the processor had better not do that then.  For that matter
>>  DEALLOCATE(coarray1,coarray2)
>> had better not deadlock (no allocatable components in sight here).
> Van Snyder suggested:
>> Perhaps it ought to be stated that all images shall deallocate
>> <allocate-object>s in the same order, and all allocatable components in
>> the same order.
> That seems unnecessary and potentially harmful.
> The standard states
>  "When a DEALLOCATE statement is executed for which an allocate-object is a 
> coarray, there is an implicit synchronization of all images."
> That is not "there is a separate implicit sync of all images for each 
> coarray object being deallocated", that is there is ONE implicit 
> synchronisation for the whole DEALLOCATE statement.  Therefore order of 
> deallocation of the items simply does not come into question.

Absolutely.   The reason for the sync is to ensure that, outside the execution of the deallocate statement, the identified objects are either allocated on all images (before statement) or not allocated on all images (after).  The intent is to avoid a situation where a coarray exists on some images (of the current team post TS) and not others.   The actual deallocation process is almost certainly an entirely local operation.


Bill Long                                                                       longb at cray.com
Fortran Technical Suport  &                                  voice:  651-605-9024
Bioinformatics Software Development                     fax:  651-605-9142
Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN 55101

More information about the J3 mailing list