Jeff Squyres wrote:
On May 26, 2009, at 3:10 PM, Bill Long wrote:
"I note that none of the current Fortran API interface specifications in MPI-2.1 list the intent of the parameters. Do we want to update all of MPI in 3.0 to list the INTENT, and/or use "more modern Fortran notation""
Yes, please!
I'll second that. Intents are a good idea in general. One caution: One
Hubert / Rolf / Craig -- do you guys agree that this is a Good Thing to do for MPI-3? I agree to this. But you cannot simply use the current MPI specifications IN, OUT, INOUT for Fortran buffers. For example, the receive buffer argument in MPI_Recv() must be Intent (INOUT) since it may contain data to be preserved such as Steve Lionel wrote.
We should also consider whether BIND(C) and other C interoperability features should be used (especially the KIND values from ISO_C_BINDING that correspond to C types.)
There's been extensive discussion about this (e.g., use of BIND(C)) -- I'll let the other more-Fortran-knowledgeable MPI guys comment on these ideas...
Using bind(c) and some other modern features - the VALUE attribute could be used beneficially in many instances - does have the the side effect that having the interface visible (i.e. including the USE MPI statement) is required rather than optional. That would involve a level of user awareness that is greater than if you only use features that do not require explicit interfaces. Some compilers have an "automatic use" option that would avoid having to modify existing user sources, but I don't think this is universally available. I'm all in favor of using the modern stuff. I just want to make sure we have 'full disclosure' on what that involves.
Another side effect of users including USE MPI with interfaces that include intent specs: some codes that start to experience compile-time errors. Granted, the code was wrong all along, and the compiler is now able to detect that. In the end this is a good thing, but the initial response is "but it worked before" (or so they thought).
With MPI-3 being a major revision number change, we're open to at least some of this kind of stuff.
FWIW, Open MPI has an "mpi" module with INTENT specifications. I don't know what the other MPI implementations do in their "mpi" module. To be clear: the MPI spec currently *allows* you to use INTENT in your "mpi" module; it just doesn't *require* it. Also NEC MPI has an "mpi" module with INTENT specifications.
Hubert