[MPIWG Fortran] Question on Fortran binding errata
Rolf Rabenseifner
rabenseifner at hlrs.de
Thu Feb 13 03:28:06 CST 2014
Jeff,
Yes, you are right.
We use the method that the specific procedure name
differs from the MPI routine name in
- the errata, new Sect. 17.1.5, see Table 1.1,
(no real overloading within a given module),
- and in the definition of all memory allocating routines
MPI_ALLOC_MEM, MPI_WIN_ALLOCATE, MPI_WIN_ALLOCATE_SHARED...
and the memory-pointer providing routine
MPI_WIN_SHARED_QUERY
(real overloading within each module).
Best regards
Rolf
----- Original Message -----
> From: "Jeff Squyres (jsquyres)" <jsquyres at cisco.com>
> To: "MPI-WG Fortran working group" <mpiwg-fortran at lists.mpi-forum.org>
> Sent: Wednesday, February 12, 2014 11:28:24 PM
> Subject: Re: [MPIWG Fortran] Question on Fortran binding errata
>
> There's deep Fortran voodoo here. :-)
>
> The short version is that Fortran overloads functions sorta similar
> to C++, but with a different mechanism. So you can:
>
> call foo(integer_value)
> and
> call foo(floating_value)
>
> and have it call 2 different back-end subroutines, just like C++.
> The way this is done in fortran is with interfaces. Something like
> this:
>
> interface foo
> subroutine foo_integer(a)
> integer :: a
> end subroutine foo_integer
>
> subroutine foo_real(a)
> real :: a
> end subroutine foo_real
> end interface foo
>
> So you've declared one interface -- foo -- but with 2 different
> subroutine implementations -- foo_integer and foo_real (note that
> the above is a *declaration*, it is not an *implementation*). You
> can then go implement foo_integer and foo_real, and the compiler
> will take care of figuring out which actual subroutine to invoke
> when an application invokes "call foo(x)".
>
> The "specific procedure name" refers to the "inner" names (e.g.,
> foo_integer and foo_real, in this example). As Craig said, because
> of the MPI profiling layer, we mandated specific forms of specific
> procedure names. Otherwise, 3rd party tools wouldn't be able to
> intercept calls via the MPI profiling mechanism (because the
> actual/back-end symbol for any given procedure would be unknown /
> implementation-specific).
>
> Make sense?
>
>
> On Feb 12, 2014, at 5:02 PM, Craig Rasmussen <rasmus at cas.uoregon.edu>
> wrote:
>
> > We realized after working on MPI-3 for awhile that we would need
> > Fortran wrappers and couldn't really call C routines directly.
> > One of the reasons is that the MPI C routines return a function
> > value and most of the Fortran bindings are subroutines without a
> > return value. The language you refer to is a requirement on the
> > implementer as to what the name of the wrapper routine is.
> >
> > For example, if the user calls MPI_Isend and uses the MPI_F08
> > module, then the wrapper routine shall (must) be called
> > MPI_Isend_f08. Another requirement we have placed on implementors
> > is that the wrapper name can't be hidden within a module so that
> > Fortran module name mangling won't be done for the MPI_Isend_f08
> > routine.
> >
> > Craig Rasmussen
> > CAS Scientific Programmer
> > rasmus at cas.uoregon.edu
> >
> >
> >
> >
> > On Feb 12, 2014, at 1:28 PM, Junchao Zhang wrote:
> >
> >> Hello,
> >> On page 10, line 38 of the errata,
> >> http://www.mpi-forum.org/docs/mpi-3.0/errata-30.pdf, it reads
> >>
> >> A Fortran call to an MPI routine shall result in a call to a
> >> procedure with one of the
> >> specific procedure names and calling conventions, as described in
> >> Table 1.1 on page 11.
> >> Case is not significant in the names.
> >>
> >> Can someone explain it a little more, especially, what is the
> >> meaning of "specific procedure names"?
> >> Thank you.
> >>
> >> --Junchao Zhang
> >> _______________________________________________
> >> mpiwg-fortran mailing list
> >> mpiwg-fortran at lists.mpi-forum.org
> >> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
> >
> > _______________________________________________
> > mpiwg-fortran mailing list
> > mpiwg-fortran at lists.mpi-forum.org
> > http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>
>
> --
> Jeff Squyres
> jsquyres at cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
>
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>
--
Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner at hlrs.de
High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530
University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832
Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner
Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)
More information about the mpiwg-fortran
mailing list