diff --git a/ompi/datatype/datatype.h b/ompi/datatype/datatype.h index 1b663a548e..64b6bb979d 100644 --- a/ompi/datatype/datatype.h +++ b/ompi/datatype/datatype.h @@ -59,7 +59,7 @@ OMPI_DECLSPEC extern ompi_pointer_array_t *ompi_datatype_f_to_c_table; #define DT_FLAG_USER_LB 0x0010 /**< has a user defined LB */ #define DT_FLAG_USER_UB 0x0020 /**< has a user defined UB */ #define DT_FLAG_PREDEFINED 0x0040 /**< cannot be removed: initial and predefined datatypes */ -#define DT_FLAG_NO_GAPS 0x0080 /**< we are inside a loop */ +#define DT_FLAG_NO_GAPS 0x0080 /**< no gaps around the datatype */ #define DT_FLAG_DATA 0x0100 /**< data or control structure */ #define DT_FLAG_ONE_SIDED 0x0200 /**< datatype can be used for one sided operations */ #define DT_FLAG_UNAVAILABLE 0x0400 /**< datatypes unavailable on the build (OS or compiler dependant) */ diff --git a/ompi/datatype/dt_add.c b/ompi/datatype/dt_add.c index f1d3651fac..7511659def 100644 --- a/ompi/datatype/dt_add.c +++ b/ompi/datatype/dt_add.c @@ -293,9 +293,9 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, } /* Is the data still contiguous ? - * The only way for the data to be contiguous is to have the true extent equal to his size. - * In other words to avoid having internal gaps between elements. If any of the data are - * overlapping then this method will not work. + * The only way for the data to be contiguous is to have the true extent + * equal to his size. In other words to avoid having internal gaps between + * elements. If any of the data are overlapping then this method will not work. */ localFlags = pdtBase->flags & pdtAdd->flags; UNSET_CONTIGUOUS_FLAG(pdtBase->flags); @@ -307,7 +307,7 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, * type have to match */ || (count < 2)) ) { /* - if the count is bigger than 2 */ SET_CONTIGUOUS_FLAG(pdtBase->flags); - if( ((long)pdtAdd->size) == extent ) + if( ((long)pdtBase->size) == (pdtBase->ub - pdtBase->lb) ) SET_NO_GAP_FLAG(pdtBase->flags); } }