Re: [Mpi-comments] MPI_Get_count_x
Hubert, This function belong to ticket #265 (https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/265) 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. 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. 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). george. PS: MPI_Type_create_keyval can be helpful here in order to speed things up when a datatype is used multiple times. On Aug 31, 2012, at 16:20 , Hubert Ritzdorf <[email protected]> wrote:
Hi George,
I know MPI_Get_elements_x (). But Page 483 claims:
These functions modify the opaque part of status so that a call to MPI_GET_ELEMENTS or MPI_GET_ELEMENTS_X will return count. MPI_GET_COUNT will return a compatible value.
This will not work for large MPI_Count values provided by MPI_SET_ELEMENTS_X (i.e. MPI_UNDEFINED is returned by MPI_Get_count() in significant use of MPI_SET_ELEMENT_X). And Page 114 says that function MPI_Get_count has a different behavior than MPI_GET_ELEMENTS/MPI_GET_ELEMENTS_X. Thus, MPI_GET_COUNT is not obsolete and application has to develop a separate version of MPI_Get_count_x() if MPI_SET_ELEMENT_X might be used in the application or a library.
Hubert
From: [email protected] [[email protected]] on behalf of George Bosilca [[email protected]] Sent: Friday, August 31, 2012 2:26 PM To: Comments on the MPI Standard Subject: Re: [Mpi-comments] MPI_Get_count_x
MPI_Get_elements_x, chap Datatypes page 114 (current make cleandoc).
george.
On Aug 31, 2012, at 13:45 , Hubert Ritzdorf <[email protected]> wrote:
Hi,
I think, that function
MPI_Get_count_x (const MPI_Status *status, MPI_Datatype datatype, MPI_Count *count)
is missing. After use of function MPI_Status_set_elements_x, MPI_Get_count is possibly not able to return a compatible value. This is contradictory to Page 483, Lines 22-33.
Hubert
_______________________________________________ mpi-comments mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments
Click here to report this email as spam. _______________________________________________ mpi-comments mailing list [email protected] http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-comments
participants (1)
-
George Bosilca