[MPI3 Fortran] Request for a straw vote.

Lionel, Steve steve.lionel at intel.com
Tue Jun 23 07:41:02 CDT 2009


Jeff Squyres wrote:

> But what if a user compiles a code that uses INTEGERs where  
> INTEGER(MPI_TAG_KIND) parameters are expected with "ifort - 
> i8" (transmorgifying default INTEGERs to be 8 bytes)?  Will their code  
> refuse to compile?  If so, do users expect / compensate for this kind  
> of behavior?

The code will compile fine, and the arguments declared with kind MPI_TAG_KIND will get that kind.  Switches such as -i8 affect only "default integer" - declarations without a kind explicitly specified - at least in our implementation.

A minor issue is that if -i8 is used and the programmer passes a default integer constant, such as 4, that will be INTEGER(8) and a mismatch.  Intel Fortran will, as an extension, do a silent kind conversion for constant arguments.

Note that if the interfaces are in a module, it is typically the case that the "default kind" in effect when the module source is compiled is what is used, so there really isn't a difference in terms of functionality whether the kinds are specified or not.  Specifying the kinds is an aid to the programmer so they know what is expected, and so that they can declare their variables and constants with the correct kind, no matter what switches are used.  It's simply good practice.

Steve Lionel
Intel Developer Support
Nashua, NH

P.S.  I am beside myself in amusement - Outlook correctly suggests "transmogrifying" as a spelling correction.  I guess that Microsoft programmers are also Calvin and Hobbes fans.





More information about the mpiwg-fortran mailing list