Allow the creation of strcutres with count zero. And try to have a more friendly behavior
(even if I don't agree with it) by setting the lb, ub, true_lb and true_ub to zero. This commit was SVN r10205.
Этот коммит содержится в:
родитель
d7fa11d576
Коммит
e50cdeb927
@ -30,6 +30,7 @@ int32_t ompi_ddt_create_struct( int count, const int* pBlockLength, const long*
|
||||
|
||||
if( 0 == count ) {
|
||||
*newType = ompi_ddt_create( disp );
|
||||
ompi_ddt_add( *newType, &ompi_mpi_datatype_null, 0, 0, 0);
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,9 @@ int MPI_Type_create_struct(int count,
|
||||
if( count < 0 ) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_COUNT,
|
||||
FUNC_NAME);
|
||||
} else if(NULL == array_of_blocklengths ||
|
||||
NULL == array_of_displacements ||
|
||||
NULL == array_of_types) {
|
||||
} else if( (count > 0) && (NULL == array_of_blocklengths ||
|
||||
NULL == array_of_displacements ||
|
||||
NULL == array_of_types) ) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_ARG, FUNC_NAME);
|
||||
} else if (NULL == newtype) {
|
||||
return OMPI_ERRHANDLER_INVOKE(MPI_COMM_WORLD, MPI_ERR_TYPE, FUNC_NAME);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user