1
1

This is the real fix for ticket 317 and ticket 1065 and ticket 278.

This commit was SVN r16084.
Этот коммит содержится в:
George Bosilca 2007-09-10 22:27:59 +00:00
родитель 8622beda54
Коммит 8659a864e9

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

@ -87,33 +87,33 @@ int32_t ompi_ddt_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd,
*/ */
if( extent == -1 ) extent = (pdtAdd->ub - pdtAdd->lb); if( extent == -1 ) extent = (pdtAdd->ub - pdtAdd->lb);
if( pdtAdd->flags & DT_FLAG_PREDEFINED ) { /* add a basic datatype */ /* handle special cases for DT_LB and DT_UB and their duplicate */
/* handle special cases for DT_LB and DT_UB */ if( DT_LB == pdtAdd->id ) {
if( DT_LB == pdtAdd->id ) { pdtBase->bdt_used |= (((uint64_t)1) << DT_LB);
pdtBase->bdt_used |= (((uint64_t)1) << DT_LB); if( pdtBase->flags & DT_FLAG_USER_LB ) {
if( pdtBase->flags & DT_FLAG_USER_LB ) { pdtBase->lb = LMIN( pdtBase->lb, disp );
pdtBase->lb = LMIN( pdtBase->lb, disp ); } else {
} else { pdtBase->lb = disp;
pdtBase->lb = disp; pdtBase->flags |= DT_FLAG_USER_LB;
pdtBase->flags |= DT_FLAG_USER_LB;
}
if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) {
pdtBase->flags &= ~DT_FLAG_NO_GAPS;
}
return OMPI_SUCCESS;
} else if( DT_UB == pdtAdd->id ) {
pdtBase->bdt_used |= (((uint64_t)1) << DT_UB);
if( pdtBase->flags & DT_FLAG_USER_UB ) {
pdtBase->ub = LMAX( pdtBase->ub, disp );
} else {
pdtBase->ub = disp;
pdtBase->flags |= DT_FLAG_USER_UB;
}
if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) {
pdtBase->flags &= ~DT_FLAG_NO_GAPS;
}
return OMPI_SUCCESS;
} }
if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) {
pdtBase->flags &= ~DT_FLAG_NO_GAPS;
}
return OMPI_SUCCESS;
} else if( DT_UB == pdtAdd->id ) {
pdtBase->bdt_used |= (((uint64_t)1) << DT_UB);
if( pdtBase->flags & DT_FLAG_USER_UB ) {
pdtBase->ub = LMAX( pdtBase->ub, disp );
} else {
pdtBase->ub = disp;
pdtBase->flags |= DT_FLAG_USER_UB;
}
if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) {
pdtBase->flags &= ~DT_FLAG_NO_GAPS;
}
return OMPI_SUCCESS;
}
if( pdtAdd->flags & DT_FLAG_PREDEFINED ) { /* add a basic datatype */
place_needed = (extent == (ptrdiff_t)pdtAdd->size ? 1 : 3); place_needed = (extent == (ptrdiff_t)pdtAdd->size ? 1 : 3);
} else { } else {
place_needed = pdtAdd->desc.used; place_needed = pdtAdd->desc.used;