[MPI3 Fortran] MPI function symbol naming convention for tools

Bill Long longb at cray.com
Sat Jun 25 04:32:35 CDT 2011



On 6/24/11 11:54 AM, Martin Schulz wrote:

>
> This is probably my lack of knowledge in Fortran compilers, but
> is this all even possible with regular compilers: I would assume
> that you can use an MPI 3.0 implementation with Craig's proposal
> (case A) with an older F77 or F90 compiler, right? If so, one would
> use "use mpi" or "mpif.h", i.e., case A.1. Can you do the name
> mapping from mpi_send to mpi_send_f - I thought this was a new
> feature from F08?
>

If you still have an old f77 compiler on you system (from decades ago), 
it will not be adequate.  If you have a current version of a Fortran 
compiler available, you are in much better shape.  The meaning of 
"Fortran" changes over time, and the compilers progress accordingly, 
with some time delay.

The name mapping of a call to  MPI_send into a call to mpi_send_f  is 
accomplished with generic interfaces. These were part of Fortran 90 (20 
year old technology now) - F08 is not required for this.  Other details 
of the interfaces do require more recent standards, however.


>>
>> But that being said, what's the problem with testing for the optional arguments?  You're in a tool already, meaning that performance overhead is already assumed to be somewhere between (nonzero<-->  high), so what's 1 or 2 more "if" statements?
>
> Perhaps I didn't understand the proposal: as I understand Craig's
> proposal, any routine that would have an optional status argument
> would now have two corresponding C routines. Supporting that
> in the tools is not a big deal, but having such naming exceptions
> and identifying which routines fall into this category can be hard
> for wrapper code generators (most tools generate the Fortran
> interface through a series of scripts).
>

Handling optional arguments would not necessarily require a second C 
function, assuming the argument is passed by address (pointer).  If the 
argument is missing in the call, the called function will just see a 
NULL value for the corresponding formal parameter.  This already "just 
works" with many compilers, and is being written into a proposed TR on 
enhanced interoperability with C.

Cheers,
Bill


-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the mpiwg-fortran mailing list