(j3.2006) a question on cobounds

Bill Long longb
Mon Jul 27 23:35:14 EDT 2009



Malcolm Cohen wrote:
> 
> Jim Xia wrote:
>>>> subroutine foo (n)
>>>>         integer, intent(in) :: n
>>>>         integer W(n)[*]                           !<-- we made it 
>> clear
>>>> this is not allowed
>>>> *        integer, save :: U(10)[N,*]      !<-- but do we intend to 
>> allow
>>>> this?  I have difficulties in finding constraints/rules that 
>> forbid this*
>>> This is allowed.  The array U has the same size on all images, and the
>>> size is known at compile time.  The [N,*] only affects how the image
>>> numbers are computed in references within the subroutine. This case is
>>> discussed at [92:24-26].
>>
>> Are different N values on different images allowed?
> Good catch; the cobounds are required to be the same on every image for 
> allocatable coarrays by [128:12-13], but I see no such requirement here, 
> nor is it generally possible (there are no synchronisation points where 
> the cobounds could be compared between images).

Correct.

> 
> If there is no cobound requirement in this case, what purpose does the 
> requirement on allocatable ones serve?  Enforcement of good programming 
> practice?

Depending on the implementation, the allocation routine might be more 
efficient if the dope vector for the coarray is identical on every 
image. It's contents could, for example, be broadcast as part of 
unwinding the allocate barrier tree.

Cheers,
Bill


> 
> Cheers,

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120





More information about the J3 mailing list