Keep only one function to get the size of a datatype.
This commit was SVN r12170.
Этот коммит содержится в:
родитель
3db5c0487d
Коммит
c9da782804
@ -185,8 +185,6 @@ static inline int32_t ompi_ddt_get_extent( const ompi_datatype_t* pData, ptrdiff
|
||||
{ *lb = pData->lb; *extent = pData->ub - pData->lb; return 0; }
|
||||
static inline int32_t ompi_ddt_get_true_extent( const ompi_datatype_t* pData, ptrdiff_t* true_lb, ptrdiff_t* true_extent)
|
||||
{ *true_lb = pData->true_lb; *true_extent = (pData->true_ub - pData->true_lb); return 0; }
|
||||
static inline int32_t ompi_ddt_get_size( const ompi_datatype_t* pData, size_t* size )
|
||||
{ *size = pData->size; return 0; }
|
||||
/*
|
||||
* This function return true (1) if the datatype representation depending on the count
|
||||
* is contiguous in the memory. And false (0) otherwise.
|
||||
|
@ -74,7 +74,7 @@ int ompi_coll_tuned_alltoall_intra_dec_fixed(void *sbuf, int scount,
|
||||
}
|
||||
|
||||
/* else we need data size for decision function */
|
||||
err = ompi_ddt_get_size (sdtype, &dsize);
|
||||
err = ompi_ddt_type_size(sdtype, &dsize);
|
||||
if (err != MPI_SUCCESS) {
|
||||
OPAL_OUTPUT((ompi_coll_tuned_stream,"%s:%4d\tError occurred %d, rank %2d", __FILE__,__LINE__,err,rank));
|
||||
return (err);
|
||||
@ -138,7 +138,7 @@ int ompi_coll_tuned_bcast_intra_dec_fixed(void *buff, int count,
|
||||
rank = ompi_comm_rank(comm);
|
||||
|
||||
/* else we need data size for decision function */
|
||||
err = ompi_ddt_get_size (datatype, &dsize);
|
||||
err = ompi_ddt_type_size(datatype, &dsize);
|
||||
if (err != MPI_SUCCESS) {
|
||||
OPAL_OUTPUT((ompi_coll_tuned_stream,"%s:%4d\tError occurred %d, rank %2d", __FILE__,__LINE__,err,rank));
|
||||
return (err);
|
||||
@ -195,7 +195,7 @@ int ompi_coll_tuned_reduce_intra_dec_fixed( void *sendbuf, void *recvbuf,
|
||||
rank = ompi_comm_rank(comm);
|
||||
|
||||
/* need data size for decision function */
|
||||
err = ompi_ddt_get_size (datatype, &dsize);
|
||||
err = ompi_ddt_type_size(datatype, &dsize);
|
||||
if (err != MPI_SUCCESS) {
|
||||
OPAL_OUTPUT((ompi_coll_tuned_stream,"%s:%4d\tError occurred %d, rank %2d", __FILE__,__LINE__,err,rank));
|
||||
return (err);
|
||||
|
@ -85,7 +85,7 @@ int ompi_coll_tuned_reduce_intra_chain( void *sendbuf, void *recvbuf, int count,
|
||||
/* Determine number of segments and number of elements
|
||||
sent per operation */
|
||||
ompi_ddt_get_extent( datatype, &lb, &ext );
|
||||
ompi_ddt_get_size( datatype, &typelng );
|
||||
ompi_ddt_type_size( datatype, &typelng );
|
||||
if( segsize > typelng ) {
|
||||
segcount = segsize/typelng;
|
||||
num_segments = count/segcount;
|
||||
|
@ -83,7 +83,7 @@ extern "C" {
|
||||
size_t size = 0; \
|
||||
ptrdiff_t true_lb = 0; \
|
||||
ptrdiff_t true_extended = 0; \
|
||||
ompi_ddt_get_size((DDT), &size); \
|
||||
ompi_ddt_type_size((DDT), &size); \
|
||||
ompi_ddt_get_true_extent((DDT), &true_lb, &true_extended); \
|
||||
if ( 0 < size && 0 == true_lb ) { \
|
||||
(RC) = MPI_ERR_BUFFER; \
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user