From b226af1176b195dcf7b540a4c873e753563d5ef4 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 8 Jul 2005 07:00:18 +0000 Subject: [PATCH] Tolerate the datatype with ZERO elements. They can have an optimized expression (sic!) ... Anyway there is a warning message when we try to pack suck kind of datatypes. This commit was SVN r6388. --- ompi/datatype/dt_optimize.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ompi/datatype/dt_optimize.c b/ompi/datatype/dt_optimize.c index 0d5bc81520..e5f7f0dd7e 100644 --- a/ompi/datatype/dt_optimize.c +++ b/ompi/datatype/dt_optimize.c @@ -38,9 +38,6 @@ int32_t ompi_ddt_optimize_short( ompi_datatype_t* pData, int32_t count, long total_disp = 0; int32_t optimized = 0; - /* Contiguous datatypes does not have to get optimized */ - assert( (pData->flags & DT_FLAG_CONTIGUOUS) == 0 ); - /* If there is no datatype description how can we have an optimized description ? */ if( (count == 0) || (pData->desc.used == 0) ) { pTypeDesc->length = 0; @@ -49,6 +46,9 @@ int32_t ompi_ddt_optimize_short( ompi_datatype_t* pData, int32_t count, return 1; } + /* Contiguous datatypes does not have to get optimized */ + assert( (pData->flags & DT_FLAG_CONTIGUOUS) == 0 ); + pStack = alloca( sizeof(dt_stack_t) * (pData->btypes[DT_LOOP]+2) ); SAVE_STACK( pStack, -1, 0, count, 0, pData->desc.used );