[MPI3 Fortran] Proposing changes to Fortran 2008

Aleksandar Donev donev1 at llnl.gov
Mon Mar 31 16:59:25 CDT 2008

On Monday 31 March 2008 12:58, Hubert Ritzdorf wrote:

> Nevertheless, if the compiler is not sure that it can perform this
> optimization the compiler inserts a copy-in/copy-out.
Yes, and this happens only in cases where the array in question is "non 
Fortran 77", for example, it is a section with a stride, it is an 
assumed-shape array, a pointer array, or some such. In such cases copy in/out 
could be required. I hear people complaining about Fortran 90 having 
introduced unnecessary copy in/out. I cannot see how this is true unless you 
are actually using a feature that was new in Fortran 90.

> Such a compiler option turns off copy-in/copy-out for that source
> file to be compiled. It works such as an optimization flag.
An optimization never affects correctness. What if copy in/out is necessary at 
run-time, i.e., the actual argument is not contiguous? Does this flag you 
mention cause those programs to abort with a run-time error? Or they crash 

> but this doesn't
> help the application programmer. He will look for a "portable" solution
> and transfer
> the first array element (I know, it's not guaranteed but it works).
I am trying to understand is what you are actually proposing (desiring). You 
want a way to specify in an interface block: The actual argument must be 
contiguous and no copy in/out shall be performed?
Should the contiguity check be compile time or run time?

Note that this has nothing to do with the TKR-matching business we've been 
talking about. The issue of copying is separate.


More information about the mpiwg-fortran mailing list