(j3.2006) (SC22WG5.3672) [ukfortran] N1755: Request for new features from MPI Forum

Malcolm Cohen malcolm
Thu Nov 13 02:00:19 EST 2008

Aleksandar Donev wrote that INTENT(IN) doesn't really mean INTENT(IN) if 
you make it VOLATILE.

I say: Well that's just execrable design,  please flush it away.
> If the programmer knows that the value of the actual can change during 
> the execution of the program by means outside of the program (which, 
> by the way, are under the control and responsibility of the 
> programmer, not God!)
It's certainly not necessarily under the control of the programmer 
unless she is also God, and maybe not even then.

> The INTENT(IN) attribute means that the value should not change 
> because of actions in the routine itself.

Destroying the meaning and effect of INTENT(IN) is not in any way 
acceptable.  If you really must, add a new INTENT(I won't change this 
variable in any obvious way but behind the scenes ha ha), 'cause that 
seems to be what is being described here.
> VOLATILE simply means (in my book) that the value changes by means 
> other than Fortran,
> not by means out of the control of the programmer.
No.  *Might* not be out of control, but is certainly allowed to be (one 
can argue as to whether it usually is or not).
> If you call an external I/O routine, like MPI, and it works 
> asynchronously, there is no difference with Fortran ASYNCHRONOUS I/O
Well ... yes and no.  The optimisation implications are in fact somewhat 
different (and I'm not sure whether MPI-2's design is consistent with 
> and what you need to do is use the VOLATILE attribute instead. I am 
> well-aware this is not a good language design, but it is the only 
> legal option within the Fortran 2003 standard, and in fact, one of the 
> intended uses of VOLATILE.
Absolutely correct.  One of the main purposes in fact - I doubt it would 
have been added otherwise.

Whether that situation ought to persist in Fortran 2008, with MPI being 
revised as well, is another matter.  But unless J3 and/or WG5 get more 
involved with MPI (as perhaps they ought) then it's probably best to 
leave well enough alone.  Or in this case, to leave the horrible mess alone.
> BTW, I was not involved in J3 when VOLATILE/ASYNCHRONOUS were added 
> either...
There were a number of dead bodies VOLATILE was added over the 
objections of, so just being a J3 member doesn't mean one thinks 
VOLATILE was (a) a good idea or (b) done correctly.

......................Malcolm Cohen, Nihon NAG, Tokyo.

More information about the J3 mailing list