1
1

Normally from the MPI point of view the count == 0 is LEGAL only for MPI_UB and MPI_LB. AND the MPI level

is responsible for checking this condition. At the datatype engine, I accept it just as a nice way to set
the soft UB for a data (without using a real UB marker). This approach can be used to create
the subarray and darray datatype. However from the MPI level this function should never be
called directly with a count set to 0.

This commit was SVN r4512.
Этот коммит содержится в:
George Bosilca 2005-02-23 08:20:01 +00:00
родитель a02e269d9d
Коммит 3e437bbd7b

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

@ -71,20 +71,25 @@ int ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd,
}
} else {
place_needed = pdtAdd->desc.used;
if( count != 1 ) place_needed += 2;
if( count != 1 ) place_needed += 2; /* for the loop markers */
}
/* the count == 0 is LEGAL for MPI_UB and MPI_LB */
/*
* the count == 0 is LEGAL only for MPI_UB and MPI_LB. I accept it just as a nice way to set
* the soft UB for a data (without using a real UB marker). This approach can be used to create
* the subarray and darray datatype. However from the MPI level this function should never be
* called directly with a count set to 0.
*/
if( count == 0 ) {
if( pdtBase->desc.used == 0 ) { /* empty datatype */
pdtBase->lb = 0;
pdtBase->ub = 0;
pdtBase->true_lb = 0;
pdtBase->true_ub = 0;
}
return 0;
} else
pdtBase->ub += disp;
return OMPI_SUCCESS;
}
/* compute the new memory alignement */
pdtBase->align = IMAX( pdtBase->align, pdtAdd->align );
@ -165,6 +170,7 @@ int ompi_ddt_add( dt_desc_t* pdtBase, const dt_desc_t* pdtAdd,
/* should I add some space until the extent of this datatype ? */
}
/* Recompute the new true_lb and true_ub */
if( 0 == pdtBase->nbElems ) old_true_ub = disp;
else old_true_ub = pdtBase->true_ub;
pdtBase->size += count * pdtAdd->size;