From c9da782804ff267c0278820e02fa7d1a11ef194a Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Wed, 18 Oct 2006 17:33:01 +0000 Subject: [PATCH] Keep only one function to get the size of a datatype. This commit was SVN r12170. --- ompi/datatype/datatype.h | 2 -- ompi/mca/coll/tuned/coll_tuned_decision_fixed.c | 6 +++--- ompi/mca/coll/tuned/coll_tuned_reduce.c | 2 +- ompi/mpi/c/bindings.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ompi/datatype/datatype.h b/ompi/datatype/datatype.h index 4a90f40fd3..0060f45971 100644 --- a/ompi/datatype/datatype.h +++ b/ompi/datatype/datatype.h @@ -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. diff --git a/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c b/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c index 4a500f2b2a..642361b4cd 100644 --- a/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c +++ b/ompi/mca/coll/tuned/coll_tuned_decision_fixed.c @@ -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); diff --git a/ompi/mca/coll/tuned/coll_tuned_reduce.c b/ompi/mca/coll/tuned/coll_tuned_reduce.c index 2c5097752a..55374bc436 100644 --- a/ompi/mca/coll/tuned/coll_tuned_reduce.c +++ b/ompi/mca/coll/tuned/coll_tuned_reduce.c @@ -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; diff --git a/ompi/mpi/c/bindings.h b/ompi/mpi/c/bindings.h index 108af52527..a30cc3e5fb 100644 --- a/ompi/mpi/c/bindings.h +++ b/ompi/mpi/c/bindings.h @@ -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; \