diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index d4ab2ce0c7..24b44f934c 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -4,6 +4,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -44,8 +45,6 @@ BEGIN_C_DECLS /* These flags are on top of the flags in opal_datatype.h */ /* Is the datatype predefined as MPI type (not necessarily as OPAL type, e.g. struct/block types) */ #define OMPI_DATATYPE_FLAG_PREDEFINED 0x0200 -/* Is the datatype suitable for one sided operations */ -#define OMPI_DATATYPE_FLAG_ONE_SIDED 0x0400 /* Keep trace of the type of the predefined datatypes */ #define OMPI_DATATYPE_FLAG_DATA_INT 0x1000 #define OMPI_DATATYPE_FLAG_DATA_FLOAT 0x2000 @@ -135,47 +134,6 @@ ompi_datatype_is_overlapped( const ompi_datatype_t* type ) return opal_datatype_is_overlapped(&type->super); } -static inline int32_t -ompi_datatype_is_acceptable_for_one_sided( const ompi_datatype_t* type __opal_attribute_unused__ ) -{ - /* 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 ompi_datatype_is_valid( const ompi_datatype_t* type ) { diff --git a/ompi/datatype/ompi_datatype_create.c b/ompi/datatype/ompi_datatype_create.c index e8fc2d0ec5..2bcbeca64c 100644 --- a/ompi/datatype/ompi_datatype_create.c +++ b/ompi/datatype/ompi_datatype_create.c @@ -9,6 +9,7 @@ * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -31,7 +32,6 @@ static void __ompi_datatype_allocate( ompi_datatype_t* datatype ) { - datatype->super.flags |= OMPI_DATATYPE_FLAG_ONE_SIDED; datatype->args = NULL; datatype->d_f_to_c_index = opal_pointer_array_add(&ompi_datatype_f_to_c_table, datatype); /* Later generated datatypes will have their id according to the Fortran ID, as ALL types are registered */ diff --git a/ompi/datatype/ompi_datatype_create_indexed.c b/ompi/datatype/ompi_datatype_create_indexed.c index acdb2b2eab..1d8eb6c9c9 100644 --- a/ompi/datatype/ompi_datatype_create_indexed.c +++ b/ompi/datatype/ompi_datatype_create_indexed.c @@ -12,6 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -109,11 +110,6 @@ int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const } ompi_datatype_add( pdt, oldType, dLength, disp, extent ); } - /* - * A datatype based on bytes displacements is not suitable for - * one sided communications. - */ - pdt->super.flags &= ~OMPI_DATATYPE_FLAG_ONE_SIDED; *newType = pdt; return OMPI_SUCCESS; } diff --git a/ompi/datatype/ompi_datatype_create_struct.c b/ompi/datatype/ompi_datatype_create_struct.c index 0c15babc7b..e03cdfc941 100644 --- a/ompi/datatype/ompi_datatype_create_struct.c +++ b/ompi/datatype/ompi_datatype_create_struct.c @@ -12,6 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -90,11 +91,6 @@ int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const O } ompi_datatype_add( pdt, lastType, lastBlock, lastDisp, lastExtent ); - /* - * A datatype based on bytes displacements is not suitable for - * one sided communications. - */ - pdt->super.flags &= ~OMPI_DATATYPE_FLAG_ONE_SIDED; *newType = pdt; return OMPI_SUCCESS; } diff --git a/ompi/datatype/ompi_datatype_create_vector.c b/ompi/datatype/ompi_datatype_create_vector.c index f39d63aa2c..a4b2aaf67a 100644 --- a/ompi/datatype/ompi_datatype_create_vector.c +++ b/ompi/datatype/ompi_datatype_create_vector.c @@ -12,6 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -91,11 +92,6 @@ int32_t ompi_datatype_create_hvector( int count, int bLength, OPAL_PTRDIFF_TYPE OBJ_RELEASE( pTempData ); } } - /* - * A datatype based on bytes displacements is not suitable for - * one sided communications. - */ - pData->super.flags &= ~OMPI_DATATYPE_FLAG_ONE_SIDED; *newType = pData; return OMPI_SUCCESS; } diff --git a/ompi/datatype/ompi_datatype_internal.h b/ompi/datatype/ompi_datatype_internal.h index 4f66eabfbc..e1ad4488f3 100644 --- a/ompi/datatype/ompi_datatype_internal.h +++ b/ompi/datatype/ompi_datatype_internal.h @@ -4,6 +4,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -300,7 +301,6 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX { /*ompi_predefined_datatype_t*/ \ { /* ompi_datatype_t */ \ OMPI_DATATYPE_INITIALIZER_ ## TYPE (OMPI_DATATYPE_FLAG_PREDEFINED | \ - OMPI_DATATYPE_FLAG_ONE_SIDED | \ (FLAGS)) /*super*/, \ OMPI_DATATYPE_EMPTY_DATA(NAME) /*id,d_f_to_c_index,d_keyhash,args,packed_description,name*/ \ }, \ @@ -350,7 +350,6 @@ extern const ompi_datatype_t* ompi_datatype_basicDatatypes[OMPI_DATATYPE_MPI_MAX OPAL_OBJ_STATIC_INIT(opal_datatype_t), \ OPAL_DATATYPE_FLAG_BASIC | \ OMPI_DATATYPE_FLAG_PREDEFINED | \ - OMPI_DATATYPE_FLAG_ONE_SIDED | \ OMPI_DATATYPE_FLAG_DATA_FORTRAN | (FLAGS) /*flag*/, \ OPAL_DATATYPE_ ## TYPE ## SIZE /*id*/, \ (((uint32_t)1)<<(OPAL_DATATYPE_ ## TYPE ## SIZE)) /*bdt_used*/, \ diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index 32ac80431b..d573abc95f 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2007-2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * $COPYRIGHT$ @@ -356,7 +356,7 @@ opal_pointer_array_t ompi_datatype_f_to_c_table; ompi_datatype_commit( &ptype ); \ COPY_DATA_DESC( PDATA, ptype ); \ (PDATA)->super.flags &= ~OPAL_DATATYPE_FLAG_PREDEFINED; \ - (PDATA)->super.flags |= (OMPI_DATATYPE_FLAG_PREDEFINED|OMPI_DATATYPE_FLAG_ONE_SIDED); \ + (PDATA)->super.flags |= OMPI_DATATYPE_FLAG_PREDEFINED; \ ptype->super.desc.desc = NULL; \ ptype->super.opt_desc.desc = NULL; \ OBJ_RELEASE( ptype ); \ diff --git a/ompi/mpi/c/bindings.h b/ompi/mpi/c/bindings.h index 1292c57ce8..903382cce4 100644 --- a/ompi/mpi/c/bindings.h +++ b/ompi/mpi/c/bindings.h @@ -9,6 +9,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. + * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -67,7 +68,6 @@ BEGIN_C_DECLS else if( (COUNT) < 0 ) (RC) = MPI_ERR_COUNT; \ else if( !opal_datatype_is_committed(&((DDT)->super)) ) (RC) = MPI_ERR_TYPE; \ else if( opal_datatype_is_overlapped(&((DDT)->super)) ) (RC) = MPI_ERR_TYPE; \ - else if( !ompi_datatype_is_acceptable_for_one_sided(DDT)) (RC) = MPI_ERR_TYPE; \ else if( !opal_datatype_is_valid(&((DDT)->super)) ) (RC) = MPI_ERR_TYPE; \ } while(0)