Fix the datatype bug noticed by Rainer. Under some circumstances (and only for
predefined datatypes) the optimized description was set to NULL instead of pointing to some valid description. As for some data, having an optimized version is not possible (as no optimizations bring any benefit), we have to make sure this field (opt_desc) is always correctly initialized. This commit was SVN r10112.
Этот коммит содержится в:
родитель
9da7af4c96
Коммит
aa1c1e70c6
@ -418,6 +418,7 @@ int32_t ompi_convertor_set_position_nocheck( ompi_convertor_t* convertor,
|
||||
convertor->remote_size *= convertor->count; \
|
||||
convertor->use_desc = &(datatype->desc); \
|
||||
} \
|
||||
assert( NULL != convertor->use_desc->desc ); \
|
||||
\
|
||||
{ \
|
||||
uint32_t required_stack_length = datatype->btypes[DT_LOOP] + 1; \
|
||||
|
@ -55,16 +55,23 @@ static void __destroy_ddt_struct( ompi_datatype_t* datatype )
|
||||
{
|
||||
if( datatype->desc.desc != NULL ) {
|
||||
free( datatype->desc.desc );
|
||||
datatype->desc.desc = NULL;
|
||||
datatype->desc.length = 0;
|
||||
datatype->desc.used = 0;
|
||||
}
|
||||
if( datatype->opt_desc.desc != NULL ) {
|
||||
free( datatype->opt_desc.desc );
|
||||
datatype->opt_desc.desc = NULL;
|
||||
if( datatype->opt_desc.desc != datatype->desc.desc )
|
||||
free( datatype->opt_desc.desc );
|
||||
datatype->opt_desc.length = 0;
|
||||
datatype->opt_desc.used = 0;
|
||||
datatype->opt_desc.desc = NULL;
|
||||
}
|
||||
/**
|
||||
* As the default description and the optimized description can point to the
|
||||
* same memory location we should keep the default location pointer until we
|
||||
* know what we should do with the optimized description.
|
||||
*/
|
||||
datatype->desc.desc = NULL;
|
||||
|
||||
if( NULL != datatype->args ) {
|
||||
ompi_ddt_release_args( datatype );
|
||||
datatype->args = NULL;
|
||||
|
@ -396,6 +396,11 @@ int32_t ompi_ddt_init( void )
|
||||
|
||||
datatype->desc.length = 1;
|
||||
datatype->desc.used = 1;
|
||||
/* By default the optimized descritption is the same as the default
|
||||
* description for predefined datatypes.
|
||||
*/
|
||||
datatype->opt_desc = datatype->desc;
|
||||
|
||||
datatype->btypes[i] = 1;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user