<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 14, 2009, at 12:50 PM, Lionel, Steve wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); ">I vote for #4.  This encourages good programming practice but allows programmers the option of omitting the kind in most circumstances.  The wording of choice 2 is unreasonably restrictive, I believe, unless it is suggesting that vendors may not provide generics or promotion features.</span></div></div></div></span></blockquote><div><br></div><div>Yes, two is meant to be restrictive (thus choice 4, which is an unrestricted 2).</div><div><br></div><div>-craig</div><div><br></div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div lang="EN-US" link="blue" vlink="purple" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div class="Section1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(0, 112, 192); ">Steve Lionel<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(0, 112, 192); ">Intel Developer Support<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(0, 112, 192); ">Nashua, NH<o:p></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 11pt; font-family: Calibri, sans-serif; color: rgb(31, 73, 125); "><o:p> </o:p></span></div><div><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; ">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; "><span class="Apple-converted-space"> </span><a href="mailto:mpi3-fortran-bounces@lists.mpi-forum.org" style="color: blue; text-decoration: underline; ">mpi3-fortran-bounces@lists.mpi-forum.org</a><span class="Apple-converted-space"> </span>[<a href="mailto:mpi3-fortran-bounces@lists.mpi-forum.org" style="color: blue; text-decoration: underline; ">mailto:mpi3-fortran-bounces@lists.mpi-forum.org</a>]<span class="Apple-converted-space"> </span><b>On Behalf Of<span class="Apple-converted-space"> </span></b>Craig Rasmussen<br><b>Sent:</b><span class="Apple-converted-space"> </span>Monday, September 14, 2009 1:05 PM<br><b>To:</b><span class="Apple-converted-space"> </span>MPI-3 Fortran working group<br><b>Subject:</b><span class="Apple-converted-space"> </span>[MPI3 Fortran] Straw vote on integers kinds<br><b>Importance:</b><span class="Apple-converted-space"> </span>Low<o:p></o:p></span></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">I've fixed the wiki to better represent current thinking and cleaned up and added example code.   I think we are pretty close to having most of the issues resolved.  We still must come to terms with what to do with integer kinds.  In the wiki, I've listed four possibilities; three of them have come up in recent discussions.  I've listed them below, also see <a href="https://svn.mpi-forum.org/trac/mpi-forum-web/wiki/FtnWikiPage" style="color: blue; text-decoration: underline; ">https://svn.mpi-forum.org/trac/mpi-forum-web/wiki/FtnWikiPage</a><o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">Please vote for one of the options.  My personal view is that we need to open up the question to the entire MPI Forum to get reaction from a larger community (not just Fortran geeks).  I'll do this at the next meeting in Portland.<o:p></o:p></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div></div><div><ol start="1" type="1" style="margin-bottom: 0in; "><li class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; ">Use the default integer kind. This has the least impact on existing codes. This causes problems when the size of default integers are promoted for user code and not also in the MPI library.<o:p></o:p></span></li><li class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; ">Specify a named kind, e.g., MPI_INT_KIND. This provides the most specificity and the user will have a known way to code that will work under all circumstances. But this will cause problems for existing codes when compiler options are used that change the size of default integers.<o:p></o:p></span></li><li class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; ">Require the vendor to provide two interfaces, one for standard integers and one for long integers. This option works when integers are promoted and doesn't break existing codes.<o:p></o:p></span></li><li class="MsoNormal" style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; ">Specify a named kind in the Fortran interface (MPI_INT_KIND) but allow the vendor a choice as to how to address integer promotion (it would become a quality of implementation issue) if users use default integers in their codes. The vendor could provide an additional interface for promoted integers (not part of the MPI standard) or could provide a separate library to link against.<o:p></o:p></span></li></ol><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; ">-----------<o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; "><o:p> </o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span class="apple-style-span"><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">I vote for number 4.  I believe that a standard should provide specificity to the programmer.  If the programmer uses MPI_INT_KIND, his/her program will always work even if integers are promoted or C_INT doesn't match up with default integers.  Since users will have to change existing codes anyway (to use the new derived types, e.g., MPI_Comm) users can make the transition to specific kinds at this time.  However, I also think the standard should also leave room for vendors to provide additional integer kinds via generics or separate compilation libraries.</span></span><span style="font-size: 10pt; font-family: Verdana, sans-serif; "><o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; "><o:p> </o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span class="apple-style-span"><span style="font-size: 13.5pt; font-family: Helvetica, sans-serif; ">-craig</span></span><span style="font-size: 10pt; font-family: Verdana, sans-serif; "><o:p></o:p></span></div></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><span style="font-size: 10pt; font-family: Verdana, sans-serif; "><o:p> </o:p></span></div></div></div><div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">On Sep 2, 2009, at 11:30 AM, Lionel, Steve wrote:<o:p></o:p></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><br><br><o:p></o:p></div><div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">Craig wrote:<br><br><br><o:p></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">I've been back and forth on this (as well as a few others I think).   <o:p></o:p></div><blockquote style="margin-top: 5pt; margin-bottom: 5pt; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">I'm currently leaning toward using default integers.  Primarily  <o:p></o:p></div></blockquote><blockquote style="margin-top: 5pt; margin-bottom: 5pt; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">because to do otherwise could potentially break countless lines of  <o:p></o:p></div></blockquote><blockquote style="margin-top: 5pt; margin-bottom: 5pt; "><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; ">users code.  <o:p></o:p></div></blockquote><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><br>No, it won't, as long as the choice for the MPI integer kind matches C_INT, which is pretty much universal for default integer in Fortran implementations.  <br><br>Let me try an example.<br><br>module MPI<br>use, intrinsic :: ISO_C_BINDING<br>integer, parameter :: MPI_INT_KIND = C_INT<br><br>interface<br>subroutine MPI_SUB (INTARG)<br>import ! Makes the definition of MPI_INT_KIND visible here<br>integer(MPI_INT_KIND), intent(IN) :: INTARG<br>end subroutine MPI_SUB<br>end module MPI<br><br><br>User code:<br><br>program test1<br>use MPI<br>integer SOMEVAR1<br>call MPI_SUB (SOMEVAR1)<br>end<br><br>This is the "existing code" case.  The compiler will have a kind for "default integer" - the number chosen for this kind value varies by implementation (usually 4 but not always) - let's say it's 4 here.  For this combination of Fortran and a "companion C processor", C_INT is also 4, and thus so is MPI_INT_KIND.  The declaration of SOMEVAR1 does not specify a kind, so it gets "default integer" or 4.  No problem yet.<br><br>Now let's say that this user has decided to compile her Fortran code with an option that changes the default integer kind to 8 (-i8 or similar).  Now if the above code is compiled, there will be an error because the module, assuming it wasn't also compiled -i8, defines the argument as INTEGER(4) but SOMEVAR1 is now INTEGER(8).  The user may have had a reason to use -i8 for other variables and now needs to figure out what to do.  She reads the source of the MPI module, but if it just says INTEGER with no KIND value, she may be at a loss to figure out what to change.<span class="Apple-converted-space"> </span><br><br>If it had been written like this:<br><br>program test2<br>use MPI<br>integer(MPI_INT_KIND) SOMEVAR2<br>call MPI_SUB (SOMEVAR2)<br>end<br><br>The call with SOMEVAR2 is ok in either case, because the explicit kind overrides the default integer kind in effect.<br><br>Explicitly specifying the KIND value in the module helps documentation and encourages, but does not require, the programmer to specify the KIND value in their own code.  It does no harm and does not force coding changes that wouldn't be needed otherwise.  Using explicit kinds also helps make the code understandable.<br><br>Regarding functions and subroutines, I think I would need a bit more background on the earlier discussion. I'll be glad to help on this and perhaps a phone call with you and Jeff would be in order when convenient.<br><br><br>Steve Lionel<br>Intel Developer Support<br>Nashua, NH<br><br><br><br><br>_______________________________________________<br>mpi3-fortran mailing list<br><a href="mailto:mpi3-fortran@lists.mpi-forum.org" style="color: blue; text-decoration: underline; ">mpi3-fortran@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran" style="color: blue; text-decoration: underline; ">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran</a><o:p></o:p></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 12pt; font-family: 'Times New Roman', serif; "><o:p> </o:p></div></div>_______________________________________________<br>mpi3-fortran mailing list<br><a href="mailto:mpi3-fortran@lists.mpi-forum.org" style="color: blue; text-decoration: underline; ">mpi3-fortran@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran" style="color: blue; text-decoration: underline; ">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran</a><br></div></span></blockquote></div><br></body></html>