From e8c358c1880bd6c6c569d7923da317e0154c139e Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Mon, 5 Mar 2012 14:10:26 +0000 Subject: [PATCH] Allow Open MPI to deal with size_t internally. This commit was SVN r26097. --- ompi/datatype/ompi_datatype.h | 14 +++++++++++--- ompi/mca/coll/tuned/coll_tuned_util.c | 8 ++++---- ompi/mca/coll/tuned/coll_tuned_util.h | 20 ++++++++++---------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index 3e09a3bb17..5ad05a29c3 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- */ /* - * Copyright (c) 2009-2010 The University of Tennessee and The University + * Copyright (c) 2009-2012 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. @@ -278,10 +278,18 @@ ompi_datatype_set_element_count( const ompi_datatype_t* type, uint32_t count, si } static inline int32_t -ompi_datatype_copy_content_same_ddt( const ompi_datatype_t* type, int32_t count, +ompi_datatype_copy_content_same_ddt( const ompi_datatype_t* type, size_t count, char* pDestBuf, char* pSrcBuf ) { - return opal_datatype_copy_content_same_ddt( &type->super, count, pDestBuf, pSrcBuf ); + int32_t length, rc; + + while( 0 != count ) { + length = INT_MAX; + if( ((size_t)length) > count ) length = (int32_t)count; + rc = opal_datatype_copy_content_same_ddt( &type->super, count, pDestBuf, pSrcBuf ); + if( 0 != rc ) return rc; + count -= (size_t)length; + } } OMPI_DECLSPEC const ompi_datatype_t* ompi_datatype_match_size( int size, uint16_t datakind, uint16_t datalang ); diff --git a/ompi/mca/coll/tuned/coll_tuned_util.c b/ompi/mca/coll/tuned/coll_tuned_util.c index e216842e09..1c37b53741 100644 --- a/ompi/mca/coll/tuned/coll_tuned_util.c +++ b/ompi/mca/coll/tuned/coll_tuned_util.c @@ -27,10 +27,10 @@ #include "ompi/mca/pml/pml.h" #include "coll_tuned_util.h" -int ompi_coll_tuned_sendrecv_actual( void* sendbuf, int scount, +int ompi_coll_tuned_sendrecv_actual( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, @@ -96,10 +96,10 @@ int ompi_coll_tuned_sendrecv_actual( void* sendbuf, int scount, * version when available */ -int ompi_coll_tuned_sendrecv_actual_localcompleted( void* sendbuf, int scount, +int ompi_coll_tuned_sendrecv_actual_localcompleted( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, diff --git a/ompi/mca/coll/tuned/coll_tuned_util.h b/ompi/mca/coll/tuned/coll_tuned_util.h index c11d1446c4..5bd86e948c 100644 --- a/ompi/mca/coll/tuned/coll_tuned_util.h +++ b/ompi/mca/coll/tuned/coll_tuned_util.h @@ -30,10 +30,10 @@ BEGIN_C_DECLS /* prototypes */ -int ompi_coll_tuned_sendrecv_actual( void* sendbuf, int scount, +int ompi_coll_tuned_sendrecv_actual( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, @@ -43,9 +43,9 @@ int ompi_coll_tuned_sendrecv_actual( void* sendbuf, int scount, /* inline functions */ static inline int -ompi_coll_tuned_sendrecv( void* sendbuf, int scount, ompi_datatype_t* sdatatype, +ompi_coll_tuned_sendrecv( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, ompi_datatype_t* rdatatype, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, ompi_status_public_t* status, int myid ) @@ -61,10 +61,10 @@ ompi_coll_tuned_sendrecv( void* sendbuf, int scount, ompi_datatype_t* sdatatype, } int -ompi_coll_tuned_sendrecv_actual_localcompleted( void* sendbuf, int scount, +ompi_coll_tuned_sendrecv_actual_localcompleted( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, @@ -74,10 +74,10 @@ ompi_coll_tuned_sendrecv_actual_localcompleted( void* sendbuf, int scount, /* inline functions */ static inline int -ompi_coll_tuned_sendrecv_localcompleted( void* sendbuf, int scount, +ompi_coll_tuned_sendrecv_localcompleted( void* sendbuf, size_t scount, ompi_datatype_t* sdatatype, int dest, int stag, - void* recvbuf, int rcount, + void* recvbuf, size_t rcount, ompi_datatype_t* rdatatype, int source, int rtag, struct ompi_communicator_t* comm, @@ -98,9 +98,9 @@ ompi_coll_tuned_sendrecv_localcompleted( void* sendbuf, int scount, /* inline functions */ static inline int -ompi_coll_tuned_isendrecv( void* sendbuf, int scount, ompi_datatype_t* sdtype, +ompi_coll_tuned_isendrecv( void* sendbuf, size_t scount, ompi_datatype_t* sdtype, int dest, int stag, ompi_request_t** sreq, - void* recvbuf, int rcount, ompi_datatype_t* rdtype, + void* recvbuf, size_t rcount, ompi_datatype_t* rdtype, int source, int rtag, ompi_request_t** rreq, struct ompi_communicator_t* comm ) { int ret, line;