<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.gmailsignatureprefix
        {mso-style-name:gmail_signature_prefix;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi Jeff,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Do the calls to MPI_TYPE_SIZE really need to happen before MPI_INIT?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">The use-case for “before” is that the user could refuse to call MPI_INIT if they get an answer they don’t like, but The MPI Way ™ for that is to initialise first, query the environment/situation,
 and then abort if desired.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">The “after” approach works better with sessions as well.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">#if USE_SESSIONS<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_Info_set(my_info, …); // set a new key “mpi_assert_abi_sizes” to “ILP64” (request/assert)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_Session_init(my_info, &my_session);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_Info_get(my_info, …); // ask about the ABI of the library that was loaded (query)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_TYPE_SIZE(MPI_INTEGER, &size_of_fortran_integer);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">If (BAD) MPI_Abort();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">#else<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">// out-of-band, e.g. env var like mpi_mem_alloc_kinds (request/assert)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_Init();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_Info_get(MPI_INFO_ENV, …); // ask about the ABI of the library that was loaded (query)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">MPI_TYPE_SIZE(MPI_INTEGER, &size_of_fortran_integer);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">If (BAD) MPI_Abort();<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">#endif<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Best wishes,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Dan.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> mpiwg-abi <mpiwg-abi-bounces@lists.mpi-forum.org>
<b>On Behalf Of </b>Jeff Hammond<br>
<b>Sent:</b> Tuesday, August 29, 2023 4:18 PM<br>
<b>To:</b> mpiwg-abi <mpiwg-abi@lists.mpi-forum.org>; MPI Forum <mpiwg-fortran@lists.mpi-forum.org><br>
<b>Subject:</b> Re: [mpiwg-abi] MPI Fortran ABI discussion scheduling and agenda<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Terse minutes from the meeting follow.  Please correct the record if I have made an error.  Thanks to everyone who attended (I didn't transcript it, but at least Jeff H, Quincy K, Bill W, Bill L, Ken R, Julien J, Joseph S, Christian N,
 M Klemm, and Abraham N were there).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Decision 1:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The sizes of Fortran types is part of the MPI ABI and each choice/combination of these requires a separate implementation.  The stipulation that the user must use exactly one of these throughout the application extends to the Fortran sizes.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Rationale: Every other option is extremely difficult to implement and unpleasant to reason about.  If we figure out a more compact way to solve this problem, we can standardize it in the future.  The O(n) solution is practical because today
 no implementation implements n>2.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Corollary 1:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">There is one mpi.h, one libmpi_abi.so and one of each for the Fortran modules (and header, if supported) for every MPI C+Fortran ABI.  If an implementation provides more than one MPI C+Fortran ABI, the implementation should distinguish
 them using paths.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Decision 2:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The sizes prescribed by the external32 specification are required to be supported in the ABI.  All other sets of sizes are optional.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Corollary 2:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">User code must do one of the following:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">1. Assume the external32 ABI.  If wrong SO is linked, that's a user error and bad things will happen.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2. Query the Fortran size ABI to ensure that the MPI SO matches the Fortran object code, and abort if they don't match.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2. Query the Fortran size ABI to ensure that the MPI SO matches the Fortran object code, and handle any differences manually, e.g. using MPI_INTEGER8 instead of MPI_INTEGER.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Corollary 3:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><br>
MPI_Type_size must be callable before MPI_Init for all predefined datatypes (and only predefined datatypes), because this is how a user can detect potential ABI problems.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">If people don't like this, then I'll add MPI_Abi_type_sizes that meets the need, without supporting the generality of MPI_Type_size.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Jeff<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Fri, Aug 25, 2023 at 11:35 AM Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">We need to meet to discuss some of the open problems with the MPI Fortran ABI.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><a href="https://www.when2meet.com/?21032099-f9qjp" target="_blank">https://www.when2meet.com/?21032099-f9qjp</a> <o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The agenda is <a href="https://docs.google.com/document/d/1URUIbHhGQfUcoNg_KTX1lhWS-Z80LwJA9LH2QL7HCuo/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/1URUIbHhGQfUcoNg_KTX1lhWS-Z80LwJA9LH2QL7HCuo/edit?usp=sharing</a>. 
 You'll need to request access to comment/edit because this email list is public and I do not want to deal with vandalism.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Jeff<br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><span class="gmailsignatureprefix">-- </span><o:p></o:p></p>
<div>
<p class="MsoNormal">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><o:p></o:p></p>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal"><span class="gmailsignatureprefix">-- </span><o:p></o:p></p>
<div>
<p class="MsoNormal">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><o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>