[MPI3 Fortran] WG mission statement / bullets

N.M. Maclaren nmm1 at cam.ac.uk
Thu Sep 3 04:14:40 CDT 2009


On Sep 3 2009, Malcolm Cohen wrote:
>Steve Lionel wrote:
>> Hubert Ritzdorf wrote:
>>
>>> I think that the Fortran Programmers expect that these definitions are 
>>> made in Fortran integers and not in C_INT's. They want to use Fortran 
>>> and not C and they want that the Fortran compiler features are 
>>> supported (such as expansion > of integers, reals and double 
>>> precisions).
>>
>> Fortran programmers would be using Fortran integers. The KIND value 
>> just makes sure that they're the right kind of Fortran integers. I am 
>> not asking Fortran programmers to code in C and the fact that C_INT is 
>> used would be invisible. This is just a standard-conforming way of 
>> saying "give me this platform's default integer kind".
>
>Well, actually, "give me the kind that matches this platform's C ``int''."

Which is PRECISELY the wrong solution!

> As you wrote in another message, Fortran's default integer is not always 
> 32-bit.

Quite.  Nor are C's.

The executive summary is that K&R 'int' had a similar functional
specification to Fortran default INTEGER, and it would have been rare
implementations where they were different.

This was less true in C89 (though still true for effectively all
'normal' implementations), but is very far from being true in C99.
Let's skip the details (which are not pretty), but it is no longer
true that C99 even has much of a concept of a 'default integer'.

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.

What is totally wrong is to bind any Fortran interface to C 'int',
because it is getting increasingly likely that Fortran default integers
will be larger than C_INT, and so using C_INT will both constrain
Fortran programs unreasonably and introduce serious "gotchas".


Regards,
Nick Maclaren.




More information about the mpiwg-fortran mailing list