[Beowulf] MPI ABI
William Gropp
gropp at mcs.anl.gov
Tue Oct 11 10:57:46 PDT 2005
At 08:44 AM 10/11/2005, Toon Knapen wrote:
>William Gropp wrote:
> >
> > Fortran name mangling here means how are Fortran routine names in the
> > source code mapped to names in the object library. For example, is
> >
> > MPI_Init
> >
> > in the Fortran source mapped to
> >
> > MPI_INIT
> > mpi_init
> > mpi_init_
> > mpi_init__
> > MPI_Init_
> >
> > Each of these has been chosen by some Fortran 77 compiler. Confusion
> > over this is one of the most common problems that users face,
> > particularly when they use command line options to *change* the way the
> > Fortran compiler maps the names in their code.
>
>
>but that's an easy one to solve. We already do it for BLAS and LAPACK.
>Based on some preprocessor directives we generate macro's that convert
>every 'dgemm' in our C/C++ app into DGEMM, dgemm_, dgemm__ etc.
That's not the point; all MPI implementations do something like this anyway
(as far as I know, all MPI implementations implement the Fortran interface
using C code and something to handle these issues). The problem is: which
of these names do you put into the MPI object library? If you have weak
symbols, you can work around some of this by putting them *all* into the
library, which MPICH2 does when it can. But not all systems support weak
symbols, or support more than one weak symbol per strong symbol. What
should an ABI define as the expected name mangling? What if the user
compiles their code with g77 (mpi_init__) but the MPI library used Absoft
(MPI_Init) or vice versa? What if the handling of character variables is
different with the two Fortran compilers (this can't be handled with weak
symbols and is risky and awkward to handle with stdargs)? It isn't enough
to know, for each Fortran compiler, how to generate C code that matches
that compiler. For an ABI, you need to match *all* compilers that the user
may use. Otherwise you do not have an ABI; you have, at best, one ABI per
Fortran compiler.
Bill
William Gropp
http://www.mcs.anl.gov/~gropp
More information about the Beowulf
mailing list