Skip to content

Commit b77ee56

Browse files
committed
datatype_optimize: keep 0-extent instances
Do not remove 0-extent instances while optimizing the datatype. This is a distillation of a larger set of DDT bug fixes and optimizations from master. George tried to cherry-pick these fixes+optimizations back to the v3.0.x/v3.1.x branches and it resulted in a giant list of heavily-modified cherry-picked commits (see #6978). This did not seem like a good idea. George therefore distilled the critical bug fix down to this small commit, suitable for both the v3.0.x/v3.1.x branches. See #7019 (comment) for details. Signed-off-by: Jeff Squyres <[email protected]>
1 parent 23d53f9 commit b77ee56

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)