(j3.2006) Integration of co-arrays with the intrinsic shift functions
dick.hendrickson at att.net
Thu Jul 19 10:48:47 EDT 2007
-------------- Original message ----------------------
From: "Malcolm Cohen" <malcolm at nag-j.co.jp>
> On Thu, 19 Jul 2007 04:25:52 +0900, <dick.hendrickson at att.net> wrote:
> > It's worse if the expression is something like
> > X = f(b) + g(c)
> > and the syncs happen in f and g. If every image is compiled with the
> > same compiler, it doesn't matter because everything will be in the same
> > (unspecified) order. If different images are compiled by different
> > compilers, then they'll have to agree on expression evaluation odder. I
> > think that's surprising.
> Right, and this means that the argument about whether the CO_whatever is a
> or a subroutine could be somewhat moot.
> And you say "same compiler ... doesn't matter". But it's worse than that.
> Evaluation order can be affected by compilation options,
> in particular optimisation options.
> So everything needs to be compiled with the same compiler with the same
> This is getting pretty close to "the same executable".
> The underlying mechanism/protocols of coarray handling are not
> It seems unlikely that different vendors will all choose the same mechanism
> with the same protocols - it's more likely that they'll all keep them as
> trade secrets unless patented.
> BTW, we've slightly acknowledged the problems in 7.1.7 where we say
> "If a statement contains a function reference in a part of an expression
> that need not be evaluated, no invocation of that function in that part
> of the expression shall execute an image control statement other than
> CRITICAL or END CRITICAL."
It's potentially worse than that, the first sentence in 7.1.7 says
"It is not necessary for a processor to evaluate all of the operands
of an expression, or to evaluate entirely each operand, if the value
of the expression can be determined otherwise."
Some people interpret that to mean that no function every needs to be evaluated,
since the processor can always get the value by some other means. If this is
the correct interpretation, then functions can't use image control statements.
And, the collective subroutines are image control statements.
More information about the J3