[MPI3 Fortran] MPI buffer arguments - void and call-by-reference

Bill Long longb at cray.com
Sat Feb 14 12:29:28 CST 2009



Aleksandar Donev wrote:
> On Monday 09 February 2009 14:59, Rolf Rabenseifner wrote:
>
>   
>>     Fortran compilers are allowed to choose
>> call-by-incopy-and-outcopy instead of call-by-reference.
>>     
> There are already at least two cases where Fortran compilers are not 
> allowed to choose. These are when both the actual and the dummy have 
> the attribute: TARGET, VOLATILE, and ASYNCHRONOUS. Perhaps adding yet 
>   

Just to be clear, the "and" above should be "or".  You do not need to 
specify all of these options - one will do. 

The ultimate problem comes because a pointer (inside the MPI chambers) 
has been associated with the buffer and actions on the buffer are being 
taken through that pointer.   The TARGET attribute identifies a variable 
as being (possibly) the target of a (Fortran) pointer.   Given the 
similarity of the situations, it would be reasonable to require that a 
buffer have the TARGET attribute if it is used as the memory for a 
non-blocking MPI data transfer routine.

Cheers,
Bill



> another attribute where the compiler does not have freedom is useful, 
> but I am yet to be convinced.
>
> So first I want to ask: Other than with non-blocking transfer (which was 
> the subject of a separate message), what is the problem with copy 
> in/out? If it is a performance issue, than that is within the realm of 
> compiler optimization: As you said, the compiler has the choice and it 
> will usually choose the faster (often compilers include a run time 
> check to see if the actual is contiguous).
>
>   
>>     Meaning: Same as what currently done, i.e., call-by-reference
>>     on the caller side, if call-by-reference is possible (i.e.,
>>     not for non-contiguous subarrays)
>>     
> What if call-by-reference is not possible?
> How is this different from what is currently there and why is it useful 
> enough over what is already there to warrant inclusion in the Fortran 
> standard?
>
> Thanks,
> Aleks
>
>   

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120

            




More information about the mpiwg-fortran mailing list