[MPI3 Fortran] WG mission statement / bullets

N.M. Maclaren nmm1 at cam.ac.uk
Thu Sep 3 08:55:42 CDT 2009


On Sep 3 2009, Iain Bason wrote:
>
>> I haven't seen the mission statement for the same reason as Malcolm,
>> but would favour MPI using Fortran default integers whereever they
>> make sense.  Fortran's semantic specification of them is still useful
>> in a way that C's isn't.
>
>I believe that the idea behind using C int (or, more generally,  
>something like a MPI_DEFAULT_INT kind) was to allow people to build a  
>library that would work regardless of whether the application is  
>compiled with -i8.  As it stands, the MPI Fortran library has to be  
>compiled with -i8 if the application is.  If people use an explicit  
>kind for their integers, then one library can serve applications with  
>and without -i8.
>
>There are, of course, other possible solutions to the problem.  Is  
>there one in particular that you favor?  Or do you think the problem  
>shouldn't be solved?

I am not sure those are meaningful questions.

Let's start by saying that I am not opposed to MPI_DEFAULT_INT.  That's
the simplest and safest solution (if the least convenient for users), as
long as it is kept well separated from C int.  It is specifically the
latter that is such a bad idea.

There are several good solutions that need no action by MPI at all; i.e.
they are done entirely by the implementation.  For example, many linkers
allow symbols to have attributes, which are used for matching; some of
them allow two symbols of the same name with different attributes to
coexist even in the same executable.  In others, the attributes are used
to modify the names, so you are talking about (say) MPI_SEND#4 and
MPI_SEND#8.

But let's say that you are assuming a more primitive linker.  Malcolm's
proposal for generics is the clean way to do this - at least in cases where
the compiler has the decency to use different values of KIND(0) when -i8
is specified and when it isn't.  Building such a library would be a trifle
tedious and system-specific, but not hard.

Tying MPI's integers to C int doesn't actually help, anyway, as pointers
can be of varying sizes, and PRECISELY the same arguments for wanting a
single library apply to -m64 and -m32. Or a -r8 option to make REAL 8
bytes, which is quite common.  Or even a -ascii/-unicode option for
CHARACTER. 

Regards,
Nick Maclaren.







More information about the mpiwg-fortran mailing list