(j3.2006) [ukfortran] (SC22WG5.5059) WG5 vote on draft TS on further coarray features

N.M. Maclaren nmm1
Mon Aug 5 09:16:37 EDT 2013


On Aug 5 2013, Bill Long wrote:
>> Nick Maclaren writes:
>>>
>>> > Passim. The specification is messy and restrictive, and should be 
>>> > changed. For example, it is not possible to reduce INTENT(IN) 
>>> > examples.
>
>The INTENT(IN) case seems too trivial to justify changing a spec that is 
>increasingly in production use.  If you want
>
>co_sum( <expr>, X)
>
>just write
>
>X = <expr>
>co_sum(X)
>
>instead.  The second form avoids the compiler having to create a temp 
>for <expr>, which you would want to avoid anyway if X is an array.

Er, no, it doesn't.  You have just created a named temporary: X.
Indeed, one of the main reasons to want a proper two-argument form
IS to avoid an unnecessary array copy and the consequent inefficient
use of space.

Consider a large number of images and reducing onto a single result
image.  You are now forcing all of the other images to copy the input
argument.

Regards,
Nick Maclaren.








More information about the J3 mailing list