Skip to content

Commit 2d6e64d

Browse files
authored
Merge pull request #7024 from jsquyres/pr/v3.0.x/small-ddt-optimization-fix
v3.0.x: datatype_optimize: keep 0-extent instances
2 parents c7ddec9 + 6d25d48 commit 2d6e64d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

opal/datatype/opal_datatype_optimize.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ opal_datatype_optimize_short( opal_datatype_t* pData,
210210
continuity = ((last_disp + (ptrdiff_t)last_length * (ptrdiff_t)opal_datatype_basicDatatypes[last_type]->size)
211211
== (total_disp + pData->desc.desc[pos_desc].elem.disp));
212212

213-
if( (pData->desc.desc[pos_desc].elem.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) && continuity &&
213+
if( ((pData->desc.desc[pos_desc].elem.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) && continuity) &&
214+
((0 == last_length) || (last_extent == (int32_t)opal_datatype_basicDatatypes[last_type]->size)) &&
214215
(pData->desc.desc[pos_desc].elem.extent == (int32_t)opal_datatype_basicDatatypes[type]->size) ) {
215216
if( type == last_type ) {
216217
last_length += pData->desc.desc[pos_desc].elem.count;

0 commit comments

Comments
 (0)