[MPI3 Fortran] Request for a straw vote.

Bill Long longb at cray.com
Tue Jun 23 07:57:59 CDT 2009



Lionel, Steve wrote:
> 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.
> 

And if the compiler is not so kind, then at least the user is on notice 
to fix the code.  Error avoidance is one of the main virtues of explicit 
interfaces.  On a big-endian machine (such as IBM) the difference 
between integer(4) and integer(8) really does matter for argument passing.


> 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.
> 


By specifying kind values everywhere in the module, the question of how 
the module was compiled becomes irrelevant.  This is an additional 
reason for always specifying the kinds.




> 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.
> 

Various Microsoft products flag "Fortran" as being misspelled.  The 
suggested replacement is FORTRAN.  One wavers between amusement and 
dismay at such incompetence.

Cheers,
Bill



> 
> _______________________________________________
> mpi3-fortran mailing list
> mpi3-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran

-- 
Bill Long                                   longb at cray.com
Fortran Technical Support    &              voice: 651-605-9024
Bioinformatics Software Development         fax:   651-605-9142
Cray Inc., 1340 Mendota Heights Rd., Mendota Heights, MN, 55120





More information about the mpiwg-fortran mailing list