[MPI3 Fortran] Proposing changes to Fortran 2008
donev1 at llnl.gov
Thu Mar 27 15:45:40 CDT 2008
On Thursday 27 March 2008 13:03, Hubert Ritzdorf wrote:
> I don't believe that the compiler guys have introduced such compiler
> switches only for MPI
> since also other libraries have such problems.
Of course. I use C libraries all the time and I care a lot about finding a
good solution to the (multiple and somewhat distinct) issues that MPI birngs
out. In fact, to be honest, I don't per se care for MPI itself, rather,
generically the interfacing with such libraries written in other languages.
> And I have also seen compiler switches for "don't perform copy-in/copy
Can you give an example please and explain what it does exactly?
> And I see
> Fortran codes transferring scalar arguments such as "my_array (1,1)"
> (nevertheless many
> data items are transferred) in order to avoid copy in/copy out.
Why not just "my_array"? If this is trying to get around the rank-matching
requirement than using my_array(1,1) is in fact perfectly legal and OK---you
are relying on sequence association which is exactly what passing the first
element of an array does. But in that case your assertion that they do this
to avoid copy in/out is wrong---they do it to pass a rank-2 array to a rank-1
Formally, nothing in the standard prevents copy in/out when relying on
sequence association as in the example above. It is just that no compiler in
their sane mind would perform copying when that was completely unnecessary:
The actual argument is already contiguous so why copy it?
More information about the mpiwg-fortran