<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 18, 2016 at 10:16 AM, Rolf Rabenseifner <span dir="ltr"><<a href="mailto:rabenseifner@hlrs.de" target="_blank">rabenseifner@hlrs.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">> From MPI 3.1, page 674:<br>
><br>
> "If an accompanying C++ compiler is missing, then the MPI datatypes in this<br>
> table are not defined."<br>
><br>
> Please tell me why we want to do something different for Fortran.<br>
<br>
</span>Seems to be a good point.<br>
What is mpich doing if there is no accompanying Fortran compiler?<br></blockquote><div><br></div><div>Full mpi.h from my Clang MPICH builds with FC=false attached.  Relevant excerpt below.</div><div>







<p class=""><span class="">/* Fortran types */</span></p>
<p class=""><span class="">#define MPI_COMPLEX           ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define MPI_DOUBLE_COMPLEX    ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define MPI_LOGICAL           ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define MPI_REAL              ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define MPI_DOUBLE_PRECISION  ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define </span><span class="">MPI_INTEGER</span><span class="">           ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p>
<p class=""><span class="">#define MPI_2INTEGER          ((MPI_Datatype)MPI_DATATYPE_NULL)</span></p></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
What are other MPI libraries doing in that case?<br>
<br></blockquote><div><br></div><div>I'll let Squyres answer this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
As far as I understood, Fortran was at least since MPI2.0 optional.<br>
<br>
And the cited C++ sentence was never done for Fortran.<br>
Therefore I expect that the real MPI libraries have some solutions.<br></blockquote><div><br></div><div>That's optimistic :-)</div><div><br></div><div>I suspect that everyone who wants Fortran features uses a Fortran-aware MPI library or they are told that they should do so.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
And changing things always has the risk that a very General middle ware<br>
fails because it can not be longer compiled.<br>
<span class="im"><br></span></blockquote><div><br></div><div>Middleware that compiles but cannot be used in any nontrivial way because MPI_DATATYPE_NULL may (at least with Open-MPI) cause the program to abort.  I don't see a problem in breaking compilation when successful compilation today leads to unsuccessful execution.</div><div><br></div><div>Jeff</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="im">
Rolf<br>
<br>
<br>
----- Original Message -----<br>
</span><span class="im">> From: "Jeff Hammond" <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>
> To: "MPI-WG Fortran working group" <<a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a>><br>
</span><span class="im">> Sent: Thursday, February 18, 2016 6:55:20 PM<br>
> Subject: Re: [MPIWG Fortran] Provide Fortran datatypes if Fortran bindings    not provided?<br>
<br>
</span><div class=""><div class="h5">> From MPI 3.1, page 674:<br>
><br>
> "If an accompanying C++ compiler is missing, then the MPI datatypes in this<br>
> table are not defined."<br>
><br>
> Please tell me why we want to do something different for Fortran.<br>
><br>
> While we do not currently say "If an accompanying Fortran compiler is missing,<br>
> then the MPI datatypes in this table are not defined," as a footnote to the<br>
> appropriate table, that is not a good reason to define something brittle. Let's<br>
> just add the footnote and call it good.<br>
><br>
> Users that expect Fortran features without a Fortran compiler are like people<br>
> who try to withdraw money from a bank where they do not have an account. Both<br>
> types of people are criminals :-)<br>
><br>
> Jeff<br>
><br>
> On Thu, Feb 18, 2016 at 7:10 AM, Jeff Hammond < <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a> > wrote:<br>
>><br>
>> The only reasonable thing to do here is to include MPI_INTEGER and other Fortran<br>
>> datatype enumerations in the meaning of Fortran bindings and not define them in<br>
>> the absence of a Fortran compiler. Any other solution is unreliable,<br>
>> ill-defined and going to lead to sadness.<br>
>><br>
>> More below.<br>
>><br>
>> On Thu, Feb 18, 2016 at 3:45 AM, Jeff Squyres (jsquyres) < <a href="mailto:jsquyres@cisco.com">jsquyres@cisco.com</a> ><br>
>> wrote:<br>
>> ><br>
>> > A question has come up recently in the Open MPI community (being debated in a<br>
>> > lengthy thread here<br>
>> > <a href="https://www.open-mpi.org/community/lists/users/2016/02/28448.php" rel="noreferrer" target="_blank">https://www.open-mpi.org/community/lists/users/2016/02/28448.php</a> ):<br>
>> ><br>
>> > If Fortran support is not provided in an Open MPI installation (e.g., if Open<br>
>> > MPI's configure script detects that there is no Fortran compiler, and therefore<br>
>> > none of the mpif.h, mpi module, or mpi_f08 module are compiled), should Fortran<br>
>> > datatypes (e.g., MPI_INTEGER) be available in the C bindings?<br>
>> ><br>
>> > It was pointed out that MPI-3.1 says that the Fortran bindings are optional --<br>
>> > but datatypes are not currently marked as optional.<br>
>> ><br>
>> > Hence, even if you don't have to Fortran compiler, you still have to have<br>
>> > declarations for MPI_INTEGER (and friends) in mpi.h.<br>
>> ><br>
>> > What do people think about this?<br>
>> ><br>
>> > ARGUMENTS FOR KEEPING IT THE SAME<br>
>> > =================================<br>
>> ><br>
>> > A1. MPI can set MPI_INTEGER to be equivalent to MPI_DATATYPE_NULL.<br>
>><br>
>> I will repeat what I said on the Open-MPI list. THIS IS HORRIBLE. It delays the<br>
>> failure until runtime. There is absolutely no value whatsoever in allowing a<br>
>> successful build of an application that is going to crash and burn the moment<br>
>> it touches this datatype, particularly in light of our discussion about a month<br>
>> ago regarding when MPI_DATATYPE_NULL can be used (basically never).<br>
>><br>
>> I do not want MPI implementations to lie to build systems about the availability<br>
>> of MPI_INTEGER in C when it is not actually a functional feature.<br>
>><br>
>> Additional reasons: Jed Brown. PETSc. <<< This is here for Jed's email filters.<br>
>><br>
>> > A2. MPI could probably figure out what Fortran INTEGER would have been (i.e.,<br>
>> > probably equivalent to C int) and just set MPI_INTEGER to be that.<br>
>><br>
>> This is also horrible, because Fortran INTEGER does not have fixed width. Here<br>
>> is what ISO Fortran 2008 says about INTEGER:<br>
>><br>
>> "The processor shall provide at least one representation method with a decimal<br>
>> exponent range greater than or equal to 18."<br>
>><br>
>> Please explain the unambiguous mapping between this definition and the<br>
>> definition of ISO C int.<br>
>><br>
>> ><br>
>> > A3. The whole point of having Fortran datatypes available in C is that even an<br>
>> > MPI process written in C can receive/send data from MPI processes in Fortran.<br>
>> > Hence, *this* MPI process -- compiled by an MPI implementation that does not<br>
>> > have a Fortran compiler -- may not have Fortran support, but a peer MPI process<br>
>> > in the same MPI job may have Fortran support.<br>
>><br>
>> Such a process cannot send or receive Fortran INTEGER data because it has no<br>
>> idea the size of such data.<br>
>><br>
>> This sort of use case is best supported by sending and receiving the data as<br>
>> bytes, because the no-Fortran process can understand that.<br>
>><br>
>> Alternatively, the Fortran processes can use ISO_C_BINDING and convert to C<br>
>> datatypes before sending. Since we have standardized the use of Fortran 2008 in<br>
>> MPI-3, there is absolutely no reason why this should not be the recommended<br>
>> practice, because it is completely reliable and well-defined.<br>
>><br>
>> > ARGUMENTS FOR A CHANGE<br>
>> > ======================<br>
>> ><br>
>> > B1. Setting MPI_INTEGER (and friends) to MPI_DATATYPE_NULL -- which will cause a<br>
>> > run-time MPI exception -- is somewhat anti-social behavior (and potentially<br>
>> > confusing to the user).<br>
>><br>
>> See above.<br>
>><br>
>> > B2. An MPI implementation can *assume* but can't *know* what the<br>
>> > size/representation of Fortran datatypes are unless there's a Fortran compiler<br>
>> > with which to test.<br>
>><br>
>> You know what happens when you assume, right?<br>
>><br>
>> What possible value does it serve to guess? We create a situation where<br>
>> sometimes it works and sometimes MPI programs crash and burn? While we are at<br>
>> it, let's add MPI_Barrier_sometimes(double randomness_factor)...<br>
>><br>
>> > B3. A3 is a somewhat sketchy claim. It's obviously possible and valid, but<br>
>> > fairly uncommon to have multiple MPI implementation installations involved in a<br>
>> > single execution of an MPI application.<br>
>><br>
>> It is valid to have multiple implementations, but not valid to expect processes<br>
>> that use a Fortran-oblivious MPI library to understand Fortran data.<br>
>><br>
>> Jeff<br>
>><br>
>> --<br>
>> Jeff Hammond<br>
>> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
>> <a href="http://jeffhammond.github.io/" rel="noreferrer" target="_blank">http://jeffhammond.github.io/</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Jeff Hammond<br>
> <a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br>
> <a href="http://jeffhammond.github.io/" rel="noreferrer" target="_blank">http://jeffhammond.github.io/</a><br>
><br>
</div></div><span class="im">> _______________________________________________<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" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
<br>
</span><span class="im">--<br>
Dr. Rolf Rabenseifner . . . . . . . . . .. email <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a><br>
High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530<br>
University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832<br>
Head of Dpmt Parallel Computing . . . <a href="http://www.hlrs.de/people/rabenseifner" rel="noreferrer" target="_blank">www.hlrs.de/people/rabenseifner</a><br>
Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)<br>
</span><div class=""><div class="h5">_______________________________________________<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" rel="noreferrer" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div></div>