[MPI3 Fortran] Fortran extra_state argument to MPIattributefunctions

N.M. Maclaren nmm1 at cam.ac.uk
Thu May 28 03:23:04 CDT 2009


On May 28 2009, Aleksandar Donev wrote:
>Jeff Squyres wrote:
>
>> I guess I should clarify here -- the intent for this parameter is not to 
>> be interoperable with C.
>I understand, but you were asking about a "neutral" type that can be 
>"cast" into the "right type". The C void* can be used for such things, 
>but Fortran does not have an equivalent, at least not unless you count 
>Fortran 2003 object oriented features (where there are "unlimited 
>polymorphic pointers" which provide a type-safe "castable" generic 
>pointer). This is why using C interoperability is good here---it is 
>legal and does what you want.

While this is true, a reasonable alternative approach (which is what is
actually done by must current implementations for MPI handles) is to use
an integer token in Fortran, and have the using routines decode it.  That
isn't exactly an unusual strategy in Fortran, and was common in the many
compilers written in Fortran 66.


Regards,
Nick Maclaren,
University of Cambridge Computing Service,
New Museums Site, Pembroke Street, Cambridge CB2 3QH, England.
Email:  nmm1 at cam.ac.uk
Tel.:  +44 1223 334761    Fax:  +44 1223 334679






More information about the mpiwg-fortran mailing list