From f09d0118e4820279ca11185ef2933afb90ff56c9 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 14 Aug 2019 16:22:23 -0400 Subject: [PATCH] Fix a corner case for the datatype extent computation. It turns out that if a complex datatype built out of a single predefined type has been resized to the size of its predefined type, we miscompute the extent when creating other datatypes with the type. Provides a fix for #6899 for the 3.x branch. Signed-off-by: George Bosilca --- opal/datatype/opal_datatype_add.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opal/datatype/opal_datatype_add.c b/opal/datatype/opal_datatype_add.c index 146ce12afe2..5138c85b02f 100644 --- a/opal/datatype/opal_datatype_add.c +++ b/opal/datatype/opal_datatype_add.c @@ -3,7 +3,7 @@ * Copyright (c) 2004-2006 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2017 The University of Tennessee and The University + * Copyright (c) 2004-2019 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2006 High Performance Computing Center Stuttgart, @@ -300,7 +300,8 @@ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtA if( pdtAdd->ptypes[i] != 0 ) pdtBase->ptypes[i] += (count * pdtAdd->ptypes[i]); } if( (1 == pdtAdd->desc.used) && (extent == (pdtAdd->ub - pdtAdd->lb)) && - (extent == pdtAdd->desc.desc[0].elem.extent) ){ + (extent == pdtAdd->desc.desc[0].elem.extent) && + (extent == (pdtAdd->true_ub - pdtAdd->true_lb)) ) { pLast->elem = pdtAdd->desc.desc[0].elem; pLast->elem.count *= count; pLast->elem.disp += disp;