1
1
This commit adds a lengthy comment in ompi_datatype.h that explains
why a one-sided datatype check was removed.  The short version is that
we do have to allow some datatypes that may be unwise to use (e.g.,
"h" types of datatypes that have offsets in bytes -- MPI says it's ok
to use these), and our DDT engine can't currently detect datatypes
with absolute offsets, which MPI says it's ''not'' ok to use with
one-sided operations.  Hence, we don't check for some datatypes that
are invalid to use with one-sided operations, and erroneous programs
may crash and burn.  Life is hard.

The main point of this commit is that we now do allow datatypes for
one-sided operations that are supposed to be allowed.

This commit was SVN r22641.

The following Trac tickets were found above:
  Ticket 2233 --> https://svn.open-mpi.org/trac/ompi/ticket/2233
Этот коммит содержится в:
Jeff Squyres 2010-02-17 20:16:55 +00:00
родитель 17f0885f12
Коммит 898eedd78f

Просмотреть файл

@ -138,7 +138,42 @@ ompi_datatype_is_overlapped( const ompi_datatype_t* type )
static inline int32_t
ompi_datatype_is_acceptable_for_one_sided( const ompi_datatype_t* type )
{
return (type->super.flags & OMPI_DATATYPE_FLAG_ONE_SIDED);
/* Please see https://svn.open-mpi.org/trac/ompi/ticket/2233.
This function used to check for the
OMPI_DATATYPE_FLAG_ONE_SIDED flag on the .flags of the
datatype, i.e.:
return (type->super.flags & OMPI_DATATYPE_FLAG_ONE_SIDED);
However, after lengthy discussions between George and Brian,
the conclusion was that the current DDT engine (as of r22640)
does not support checking for what the MPI spec defines as
invalid datatypes for one-sided operations.
The DDT engine currently sets the _ONE_SIDED flag on datatypes
that have offsets expressed in bytes (vs. offsets expressed in
items). Such datatypes actually *are* valid for use with
one-sided operations, but are not portable (and therefore are
not recommended).
The DDT engine cannot currently check for *absolute* offsets,
which are not valid for MPI one-sided operations. Hence, since
we effectively can't check for invalid-for-one-sided-operations
datatypes, just always return 1/true (i.e., that this datatype
is acceptable for one-sided operations).
Maybe someday someone will write a better check that can look
for absolute offsets, and therefore this function would have
some meaning again. :-) This function therefore only still
exists for this future possibility. Since it's an inline
function that returns a constant, any optimizing compiler worth
its salt will simply optimize it out. So we figured it was
safe to leave this function, especially since it gives a
convenient location to put this lengthy explanation/comment.
:-)
*/
return 1;
}
static inline int32_t