[MPI3 Fortran] Argument data sizes

Craig Rasmussen crasmussen at lanl.gov
Thu Sep 18 15:42:18 CDT 2008


On Sep 18, 2008, at 9:15 AM, Bill Long wrote:

>
>
> Jeff Squyres wrote:
>> On Sep 18, 2008, at 9:36 AM, Iain Bason wrote:
>>
>>>> So it isn't that we need the count to be able to convey a huge  
>>>> number, it's that the absence of an interface that accepts an 8  
>>>> byte count makes it more difficult to write portable programs.
>>
>> Yes, I understand that, but if MPI itself doesn't accept counts  
>> (and other parameter values) larger than what can be represented by  
>> a C int, what does allowing an INTEGER*8 in the MPI Fortran  
>> interface mean?
>
> But essentially all modern processors use 64-bit addressing.  If a C  
> int is 32 bits, then this restriction is a basic design flaw in MPI  
> that needs to be fixed. Either that or a C int needs to be 64  
> bits.   (The earlier discussion about default64 switches originated  
> with legacy supercomputers where, indeed, the default integer in  
> Fortran AND C int were 64 bits, so there was no internal  
> inconsistency.)  Getting MPI to force a change on the C standard is  
> probably out of scope.  However, fixing the MPI spec to mandate that  
> count arguments be of type int64_t, or perhaps better, intptr_t, is  
> quite reasonable, and recognizes modern reality.
>

Jeff and I had a talk about several of the issues on the table and  
I've agreed to summarize.  I'll do this by responding to the various  
threads directly.

Bill raises an excellent point regarding the size of something that  
essentially reflects the amount of memory on a machine.  However, this  
is not in the scope of this group.  So any discussion regarding this  
should be taken up with the wider forum who is considering this topic.

However, it is within our purview to discuss how to best represent  
this size in Fortran.  I'm going to take a straw poll on this matter.   
Please choose one of the following choices:

1. A constant kind value defined by the implementation, e.g.,  
MPI_SIZE_KIND,
          integer(MPI_SIZE_KIND) :: count
     It is expected that MPI_SIZE_KIND be the same kind as a default  
integer

2. Similar to 1. expect the kind value is C_INT

3. Use overloading to select use either (effectively) a C int or a C  
long.  I don't think this will work with default integer dummies

4. Use default integer, write the wrapper in Fortran, and use  
assignment to cast the integer to C_INT.


I vote #1 as it provides the most flexibility to the implementer and  
the compiler will give an error if the programmer does something stupid.

Cheers,
Craig




More information about the mpiwg-fortran mailing list