<div dir="ltr">Got it.  It is very helpful.<div>I now understand that we do overloading in MPI since Fortran standards have different supports for choice buffers. Application programmers only care interface names; tool developers need to know inner names to intercept. So MPI spec defines both.</div>
<div><br><div><div><br><div><br></div></div></div></div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">--Junchao Zhang</div></div>
<br><br><div class="gmail_quote">On Wed, Feb 12, 2014 at 4:28 PM, Jeff Squyres (jsquyres) <span dir="ltr"><<a href="mailto:jsquyres@cisco.com" target="_blank">jsquyres@cisco.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There's deep Fortran voodoo here.  :-)<br>
<br>
The short version is that Fortran overloads functions sorta similar to C++, but with a different mechanism.  So you can:<br>
<br>
    call foo(integer_value)<br>
and<br>
    call foo(floating_value)<br>
<br>
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:<br>
<br>
interface foo<br>
   subroutine foo_integer(a)<br>
       integer :: a<br>
   end subroutine foo_integer<br>
<br>
   subroutine foo_real(a)<br>
       real :: a<br>
   end subroutine foo_real<br>
end interface foo<br>
<br>
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)".<br>

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

<br>
Make sense?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Feb 12, 2014, at 5:02 PM, Craig Rasmussen <<a href="mailto:rasmus@cas.uoregon.edu">rasmus@cas.uoregon.edu</a>> wrote:<br>
<br>
> 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.<br>

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

><br>
> Craig Rasmussen<br>
> CAS Scientific Programmer<br>
> <a href="mailto:rasmus@cas.uoregon.edu">rasmus@cas.uoregon.edu</a><br>
><br>
><br>
><br>
><br>
> On Feb 12, 2014, at 1:28 PM, Junchao Zhang wrote:<br>
><br>
>> Hello,<br>
>>   On page 10, line 38 of the errata, <a href="http://www.mpi-forum.org/docs/mpi-3.0/errata-30.pdf" target="_blank">http://www.mpi-forum.org/docs/mpi-3.0/errata-30.pdf</a>, it reads<br>
>><br>
>> A Fortran call to an MPI routine shall result in a call to a procedure with one of the<br>
>> specific procedure names and calling conventions, as described in Table 1.1 on page 11.<br>
>> Case is not significant in the names.<br>
>><br>
>>    Can someone explain it a little more, especially, what is the meaning of "specific procedure names"?<br>
>>    Thank you.<br>
>><br>
>> --Junchao Zhang<br>
>> _______________________________________________<br>
>> mpiwg-fortran mailing list<br>
>> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
>> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
><br>
> _______________________________________________<br>
> mpiwg-fortran mailing list<br>
> <a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
> <a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Jeff Squyres<br>
<a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a><br>
For corporate legal information go to: <a href="http://www.cisco.com/web/about/doing_business/legal/cri/" target="_blank">http://www.cisco.com/web/about/doing_business/legal/cri/</a><br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
mpiwg-fortran mailing list<br>
<a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>
<a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
</div></div></blockquote></div><br></div>