<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"><base href="x-msg://5284/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hubert,</div><div><br></div><div>This function belong to ticket #265 (<a href="https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/265">https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/265</a>) the one adding support for MPI_Count. I think the rationale was the following. If the "compatible" number of top-level elements is greater than an int (this is what MPI_Get_count can safely returns), then MPI_Get_count is supposed to return MPI_UNDEFINED, and the application should fallback on using MPI_Get_elements_X instead.</div><div><br></div><div>I thought I could provide an implementation for MPI_Get_count_X, but without knowledge about the MPI implementation, or an impressively costly MPI_Type_get_envelope/MPI_Type_get_contents I couldn't figure out how. Moreover, I don't think there is an easy way to distinguish if the MPI_UNDEFINED returned by MPI_Get_count is due to a lack of space for the return type or a mismatch in the size of the data.</div><div><br></div><div>This should be added to the growing list of things to be fixed post 3.0. Meanwhile, implement your own [expensive] way of parsing datatypes using MPI_Type_get_envelope/MPI_Type_get_contents if you want to implement a really portable library (aka supporting MPI_Count).</div><div><br></div><div>  george.</div><div><br></div><div>PS: MPI_Type_create_keyval can be helpful here in order to speed things up when a datatype is used multiple times.</div><div><br><div><div>On Aug 31, 2012, at 16:20 , Hubert Ritzdorf <<a href="mailto:Hubert.Ritzdorf@EMEA.NEC.COM">Hubert.Ritzdorf@EMEA.NEC.COM</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div ocsi="0" fpstyle="1" style="font-family: 'Courier New'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; "><div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi George,<br><br>I know MPI_Get_elements_x (). But Page 483 claims:<br><br>These functions modify the opaque part of status so that a call to<br>MPI_GET_ELEMENTS or MPI_GET_ELEMENTS_X will return count. MPI_GET_COUNT<br>will return a compatible value.<br><br>This will not work for large MPI_Count values provided by MPI_SET_ELEMENTS_X<br>(i.e. MPI_UNDEFINED is returned by MPI_Get_count() in significant use of MPI_SET_ELEMENT_X).<br>And Page 114 says that function MPI_Get_count has a different behavior than<br>MPI_GET_ELEMENTS/MPI_GET_ELEMENTS_X. Thus, MPI_GET_COUNT is not obsolete<br>and application has to develop a separate version of MPI_Get_count_x() if MPI_SET_ELEMENT_X<br>might be used in the application or a library.<br><br>Hubert<br><br><div style="font-family: 'Times New Roman'; font-size: 16px; "><hr tabindex="-1"><div id="divRpF484992" style="direction: ltr; "><font face="Tahoma" size="2"><b>From:</b><span class="Apple-converted-space"> </span><a href="mailto:mpi-comments-bounces@lists.mpi-forum.org">mpi-comments-bounces@lists.mpi-forum.org</a><span class="Apple-converted-space"> </span>[<a href="mailto:mpi-comments-bounces@lists.mpi-forum.org">mpi-comments-bounces@lists.mpi-forum.org</a>] on behalf of George Bosilca [<a href="mailto:bosilca@eecs.utk.edu">bosilca@eecs.utk.edu</a>]<br><b>Sent:</b><span class="Apple-converted-space"> </span>Friday, August 31, 2012 2:26 PM<br><b>To:</b><span class="Apple-converted-space"> </span>Comments on the MPI Standard<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [Mpi-comments] MPI_Get_count_x<br></font><br></div><div></div><div>MPI_Get_elements_x, chap Datatypes page 114 (current make cleandoc).<div><br></div><div>  george.</div><div><br><div><div>On Aug 31, 2012, at 13:45 , Hubert Ritzdorf <<a href="mailto:Hubert.Ritzdorf@EMEA.NEC.COM" target="_blank">Hubert.Ritzdorf@EMEA.NEC.COM</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: 'Courier New'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; "><div style="direction: ltr; font-family: Tahoma; font-size: 10pt; ">Hi,<br><br>I think, that function<span class="Apple-converted-space"> </span><br><br>MPI_Get_count_x (const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count)<br><br>is missing. After use of function MPI_Status_set_elements_x, MPI_Get_count is possibly not able<br>to return a compatible value. This is contradictory to Page 483, Lines 22-33.<br><br>Hubert<br><br><br><br></div>_______________________________________________<br>mpi-comments mailing list<br><a href="mailto:mpi-comments@lists.mpi-forum.org" target="_blank">mpi-comments@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments" target="_blank">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments</a></div></blockquote></div><br></div><br><br><font style="background-color: rgb(255, 255, 255); "><div style="margin-top: 0px; margin-bottom: 0px; "><font style="background-color: rgb(255, 255, 255); ">Click<span class="Apple-converted-space"> </span><a href="https://www.mailcontrol.com/sr/lGzi4c6egezTndxI!oX7UkkR2vxuiI13vs0Z85bSifOXOzDXd8zo8Mu3jtzAbPvtZhAszQEBXlpmYIqzE2R4VA==" target="_blank">here</a><span class="Apple-converted-space"> </span>to report this email as spam.</font></div></font></div></div></div>_______________________________________________<br>mpi-comments mailing list<br><a href="mailto:mpi-comments@lists.mpi-forum.org">mpi-comments@lists.mpi-forum.org</a><br><a href="http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments">http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments</a></div></blockquote></div><br></div></body></html>