1
1

Allow a block indexed type with a count of zero. Be user friendly and set the ub, lb,

true_lb as well as the true_ub to zero in this case.

This commit was SVN r10208.
Этот коммит содержится в:
George Bosilca 2006-06-05 21:16:57 +00:00
родитель 4882dc0e2c
Коммит 07fb4b8012
2 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -100,7 +100,10 @@ int32_t ompi_ddt_create_indexed_block( int count, int bLength, const int* pDisp,
if( (count == 0) || (bLength == 0) ) {
*newType = ompi_ddt_create(1);
ompi_ddt_add( *newType, oldType, 0, pDisp[0] * extent, extent );
if( 0 == count )
ompi_ddt_add( *newType, &ompi_mpi_datatype_null, 0, 0, 0 );
else
ompi_ddt_add( *newType, oldType, 0, pDisp[0] * extent, extent );
return OMPI_SUCCESS;
}
pdt = ompi_ddt_create( count * (2 + oldType->desc.used) );

Просмотреть файл

@ -45,7 +45,7 @@ int MPI_Type_create_indexed_block(int count,
if( count < 0 ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT,
FUNC_NAME);
} else if( blocklength < 0 || NULL == array_of_displacements) {
} else if( (count > 0) && (blocklength < 0 || NULL == array_of_displacements) ) {
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG,
FUNC_NAME );
} else if (NULL == oldtype || MPI_DATATYPE_NULL == oldtype ||