From fa5cd0dbe5d261bd9d2cc61d5b305b4ef6a2dda6 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Wed, 19 Apr 2017 13:02:15 +0900 Subject: [PATCH] use ptrdiff_t instead of OPAL_PTRDIFF_TYPE since Open MPI now requires a C99, and ptrdiff_t type is part of C99, there is no more need for the abstract OPAL_PTRDIFF_TYPE type. Signed-off-by: Gilles Gouaillardet --- ompi/datatype/ompi_datatype.h | 32 ++++++------ ompi/datatype/ompi_datatype_args.c | 38 +++++++------- ompi/datatype/ompi_datatype_create_indexed.c | 14 ++--- ompi/datatype/ompi_datatype_create_struct.c | 6 ++- ompi/datatype/ompi_datatype_create_vector.c | 8 +-- ompi/datatype/ompi_datatype_module.c | 16 +++--- ompi/include/mpi.h.in | 4 +- ompi/include/ompi/memchecker.h | 10 ++-- ompi/mca/coll/base/coll_base_allreduce.c | 6 +-- ompi/mca/coll/base/coll_base_alltoall.c | 6 +-- ompi/mca/coll/base/coll_base_alltoallv.c | 4 +- ompi/mca/coll/libnbc/nbc_iallreduce.c | 2 +- ompi/mca/coll/libnbc/nbc_internal.h | 4 +- .../mca/common/ompio/common_ompio_file_open.c | 6 +-- .../mca/common/ompio/common_ompio_file_view.c | 10 ++-- .../common/ompio/common_ompio_file_write.c | 8 +-- ompi/mca/fbtl/posix/fbtl_posix_preadv.c | 4 +- ompi/mca/fbtl/posix/fbtl_posix_pwritev.c | 4 +- ompi/mca/fbtl/pvfs2/fbtl_pvfs2_preadv.c | 4 +- ompi/mca/fbtl/pvfs2/fbtl_pvfs2_pwritev.c | 4 +- ompi/mca/fcoll/base/fcoll_base_coll_array.c | 14 ++--- .../dynamic/fcoll_dynamic_file_read_all.c | 18 ++++--- .../dynamic/fcoll_dynamic_file_write_all.c | 20 +++---- .../fcoll_dynamic_gen2_file_read_all.c | 18 ++++--- .../fcoll_dynamic_gen2_file_write_all.c | 16 +++--- .../fcoll/static/fcoll_static_file_read_all.c | 20 +++---- .../static/fcoll_static_file_write_all.c | 20 +++---- .../two_phase/fcoll_two_phase_file_read_all.c | 8 +-- .../fcoll_two_phase_file_write_all.c | 8 +-- ompi/mca/fs/pvfs2/fs_pvfs2_file_open.c | 4 +- ompi/mca/io/ompio/io_ompio.c | 14 ++--- ompi/mca/io/ompio/io_ompio.h | 4 +- ompi/mca/osc/base/osc_base_obj_convert.c | 4 +- ompi/mca/osc/osc.h | 22 ++++---- ompi/mca/osc/portals4/osc_portals4.h | 22 ++++---- ompi/mca/osc/portals4/osc_portals4_comm.c | 52 +++++++++---------- ompi/mca/osc/pt2pt/osc_pt2pt.h | 18 +++---- ompi/mca/osc/pt2pt/osc_pt2pt_comm.c | 34 ++++++------ ompi/mca/osc/rdma/osc_rdma_accumulate.c | 10 ++-- ompi/mca/osc/rdma/osc_rdma_accumulate.h | 10 ++-- ompi/mca/osc/rdma/osc_rdma_comm.c | 14 ++--- ompi/mca/osc/rdma/osc_rdma_comm.h | 12 +++-- ompi/mca/osc/sm/osc_sm.h | 18 +++---- ompi/mca/osc/sm/osc_sm_comm.c | 18 +++---- ompi/patterns/comm/allgather.c | 4 +- ompi/patterns/comm/allreduce.c | 4 +- opal/datatype/opal_convertor.c | 8 +-- opal/datatype/opal_convertor.h | 4 +- opal/datatype/opal_convertor_internal.h | 10 ++-- opal/datatype/opal_convertor_raw.c | 8 +-- opal/datatype/opal_copy_functions.c | 24 ++++----- .../opal_copy_functions_heterogeneous.c | 42 +++++++-------- opal/datatype/opal_datatype.h | 34 ++++++------ opal/datatype/opal_datatype_add.c | 30 ++++++----- opal/datatype/opal_datatype_copy.c | 6 +-- opal/datatype/opal_datatype_copy.h | 12 ++--- opal/datatype/opal_datatype_fake_stack.c | 8 +-- opal/datatype/opal_datatype_internal.h | 12 +++-- opal/datatype/opal_datatype_optimize.c | 20 +++---- opal/datatype/opal_datatype_pack.c | 26 +++++----- opal/datatype/opal_datatype_pack.h | 4 +- opal/datatype/opal_datatype_position.c | 10 ++-- opal/datatype/opal_datatype_resize.c | 6 +-- opal/datatype/opal_datatype_unpack.c | 18 ++++--- opal/datatype/opal_datatype_unpack.h | 4 +- test/datatype/ddt_pack.c | 10 ++-- test/datatype/opal_datatype_test.c | 10 ++-- test/datatype/opal_ddt_lib.c | 38 +++++++------- 68 files changed, 495 insertions(+), 445 deletions(-) diff --git a/ompi/datatype/ompi_datatype.h b/ompi/datatype/ompi_datatype.h index 15284f1fd3..a87a8bdde3 100644 --- a/ompi/datatype/ompi_datatype.h +++ b/ompi/datatype/ompi_datatype.h @@ -7,7 +7,7 @@ * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -167,7 +167,7 @@ OMPI_DECLSPEC int32_t ompi_datatype_destroy( ompi_datatype_t** type); */ static inline int32_t ompi_datatype_add( ompi_datatype_t* pdtBase, const ompi_datatype_t* pdtAdd, uint32_t count, - OPAL_PTRDIFF_TYPE disp, OPAL_PTRDIFF_TYPE extent ) + ptrdiff_t disp, ptrdiff_t extent ) { return opal_datatype_add( &pdtBase->super, &pdtAdd->super, count, disp, extent ); } @@ -178,17 +178,17 @@ ompi_datatype_duplicate( const ompi_datatype_t* oldType, ompi_datatype_t** newTy OMPI_DECLSPEC int32_t ompi_datatype_create_contiguous( int count, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_vector( int count, int bLength, int stride, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); -OMPI_DECLSPEC int32_t ompi_datatype_create_hvector( int count, int bLength, OPAL_PTRDIFF_TYPE stride, +OMPI_DECLSPEC int32_t ompi_datatype_create_hvector( int count, int bLength, ptrdiff_t stride, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_indexed( int count, const int* pBlockLength, const int* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); -OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const ptrdiff_t* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_indexed_block( int count, int bLength, const int* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); -OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const OPAL_PTRDIFF_TYPE* pDisp, +OMPI_DECLSPEC int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const ptrdiff_t* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ); -OMPI_DECLSPEC int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +OMPI_DECLSPEC int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const ptrdiff_t* pDisp, ompi_datatype_t* const* pTypes, ompi_datatype_t** newType ); OMPI_DECLSPEC int32_t ompi_datatype_create_darray( int size, int rank, int ndims, int const* gsize_array, int const* distrib_array, int const* darg_array, @@ -199,8 +199,8 @@ OMPI_DECLSPEC int32_t ompi_datatype_create_subarray(int ndims, int const* size_a const ompi_datatype_t* oldtype, ompi_datatype_t** newtype); static inline int32_t ompi_datatype_create_resized( const ompi_datatype_t* oldType, - OPAL_PTRDIFF_TYPE lb, - OPAL_PTRDIFF_TYPE extent, + ptrdiff_t lb, + ptrdiff_t extent, ompi_datatype_t** newType ) { ompi_datatype_t * type; @@ -214,13 +214,13 @@ ompi_datatype_create_resized( const ompi_datatype_t* oldType, } static inline int32_t -ompi_datatype_type_lb( const ompi_datatype_t* type, OPAL_PTRDIFF_TYPE* disp ) +ompi_datatype_type_lb( const ompi_datatype_t* type, ptrdiff_t* disp ) { return opal_datatype_type_lb(&type->super, disp); } static inline int32_t -ompi_datatype_type_ub( const ompi_datatype_t* type, OPAL_PTRDIFF_TYPE* disp ) +ompi_datatype_type_ub( const ompi_datatype_t* type, ptrdiff_t* disp ) { return opal_datatype_type_ub( &type->super, disp); } @@ -232,19 +232,19 @@ ompi_datatype_type_size ( const ompi_datatype_t* type, size_t *size ) } static inline int32_t -ompi_datatype_type_extent( const ompi_datatype_t* type, OPAL_PTRDIFF_TYPE* extent ) +ompi_datatype_type_extent( const ompi_datatype_t* type, ptrdiff_t* extent ) { return opal_datatype_type_extent( &type->super, extent); } static inline int32_t -ompi_datatype_get_extent( const ompi_datatype_t* type, OPAL_PTRDIFF_TYPE* lb, OPAL_PTRDIFF_TYPE* extent) +ompi_datatype_get_extent( const ompi_datatype_t* type, ptrdiff_t* lb, ptrdiff_t* extent) { return opal_datatype_get_extent( &type->super, lb, extent); } static inline int32_t -ompi_datatype_get_true_extent( const ompi_datatype_t* type, OPAL_PTRDIFF_TYPE* true_lb, OPAL_PTRDIFF_TYPE* true_extent) +ompi_datatype_get_true_extent( const ompi_datatype_t* type, ptrdiff_t* true_lb, ptrdiff_t* true_extent) { return opal_datatype_get_true_extent( &type->super, true_lb, true_extent); } @@ -266,7 +266,7 @@ ompi_datatype_copy_content_same_ddt( const ompi_datatype_t* type, size_t count, char* pDestBuf, char* pSrcBuf ) { int32_t length, rc; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; ompi_datatype_type_extent( type, &extent ); while( 0 != count ) { @@ -295,11 +295,11 @@ OMPI_DECLSPEC int32_t ompi_datatype_sndrcv( const void *sbuf, int32_t scount, co */ OMPI_DECLSPEC int32_t ompi_datatype_get_args( const ompi_datatype_t* pData, int32_t which, int32_t * ci, int32_t * i, - int32_t * ca, OPAL_PTRDIFF_TYPE* a, + int32_t * ca, ptrdiff_t* a, int32_t * cd, ompi_datatype_t** d, int32_t * type); OMPI_DECLSPEC int32_t ompi_datatype_set_args( ompi_datatype_t* pData, int32_t ci, const int32_t ** i, - int32_t ca, const OPAL_PTRDIFF_TYPE* a, + int32_t ca, const ptrdiff_t* a, int32_t cd, ompi_datatype_t* const * d,int32_t type); OMPI_DECLSPEC int32_t ompi_datatype_copy_args( const ompi_datatype_t* source_data, ompi_datatype_t* dest_data ); diff --git a/ompi/datatype/ompi_datatype_args.c b/ompi/datatype/ompi_datatype_args.c index 7cf2d2eebe..f6c0851e59 100644 --- a/ompi/datatype/ompi_datatype_args.c +++ b/ompi/datatype/ompi_datatype_args.c @@ -13,7 +13,7 @@ * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013-2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -40,7 +40,7 @@ static inline int __ompi_datatype_pack_description( ompi_datatype_t* datatype, void** packed_buffer, int* next_index ); static ompi_datatype_t* -__ompi_datatype_create_from_args( int32_t* i, OPAL_PTRDIFF_TYPE * a, +__ompi_datatype_create_from_args( int32_t* i, ptrdiff_t * a, ompi_datatype_t** d, int32_t type ); typedef struct __dt_args { @@ -51,7 +51,7 @@ typedef struct __dt_args { int32_t ca; int32_t cd; int* i; - OPAL_PTRDIFF_TYPE* a; + ptrdiff_t* a; ompi_datatype_t** d; } ompi_datatype_args_t; @@ -65,7 +65,7 @@ typedef struct __dt_args { */ #if OPAL_ALIGN_WORD_SIZE_INTEGERS #define OMPI_DATATYPE_ALIGN_PTR(PTR, TYPE) \ - (PTR) = OPAL_ALIGN_PTR((PTR), sizeof(OPAL_PTRDIFF_TYPE), TYPE) + (PTR) = OPAL_ALIGN_PTR((PTR), sizeof(ptrdiff_t), TYPE) #else #define OMPI_DATATYPE_ALIGN_PTR(PTR, TYPE) #endif /* OPAL_ALIGN_WORD_SIZE_INTEGERS */ @@ -80,7 +80,7 @@ typedef struct __dt_args { #define ALLOC_ARGS(PDATA, IC, AC, DC) \ do { \ int length = sizeof(ompi_datatype_args_t) + (IC) * sizeof(int) + \ - (AC) * sizeof(OPAL_PTRDIFF_TYPE) + (DC) * sizeof(MPI_Datatype); \ + (AC) * sizeof(ptrdiff_t) + (DC) * sizeof(MPI_Datatype); \ char* buf = (char*)malloc( length ); \ ompi_datatype_args_t* pArgs = (ompi_datatype_args_t*)buf; \ pArgs->ci = (IC); \ @@ -89,8 +89,8 @@ typedef struct __dt_args { buf += sizeof(ompi_datatype_args_t); \ if( pArgs->ca == 0 ) pArgs->a = NULL; \ else { \ - pArgs->a = (OPAL_PTRDIFF_TYPE*)buf; \ - buf += pArgs->ca * sizeof(OPAL_PTRDIFF_TYPE); \ + pArgs->a = (ptrdiff_t*)buf; \ + buf += pArgs->ca * sizeof(ptrdiff_t); \ } \ if( pArgs->cd == 0 ) pArgs->d = NULL; \ else { \ @@ -101,7 +101,7 @@ typedef struct __dt_args { else pArgs->i = (int*)buf; \ pArgs->ref_count = 1; \ pArgs->total_pack_size = (4 + (IC) + (DC)) * sizeof(int) + \ - (AC) * sizeof(OPAL_PTRDIFF_TYPE); \ + (AC) * sizeof(ptrdiff_t); \ (PDATA)->args = (void*)pArgs; \ (PDATA)->packed_description = NULL; \ } while(0) @@ -109,7 +109,7 @@ typedef struct __dt_args { int32_t ompi_datatype_set_args( ompi_datatype_t* pData, int32_t ci, const int32_t** i, - int32_t ca, const OPAL_PTRDIFF_TYPE* a, + int32_t ca, const ptrdiff_t* a, int32_t cd, ompi_datatype_t* const * d, int32_t type) { int pos; @@ -220,9 +220,9 @@ int32_t ompi_datatype_set_args( ompi_datatype_t* pData, break; } - /* copy the array of MPI_Aint, aka OPAL_PTRDIFF_TYPE */ + /* copy the array of MPI_Aint, aka ptrdiff_t */ if( pArgs->a != NULL ) - memcpy( pArgs->a, a, ca * sizeof(OPAL_PTRDIFF_TYPE) ); + memcpy( pArgs->a, a, ca * sizeof(ptrdiff_t) ); for( pos = 0; pos < cd; pos++ ) { pArgs->d[pos] = d[pos]; @@ -317,7 +317,7 @@ int32_t ompi_datatype_print_args( const ompi_datatype_t* pData ) int32_t ompi_datatype_get_args( const ompi_datatype_t* pData, int32_t which, int32_t* ci, int32_t* i, - int32_t* ca, OPAL_PTRDIFF_TYPE* a, + int32_t* ca, ptrdiff_t* a, int32_t* cd, ompi_datatype_t** d, int32_t* type) { ompi_datatype_args_t* pArgs = (ompi_datatype_args_t*)pData->args; @@ -354,7 +354,7 @@ int32_t ompi_datatype_get_args( const ompi_datatype_t* pData, int32_t which, memcpy( i, pArgs->i, pArgs->ci * sizeof(int) ); } if( (NULL != a) && (NULL != pArgs->a) ) { - memcpy( a, pArgs->a, pArgs->ca * sizeof(OPAL_PTRDIFF_TYPE) ); + memcpy( a, pArgs->a, pArgs->ca * sizeof(ptrdiff_t) ); } if( (NULL != d) && (NULL != pArgs->d) ) { memcpy( d, pArgs->d, pArgs->cd * sizeof(MPI_Datatype) ); @@ -449,8 +449,8 @@ static inline int __ompi_datatype_pack_description( ompi_datatype_t* datatype, /* description of the displacements must be 64 bits aligned */ OMPI_DATATYPE_ALIGN_PTR(next_packed, char*); - memcpy( next_packed, args->a, sizeof(OPAL_PTRDIFF_TYPE) * args->ca ); - next_packed += sizeof(OPAL_PTRDIFF_TYPE) * args->ca; + memcpy( next_packed, args->a, sizeof(ptrdiff_t) * args->ca ); + next_packed += sizeof(ptrdiff_t) * args->ca; } position = (int*)next_packed; next_packed += sizeof(int) * args->cd; @@ -557,7 +557,7 @@ static ompi_datatype_t* __ompi_datatype_create_from_packed_description( void** p int* position; ompi_datatype_t* datatype = NULL; ompi_datatype_t** array_of_datatype; - OPAL_PTRDIFF_TYPE* array_of_disp; + ptrdiff_t* array_of_disp; int* array_of_length; int number_of_length, number_of_disp, number_of_datatype, data_id; int create_type, i; @@ -609,13 +609,13 @@ static ompi_datatype_t* __ompi_datatype_create_from_packed_description( void** p next_buffer += (4 * sizeof(int)); /* move after the header */ /* description of the displacements (if ANY !) should always be aligned - on MPI_Aint, aka OPAL_PTRDIFF_TYPE */ + on MPI_Aint, aka ptrdiff_t */ if (number_of_disp > 0) { OMPI_DATATYPE_ALIGN_PTR(next_buffer, char*); } - array_of_disp = (OPAL_PTRDIFF_TYPE*)next_buffer; - next_buffer += number_of_disp * sizeof(OPAL_PTRDIFF_TYPE); + array_of_disp = (ptrdiff_t*)next_buffer; + next_buffer += number_of_disp * sizeof(ptrdiff_t); /* the other datatypes */ position = (int*)next_buffer; next_buffer += number_of_datatype * sizeof(int); diff --git a/ompi/datatype/ompi_datatype_create_indexed.c b/ompi/datatype/ompi_datatype_create_indexed.c index 9311eac797..50c521b7bf 100644 --- a/ompi/datatype/ompi_datatype_create_indexed.c +++ b/ompi/datatype/ompi_datatype_create_indexed.c @@ -13,7 +13,7 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -35,7 +35,7 @@ int32_t ompi_datatype_create_indexed( int count, const int* pBlockLength, const { ompi_datatype_t* pdt; int i, dLength, endat, disp; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; if( 0 == count ) { return ompi_datatype_duplicate( &ompi_mpi_datatype_null.dt, newType); @@ -66,12 +66,12 @@ int32_t ompi_datatype_create_indexed( int count, const int* pBlockLength, const } -int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +int32_t ompi_datatype_create_hindexed( int count, const int* pBlockLength, const ptrdiff_t* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ) { ompi_datatype_t* pdt; int i, dLength; - OPAL_PTRDIFF_TYPE extent, disp, endat; + ptrdiff_t extent, disp, endat; if( 0 == count ) { *newType = ompi_datatype_create( 0 ); @@ -109,7 +109,7 @@ int32_t ompi_datatype_create_indexed_block( int count, int bLength, const int* p { ompi_datatype_t* pdt; int i, dLength, endat, disp; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; ompi_datatype_type_extent( oldType, &extent ); if( (count == 0) || (bLength == 0) ) { @@ -143,12 +143,12 @@ int32_t ompi_datatype_create_indexed_block( int count, int bLength, const int* p return OMPI_SUCCESS; } -int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const OPAL_PTRDIFF_TYPE* pDisp, +int32_t ompi_datatype_create_hindexed_block( int count, int bLength, const ptrdiff_t* pDisp, const ompi_datatype_t* oldType, ompi_datatype_t** newType ) { ompi_datatype_t* pdt; int i, dLength; - OPAL_PTRDIFF_TYPE extent, disp, endat; + ptrdiff_t extent, disp, endat; ompi_datatype_type_extent( oldType, &extent ); if( (count == 0) || (bLength == 0) ) { diff --git a/ompi/datatype/ompi_datatype_create_struct.c b/ompi/datatype/ompi_datatype_create_struct.c index e2457d16ec..98daa8bacb 100644 --- a/ompi/datatype/ompi_datatype_create_struct.c +++ b/ompi/datatype/ompi_datatype_create_struct.c @@ -13,6 +13,8 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -26,11 +28,11 @@ #include "ompi/datatype/ompi_datatype.h" -int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +int32_t ompi_datatype_create_struct( int count, const int* pBlockLength, const ptrdiff_t* pDisp, ompi_datatype_t* const * pTypes, ompi_datatype_t** newType ) { int i; - OPAL_PTRDIFF_TYPE disp = 0, endto, lastExtent, lastDisp; + ptrdiff_t disp = 0, endto, lastExtent, lastDisp; int lastBlock; ompi_datatype_t *pdt, *lastType; diff --git a/ompi/datatype/ompi_datatype_create_vector.c b/ompi/datatype/ompi_datatype_create_vector.c index c899f1d902..2faa06b4aa 100644 --- a/ompi/datatype/ompi_datatype_create_vector.c +++ b/ompi/datatype/ompi_datatype_create_vector.c @@ -13,6 +13,8 @@ * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -36,7 +38,7 @@ int32_t ompi_datatype_create_vector( int count, int bLength, int stride, const ompi_datatype_t* oldType, ompi_datatype_t** newType ) { ompi_datatype_t *pTempData, *pData; - OPAL_PTRDIFF_TYPE extent = oldType->super.ub - oldType->super.lb; + ptrdiff_t extent = oldType->super.ub - oldType->super.lb; if( 0 == count ) { @@ -64,11 +66,11 @@ int32_t ompi_datatype_create_vector( int count, int bLength, int stride, } -int32_t ompi_datatype_create_hvector( int count, int bLength, OPAL_PTRDIFF_TYPE stride, +int32_t ompi_datatype_create_hvector( int count, int bLength, ptrdiff_t stride, const ompi_datatype_t* oldType, ompi_datatype_t** newType ) { ompi_datatype_t *pTempData, *pData; - OPAL_PTRDIFF_TYPE extent = oldType->super.ub - oldType->super.lb; + ptrdiff_t extent = oldType->super.ub - oldType->super.lb; if( 0 == count ) { *newType = ompi_datatype_create( 0 ); diff --git a/ompi/datatype/ompi_datatype_module.c b/ompi/datatype/ompi_datatype_module.c index c076573972..9de36f9224 100644 --- a/ompi/datatype/ompi_datatype_module.c +++ b/ompi/datatype/ompi_datatype_module.c @@ -15,7 +15,7 @@ * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ @@ -393,20 +393,20 @@ opal_pointer_array_t ompi_datatype_f_to_c_table = {{0}}; struct { type1 v1; type2 v2; } s[2]; \ ompi_datatype_t *types[2], *ptype; \ int bLength[2] = {1, 1}; \ - OPAL_PTRDIFF_TYPE base, displ[2]; \ + ptrdiff_t base, displ[2]; \ \ types[0] = (ompi_datatype_t*)ompi_datatype_basicDatatypes[MPIType1]; \ types[1] = (ompi_datatype_t*)ompi_datatype_basicDatatypes[MPIType2]; \ - base = (OPAL_PTRDIFF_TYPE)(&(s[0])); \ - displ[0] = (OPAL_PTRDIFF_TYPE)(&(s[0].v1)); \ + base = (ptrdiff_t)(&(s[0])); \ + displ[0] = (ptrdiff_t)(&(s[0].v1)); \ displ[0] -= base; \ - displ[1] = (OPAL_PTRDIFF_TYPE)(&(s[0].v2)); \ + displ[1] = (ptrdiff_t)(&(s[0].v2)); \ displ[1] -= base; \ \ ompi_datatype_create_struct( 2, bLength, displ, types, &ptype ); \ - displ[0] = (OPAL_PTRDIFF_TYPE)(&(s[1])); \ + displ[0] = (ptrdiff_t)(&(s[1])); \ displ[0] -= base; \ - if( displ[0] != (displ[1] + (OPAL_PTRDIFF_TYPE)sizeof(type2)) ) \ + if( displ[0] != (displ[1] + (ptrdiff_t)sizeof(type2)) ) \ ptype->super.ub = displ[0]; /* force a new extent for the datatype */ \ ptype->super.flags |= (FLAGS); \ ptype->id = MPIDDT; \ @@ -627,7 +627,7 @@ int32_t ompi_datatype_init( void ) for( i = 0; i < ompi_mpi_count.dt.d_f_to_c_index; i++ ) { opal_datatype_t* datatype = (opal_datatype_t*)opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, i ); - if( (datatype->ub - datatype->lb) == (OPAL_PTRDIFF_TYPE)datatype->size ) { + if( (datatype->ub - datatype->lb) == (ptrdiff_t)datatype->size ) { datatype->flags |= OPAL_DATATYPE_FLAG_NO_GAPS; } else { datatype->flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS; diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index f9d21c636b..07e1845faf 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -17,7 +17,7 @@ * reserved. * Copyright (c) 2011-2013 INRIA. All rights reserved. * Copyright (c) 2015 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2017 IBM Corporation. All rights reserved. * $COPYRIGHT$ @@ -158,7 +158,7 @@ #undef OMPI_MPI_COUNT_TYPE /* type to use for ptrdiff_t, if it does not exist, set to ptrdiff_t if it does exist */ -#undef OPAL_PTRDIFF_TYPE +#undef ptrdiff_t /* Whether we want MPI cxx support or not */ #undef OMPI_BUILD_CXX_BINDINGS diff --git a/ompi/include/ompi/memchecker.h b/ompi/include/ompi/memchecker.h index 90a8919935..4d47ed0d3a 100644 --- a/ompi/include/ompi/memchecker.h +++ b/ompi/include/ompi/memchecker.h @@ -6,7 +6,7 @@ * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2014 Intel, Inc. All rights reserved. * @@ -353,10 +353,10 @@ static inline int memchecker_datatype(MPI_Datatype type) opal_memchecker_base_isdefined (&type->super.id, sizeof(uint16_t)); opal_memchecker_base_isdefined (&type->super.bdt_used, sizeof(uint32_t)); opal_memchecker_base_isdefined (&type->super.size, sizeof(size_t)); - opal_memchecker_base_isdefined (&type->super.true_lb, sizeof(OPAL_PTRDIFF_T)); - opal_memchecker_base_isdefined (&type->super.true_ub, sizeof(OPAL_PTRDIFF_T)); - opal_memchecker_base_isdefined (&type->super.lb, sizeof(OPAL_PTRDIFF_T)); - opal_memchecker_base_isdefined (&type->super.ub, sizeof(OPAL_PTRDIFF_T)); + opal_memchecker_base_isdefined (&type->super.true_lb, sizeof(ptrdiff_t)); + opal_memchecker_base_isdefined (&type->super.true_ub, sizeof(ptrdiff_t)); + opal_memchecker_base_isdefined (&type->super.lb, sizeof(ptrdiff_t)); + opal_memchecker_base_isdefined (&type->super.ub, sizeof(ptrdiff_t)); opal_memchecker_base_isdefined (&type->super.align, sizeof(uint32_t)); opal_memchecker_base_isdefined (&type->super.nbElems, sizeof(uint32_t)); /* name... */ diff --git a/ompi/mca/coll/base/coll_base_allreduce.c b/ompi/mca/coll/base/coll_base_allreduce.c index d05235ccca..3ff451e39d 100644 --- a/ompi/mca/coll/base/coll_base_allreduce.c +++ b/ompi/mca/coll/base/coll_base_allreduce.c @@ -13,7 +13,7 @@ * Copyright (c) 2009 University of Houston. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All Rights * reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -136,7 +136,7 @@ ompi_coll_base_allreduce_intra_recursivedoubling(const void *sbuf, void *rbuf, int newrank, newremote, extra_ranks; char *tmpsend = NULL, *tmprecv = NULL, *tmpswap = NULL, *inplacebuf_free = NULL, *inplacebuf; ompi_request_t *reqs[2] = {NULL, NULL}; - OPAL_PTRDIFF_TYPE span, gap; + ptrdiff_t span, gap; size = ompi_comm_size(comm); rank = ompi_comm_rank(comm); @@ -630,7 +630,7 @@ ompi_coll_base_allreduce_intra_ring_segmented(const void *sbuf, void *rbuf, int char *tmpsend = NULL, *tmprecv = NULL, *inbuf[2] = {NULL, NULL}; ptrdiff_t block_offset, max_real_segsize; ompi_request_t *reqs[2] = {NULL, NULL}; - OPAL_PTRDIFF_TYPE lb, extent, gap; + ptrdiff_t lb, extent, gap; size = ompi_comm_size(comm); rank = ompi_comm_rank(comm); diff --git a/ompi/mca/coll/base/coll_base_alltoall.c b/ompi/mca/coll/base/coll_base_alltoall.c index 676c12612b..2c823b2f5a 100644 --- a/ompi/mca/coll/base/coll_base_alltoall.c +++ b/ompi/mca/coll/base/coll_base_alltoall.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2013-2016 Los Alamos National Security, LLC. All Rights * reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -42,7 +42,7 @@ mca_coll_base_alltoall_intra_basic_inplace(const void *rbuf, int rcount, mca_coll_base_module_t *module) { int i, j, size, rank, err = MPI_SUCCESS, line; - OPAL_PTRDIFF_TYPE ext, gap; + ptrdiff_t ext, gap; ompi_request_t *req; char *allocated_buffer = NULL, *tmp_buffer; size_t max_size; @@ -197,7 +197,7 @@ int ompi_coll_base_alltoall_intra_bruck(const void *sbuf, int scount, int i, k, line = -1, rank, size, err = 0; int sendto, recvfrom, distance, *displs = NULL, *blen = NULL; char *tmpbuf = NULL, *tmpbuf_free = NULL; - OPAL_PTRDIFF_TYPE sext, rext, span, gap; + ptrdiff_t sext, rext, span, gap; struct ompi_datatype_t *new_ddt; if (MPI_IN_PLACE == sbuf) { diff --git a/ompi/mca/coll/base/coll_base_alltoallv.c b/ompi/mca/coll/base/coll_base_alltoallv.c index d74ebb5f01..bc98c15cf8 100644 --- a/ompi/mca/coll/base/coll_base_alltoallv.c +++ b/ompi/mca/coll/base/coll_base_alltoallv.c @@ -14,7 +14,7 @@ * Copyright (c) 2013 Los Alamos National Security, LLC. All Rights * reserved. * Copyright (c) 2013 FUJITSU LIMITED. All rights reserved. - * Copyright (c) 2014-2016 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -46,7 +46,7 @@ mca_coll_base_alltoallv_intra_basic_inplace(const void *rbuf, const int *rcounts ompi_request_t *req; char *allocated_buffer, *tmp_buffer; size_t max_size, rdtype_size; - OPAL_PTRDIFF_TYPE ext, gap = 0; + ptrdiff_t ext, gap = 0; /* Initialize. */ diff --git a/ompi/mca/coll/libnbc/nbc_iallreduce.c b/ompi/mca/coll/libnbc/nbc_iallreduce.c index a1d98ec33b..3c763db427 100644 --- a/ompi/mca/coll/libnbc/nbc_iallreduce.c +++ b/ompi/mca/coll/libnbc/nbc_iallreduce.c @@ -57,7 +57,7 @@ int ompi_coll_libnbc_iallreduce(const void* sendbuf, void* recvbuf, int count, M struct mca_coll_base_module_2_2_0_t *module) { int rank, p, res; - OPAL_PTRDIFF_TYPE ext, lb; + ptrdiff_t ext, lb; NBC_Schedule *schedule; size_t size; #ifdef NBC_CACHE_SCHEDULE diff --git a/ompi/mca/coll/libnbc/nbc_internal.h b/ompi/mca/coll/libnbc/nbc_internal.h index b463a20afd..f1e245e76f 100644 --- a/ompi/mca/coll/libnbc/nbc_internal.h +++ b/ompi/mca/coll/libnbc/nbc_internal.h @@ -10,7 +10,7 @@ * * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. @@ -539,7 +539,7 @@ static inline int NBC_Copy(const void *src, int srccount, MPI_Datatype srctype, static inline int NBC_Unpack(void *src, int srccount, MPI_Datatype srctype, void *tgt, MPI_Comm comm) { int size, pos, res; - OPAL_PTRDIFF_TYPE ext, lb; + ptrdiff_t ext, lb; #if OPAL_CUDA_SUPPORT if(NBC_Type_intrinsic(srctype) && !(opal_cuda_check_bufs((char *)tgt, (char *)src))) { diff --git a/ompi/mca/common/ompio/common_ompio_file_open.c b/ompi/mca/common/ompio/common_ompio_file_open.c index 8aa809a258..38505ed0c2 100644 --- a/ompi/mca/common/ompio/common_ompio_file_open.c +++ b/ompi/mca/common/ompio/common_ompio_file_open.c @@ -400,7 +400,7 @@ int mca_common_ompio_set_file_defaults (mca_io_ompio_file_t *fh) if (NULL != fh) { ompi_datatype_t *types[2]; int blocklen[2] = {1, 1}; - OPAL_PTRDIFF_TYPE d[2], base; + ptrdiff_t d[2], base; int i; fh->f_io_array = NULL; @@ -446,8 +446,8 @@ int mca_common_ompio_set_file_defaults (mca_io_ompio_file_t *fh) types[0] = &ompi_mpi_long.dt; types[1] = &ompi_mpi_long.dt; - d[0] = (OPAL_PTRDIFF_TYPE) fh->f_decoded_iov; - d[1] = (OPAL_PTRDIFF_TYPE) &fh->f_decoded_iov[0].iov_len; + d[0] = (ptrdiff_t) fh->f_decoded_iov; + d[1] = (ptrdiff_t) &fh->f_decoded_iov[0].iov_len; base = d[0]; for (i=0 ; i<2 ; i++) { diff --git a/ompi/mca/common/ompio/common_ompio_file_view.c b/ompi/mca/common/ompio/common_ompio_file_view.c index 43b42ee72e..0512f9bce7 100644 --- a/ompi/mca/common/ompio/common_ompio_file_view.c +++ b/ompi/mca/common/ompio/common_ompio_file_view.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -63,7 +65,7 @@ int mca_common_ompio_set_view (mca_io_ompio_file_t *fh, mca_io_ompio_contg *contg_groups; size_t ftype_size; - OPAL_PTRDIFF_TYPE ftype_extent, lb, ub; + ptrdiff_t ftype_extent, lb, ub; ompi_datatype_t *newfiletype; if ( NULL != fh->f_etype ) { @@ -101,7 +103,7 @@ int mca_common_ompio_set_view (mca_io_ompio_file_t *fh, if ( etype == filetype && ompi_datatype_is_predefined (filetype ) && - ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){ + ftype_extent == (ptrdiff_t)ftype_size ){ ompi_datatype_create_contiguous(MCA_IO_DEFAULT_FILE_VIEW_SIZE, &ompi_mpi_byte.dt, &newfiletype); @@ -139,7 +141,7 @@ int mca_common_ompio_set_view (mca_io_ompio_file_t *fh, if (opal_datatype_is_contiguous_memory_layout(&etype->super,1)) { if (opal_datatype_is_contiguous_memory_layout(&filetype->super,1) && - fh->f_view_extent == (OPAL_PTRDIFF_TYPE)fh->f_view_size ) { + fh->f_view_extent == (ptrdiff_t)fh->f_view_size ) { fh->f_flags |= OMPIO_CONTIGUOUS_FVIEW; } } @@ -196,7 +198,7 @@ int mca_common_ompio_set_view (mca_io_ompio_file_t *fh, if ( etype == filetype && ompi_datatype_is_predefined (filetype ) && - ftype_extent == (OPAL_PTRDIFF_TYPE)ftype_size ){ + ftype_extent == (ptrdiff_t)ftype_size ){ ompi_datatype_destroy ( &newfiletype ); } diff --git a/ompi/mca/common/ompio/common_ompio_file_write.c b/ompi/mca/common/ompio/common_ompio_file_write.c index 97fe28671f..fc0ccb8607 100644 --- a/ompi/mca/common/ompio/common_ompio_file_write.c +++ b/ompi/mca/common/ompio/common_ompio_file_write.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -329,7 +329,7 @@ int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cy size_t bytes_per_cycle, int max_data, uint32_t iov_count, struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw ) { - OPAL_PTRDIFF_TYPE disp; + ptrdiff_t disp; int block = 1; size_t total_bytes_written = *tbw; /* total bytes that have been written*/ size_t bytes_to_write_in_cycle = 0; /* left to be written in a cycle*/ @@ -374,7 +374,7 @@ int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cy i = i + 1; } - disp = (OPAL_PTRDIFF_TYPE)decoded_iov[i].iov_base + + disp = (ptrdiff_t)decoded_iov[i].iov_base + (total_bytes_written - sum_previous_counts); fh->f_io_array[k].memory_address = (IOVBASE_TYPE *)disp; @@ -404,7 +404,7 @@ int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cy } } - disp = (OPAL_PTRDIFF_TYPE)fh->f_decoded_iov[j].iov_base + + disp = (ptrdiff_t)fh->f_decoded_iov[j].iov_base + (fh->f_total_bytes - sum_previous_length); fh->f_io_array[k].offset = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset); diff --git a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c index 27dc589ee0..f99e93348c 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_preadv.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_preadv.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -69,7 +69,7 @@ ssize_t mca_fbtl_posix_preadv (mca_io_ompio_file_t *fh ) if (fh->f_num_of_io_entries != i+1) { if (((((OMPI_MPI_OFFSET_TYPE)(intptr_t)fh->f_io_array[i].offset + - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].length) == + (ptrdiff_t)fh->f_io_array[i].length) == (OMPI_MPI_OFFSET_TYPE)(intptr_t)fh->f_io_array[i+1].offset)) && (iov_count < IOV_MAX ) ){ iov[iov_count].iov_base = diff --git a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c index fbf69489ff..5ed6574a5b 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c +++ b/ompi/mca/fbtl/posix/fbtl_posix_pwritev.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -71,7 +71,7 @@ ssize_t mca_fbtl_posix_pwritev(mca_io_ompio_file_t *fh ) if (fh->f_num_of_io_entries != i+1) { if ( (((OMPI_MPI_OFFSET_TYPE)(intptr_t)fh->f_io_array[i].offset + - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].length) == + (ptrdiff_t)fh->f_io_array[i].length) == (OMPI_MPI_OFFSET_TYPE)(intptr_t)fh->f_io_array[i+1].offset) && (iov_count < IOV_MAX )) { iov[iov_count].iov_base = diff --git a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_preadv.c b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_preadv.c index 61e9e2460c..362c6e789b 100644 --- a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_preadv.c +++ b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_preadv.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -54,7 +56,7 @@ ssize_t mca_fbtl_pvfs2_preadv (mca_io_ompio_file_t *fh) for (i=0 ; if_num_of_io_entries ; i++) { if (fh->f_num_of_io_entries != i+1) { if (((OMPI_MPI_OFFSET_TYPE)fh->f_io_array[i].offset + - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].length) == + (ptrdiff_t)fh->f_io_array[i].length) == (OMPI_MPI_OFFSET_TYPE)fh->f_io_array[i+1].offset) { if (!merge) { merge_offset = (OMPI_MPI_OFFSET_TYPE) diff --git a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_pwritev.c b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_pwritev.c index 31c5b46c5d..cd7c846169 100644 --- a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_pwritev.c +++ b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2_pwritev.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -55,7 +57,7 @@ ssize_t mca_fbtl_pvfs2_pwritev (mca_io_ompio_file_t *fh ) for (i=0 ; if_num_of_io_entries ; i++) { if (fh->f_num_of_io_entries != i+1) { if (((OMPI_MPI_OFFSET_TYPE)fh->f_io_array[i].offset + - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].length) == + (ptrdiff_t)fh->f_io_array[i].length) == (OMPI_MPI_OFFSET_TYPE)fh->f_io_array[i+1].offset) { if (!merge) { merge_offset = (OMPI_MPI_OFFSET_TYPE) diff --git a/ompi/mca/fcoll/base/fcoll_base_coll_array.c b/ompi/mca/fcoll/base/fcoll_base_coll_array.c index 4b334f1331..573094dd1b 100644 --- a/ompi/mca/fcoll/base/fcoll_base_coll_array.c +++ b/ompi/mca/fcoll/base/fcoll_base_coll_array.c @@ -11,6 +11,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -45,7 +47,7 @@ int fcoll_base_coll_allgatherv_array (void *sbuf, ompi_communicator_t *comm) { int err = OMPI_SUCCESS; - OPAL_PTRDIFF_TYPE extent, lb; + ptrdiff_t extent, lb; int i, rank, j; char *send_buf = NULL; struct ompi_datatype_t *newtype, *send_type; @@ -130,7 +132,7 @@ int fcoll_base_coll_gatherv_array (void *sbuf, int i, rank; int err = OMPI_SUCCESS; char *ptmp; - OPAL_PTRDIFF_TYPE extent, lb; + ptrdiff_t extent, lb; ompi_request_t **reqs=NULL; rank = ompi_comm_rank (comm); @@ -219,7 +221,7 @@ int fcoll_base_coll_scatterv_array (void *sbuf, int i, rank; int err = OMPI_SUCCESS; char *ptmp; - OPAL_PTRDIFF_TYPE extent, lb; + ptrdiff_t extent, lb; ompi_request_t ** reqs=NULL; rank = ompi_comm_rank (comm); @@ -307,7 +309,7 @@ int fcoll_base_coll_allgather_array (void *sbuf, { int err = OMPI_SUCCESS; int rank; - OPAL_PTRDIFF_TYPE extent, lb; + ptrdiff_t extent, lb; rank = ompi_comm_rank (comm); @@ -361,8 +363,8 @@ int fcoll_base_coll_gather_array (void *sbuf, int i; int rank; char *ptmp; - OPAL_PTRDIFF_TYPE incr; - OPAL_PTRDIFF_TYPE extent, lb; + ptrdiff_t incr; + ptrdiff_t extent, lb; int err = OMPI_SUCCESS; ompi_request_t ** reqs=NULL; diff --git a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c index 4e3c7c7327..ae71905971 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_read_all.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2015 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -97,7 +99,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, int my_aggregator =-1; bool recvbuf_is_contiguous=false; size_t ftype_size; - OPAL_PTRDIFF_TYPE ftype_extent, lb; + ptrdiff_t ftype_extent, lb; #if OMPIO_FCOLL_WANT_TIME_BREAKDOWN @@ -114,7 +116,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, opal_datatype_type_size ( &datatype->super, &ftype_size ); opal_datatype_get_extent ( &datatype->super, &lb, &ftype_extent ); - if ( (ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) && + if ( (ftype_extent == (ptrdiff_t) ftype_size) && opal_datatype_is_contiguous_memory_layout(&datatype->super,1) && 0 == lb ) { recvbuf_is_contiguous = true; @@ -503,7 +505,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_remaining; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); blocklen_per_process[n] = (int *) realloc @@ -528,7 +530,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_read_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); } @@ -548,7 +550,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_read_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base ; + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base ; } if (fh->f_procs_in_group[n] == fh->f_rank) { @@ -564,7 +566,7 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = global_iov_array[sorted[current_index]].iov_len; - displs_per_process[n][disp_index[n] - 1] = (OPAL_PTRDIFF_TYPE) + displs_per_process[n][disp_index[n] - 1] = (ptrdiff_t) global_iov_array[sorted[current_index]].iov_base; blocklen_per_process[n] = (int *) realloc ((void *)blocklen_per_process[n], (disp_index[n]+1)*sizeof(int)); @@ -813,14 +815,14 @@ mca_fcoll_dynamic_file_read_all (mca_io_ompio_file_t *fh, /* If data is not contigous in memory, copy the data from the receive buffer into the buffer passed in */ if (!recvbuf_is_contiguous ) { - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; remaining = bytes_received; while (remaining) { - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (decoded_iov[iov_index].iov_base) + current_position; if (remaining >= diff --git a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c index 7bc41c4590..f1ba18014c 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic_file_write_all.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2015 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -101,7 +101,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, int my_aggregator=-1; bool sendbuf_is_contiguous = false; size_t ftype_size; - OPAL_PTRDIFF_TYPE ftype_extent, lb; + ptrdiff_t ftype_extent, lb; #if OMPIO_FCOLL_WANT_TIME_BREAKDOWN @@ -117,7 +117,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, /************************************************************************** ** 1. In case the data is not contigous in memory, decode it into an iovec **************************************************************************/ - if ( ( ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) && + if ( ( ftype_extent == (ptrdiff_t) ftype_size) && opal_datatype_is_contiguous_memory_layout(&datatype->super,1) && 0 == lb ) { sendbuf_is_contiguous = true; @@ -523,7 +523,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_remaining; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); @@ -551,7 +551,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_write_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); } @@ -572,7 +572,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_write_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base ; + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base ; } if (fh->f_procs_in_group[n] == fh->f_rank) { bytes_sent += bytes_to_write_in_cycle; @@ -588,7 +588,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = global_iov_array[sorted[current_index]].iov_len; - displs_per_process[n][disp_index[n] - 1] = (OPAL_PTRDIFF_TYPE) + displs_per_process[n][disp_index[n] - 1] = (ptrdiff_t) global_iov_array[sorted[current_index]].iov_base; /*realloc for next blocklength @@ -798,7 +798,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, /* allocate a send buffer and copy the data that needs to be sent into it in case the data is non-contigous in memory */ - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; @@ -812,7 +812,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, remaining = bytes_sent; while (remaining) { - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (decoded_iov[iov_index].iov_base) + current_position; if (remaining >= @@ -946,7 +946,7 @@ mca_fcoll_dynamic_file_write_all (mca_io_ompio_file_t *fh, for (i=0 ; if_num_of_io_entries ; i++) { printf(" ADDRESS: %p OFFSET: %ld LENGTH: %ld\n", fh->f_io_array[i].memory_address, - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].offset, + (ptrdiff_t)fh->f_io_array[i].offset, fh->f_io_array[i].length); } diff --git a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_read_all.c b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_read_all.c index 44cc0a2bde..fd94b4ef15 100644 --- a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_read_all.c +++ b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_read_all.c @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2015 University of Houston. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -97,7 +99,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, int my_aggregator =-1; bool recvbuf_is_contiguous=false; size_t ftype_size; - OPAL_PTRDIFF_TYPE ftype_extent, lb; + ptrdiff_t ftype_extent, lb; #if OMPIO_FCOLL_WANT_TIME_BREAKDOWN @@ -114,7 +116,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, opal_datatype_type_size ( &datatype->super, &ftype_size ); opal_datatype_get_extent ( &datatype->super, &lb, &ftype_extent ); - if ( (ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) && + if ( (ftype_extent == (ptrdiff_t) ftype_size) && opal_datatype_is_contiguous_memory_layout(&datatype->super,1) && 0 == lb ) { recvbuf_is_contiguous = true; @@ -503,7 +505,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_remaining; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); blocklen_per_process[n] = (int *) realloc @@ -528,7 +530,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_read_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base + + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base + (global_iov_array[sorted[current_index]].iov_len - bytes_remaining); } @@ -548,7 +550,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = bytes_to_read_in_cycle; displs_per_process[n][disp_index[n] - 1] = - (OPAL_PTRDIFF_TYPE)global_iov_array[sorted[current_index]].iov_base ; + (ptrdiff_t)global_iov_array[sorted[current_index]].iov_base ; } if (fh->f_procs_in_group[n] == fh->f_rank) { @@ -564,7 +566,7 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, if (my_aggregator == fh->f_rank) { blocklen_per_process[n][disp_index[n] - 1] = global_iov_array[sorted[current_index]].iov_len; - displs_per_process[n][disp_index[n] - 1] = (OPAL_PTRDIFF_TYPE) + displs_per_process[n][disp_index[n] - 1] = (ptrdiff_t) global_iov_array[sorted[current_index]].iov_base; blocklen_per_process[n] = (int *) realloc ((void *)blocklen_per_process[n], (disp_index[n]+1)*sizeof(int)); @@ -813,14 +815,14 @@ mca_fcoll_dynamic_gen2_file_read_all (mca_io_ompio_file_t *fh, /* If data is not contigous in memory, copy the data from the receive buffer into the buffer passed in */ if (!recvbuf_is_contiguous ) { - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; remaining = bytes_received; while (remaining) { - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (decoded_iov[iov_index].iov_base) + current_position; if (remaining >= diff --git a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c index 31bfa83150..f9d713725d 100644 --- a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c +++ b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2_file_write_all.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -869,7 +869,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i if (aggregator == rank) { data->blocklen_per_process[data->n][data->disp_index[data->n] - 1] = data->bytes_remaining; data->displs_per_process[data->n][data->disp_index[data->n] - 1] = - (OPAL_PTRDIFF_TYPE)data->global_iov_array[data->sorted[data->current_index]].iov_base + + (ptrdiff_t)data->global_iov_array[data->sorted[data->current_index]].iov_base + (data->global_iov_array[data->sorted[data->current_index]].iov_len - data->bytes_remaining); @@ -897,7 +897,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i if (aggregator == rank) { data->blocklen_per_process[data->n][data->disp_index[data->n] - 1] = data->bytes_to_write_in_cycle; data->displs_per_process[data->n][data->disp_index[data->n] - 1] = - (OPAL_PTRDIFF_TYPE)data->global_iov_array[data->sorted[data->current_index]].iov_base + + (ptrdiff_t)data->global_iov_array[data->sorted[data->current_index]].iov_base + (data->global_iov_array[data->sorted[data->current_index]].iov_len - data->bytes_remaining); } @@ -918,7 +918,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i if (aggregator == rank) { data->blocklen_per_process[data->n][data->disp_index[data->n] - 1] = data->bytes_to_write_in_cycle; data->displs_per_process[data->n][data->disp_index[data->n] - 1] = - (OPAL_PTRDIFF_TYPE)data->global_iov_array[data->sorted[data->current_index]].iov_base ; + (ptrdiff_t)data->global_iov_array[data->sorted[data->current_index]].iov_base ; } if (data->procs_in_group[data->n] == rank) { bytes_sent += data->bytes_to_write_in_cycle; @@ -934,7 +934,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i if (aggregator == rank) { data->blocklen_per_process[data->n][data->disp_index[data->n] - 1] = data->global_iov_array[data->sorted[data->current_index]].iov_len; - data->displs_per_process[data->n][data->disp_index[data->n] - 1] = (OPAL_PTRDIFF_TYPE) + data->displs_per_process[data->n][data->disp_index[data->n] - 1] = (ptrdiff_t) data->global_iov_array[data->sorted[data->current_index]].iov_base; /*realloc for next blocklength @@ -1142,7 +1142,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i /* allocate a send buffer and copy the data that needs to be sent into it in case the data is non-contigous in memory */ - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; @@ -1156,7 +1156,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i remaining = bytes_sent; while (remaining) { - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (data->decoded_iov[data->iov_index].iov_base) + data->current_position; if (remaining >= @@ -1266,7 +1266,7 @@ static int shuffle_init ( int index, int cycles, int aggregator, int rank, mca_i for (i=0 ; isuper,1) && 0 == lb ) { recvbuf_is_contiguous = true; @@ -186,9 +188,9 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh, local_iov_array[0].process_id = fh->f_rank; } - d[0] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0]; - d[1] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0].length; - d[2] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0].process_id; + d[0] = (ptrdiff_t)&local_iov_array[0]; + d[1] = (ptrdiff_t)&local_iov_array[0].length; + d[2] = (ptrdiff_t)&local_iov_array[0].process_id; base = d[0]; for (i=0 ; i<3 ; i++) { d[i] -= base; @@ -768,7 +770,7 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh, for (i=0 ; if_num_of_io_entries ; i++) { printf(" ADDRESS: %p OFFSET: %ld LENGTH: %ld\n", fh->f_io_array[i].memory_address, - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].offset, + (ptrdiff_t)fh->f_io_array[i].offset, fh->f_io_array[i].length); } #endif @@ -871,14 +873,14 @@ mca_fcoll_static_file_read_all (mca_io_ompio_file_t *fh, position += bytes_to_read_in_cycle; if (!recvbuf_is_contiguous) { - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; remaining = bytes_to_read_in_cycle; while (remaining && (iov_count > iov_index)){ - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (decoded_iov[iov_index].iov_base) + current_position; if (remaining >= diff --git a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c index 75dcf88b97..66518f134c 100644 --- a/ompi/mca/fcoll/static/fcoll_static_file_write_all.c +++ b/ompi/mca/fcoll/static/fcoll_static_file_write_all.c @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -90,13 +90,13 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, /* For creating datatype of type io_array */ int blocklen[3] = {1, 1, 1}; int static_num_io_procs=1; - OPAL_PTRDIFF_TYPE d[3], base; + ptrdiff_t d[3], base; ompi_datatype_t *types[3]; ompi_datatype_t *io_array_type=MPI_DATATYPE_NULL; int my_aggregator=-1; bool sendbuf_is_contiguous= false; size_t ftype_size; - OPAL_PTRDIFF_TYPE ftype_extent, lb; + ptrdiff_t ftype_extent, lb; /*----------------------------------------------*/ @@ -118,7 +118,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, /************************************************************************** ** 1. In case the data is not contigous in memory, decode it into an iovec **************************************************************************/ - if ( ( ftype_extent == (OPAL_PTRDIFF_TYPE) ftype_size) && + if ( ( ftype_extent == (ptrdiff_t) ftype_size) && opal_datatype_is_contiguous_memory_layout(&datatype->super,1) && 0 == lb ) { sendbuf_is_contiguous = true; @@ -155,9 +155,9 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, types[1] = &ompi_mpi_long.dt; types[2] = &ompi_mpi_int.dt; - d[0] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0]; - d[1] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0].length; - d[2] = (OPAL_PTRDIFF_TYPE)&local_iov_array[0].process_id; + d[0] = (ptrdiff_t)&local_iov_array[0]; + d[1] = (ptrdiff_t)&local_iov_array[0].length; + d[2] = (ptrdiff_t)&local_iov_array[0].process_id; base = d[0]; for (i=0 ; i<3 ; i++) { d[i] -= base; @@ -787,7 +787,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, /* allocate a send buffer and copy the data that needs to be sent into it in case the data is non-contigous in memory */ - OPAL_PTRDIFF_TYPE mem_address; + ptrdiff_t mem_address; size_t remaining = 0; size_t temp_position = 0; @@ -800,7 +800,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, remaining = bytes_to_write_in_cycle; while (remaining) { - mem_address = (OPAL_PTRDIFF_TYPE) + mem_address = (ptrdiff_t) (decoded_iov[iov_index].iov_base) + current_position; if (remaining >= @@ -914,7 +914,7 @@ mca_fcoll_static_file_write_all (mca_io_ompio_file_t *fh, for (i=0 ; if_num_of_io_entries ; i++) { printf(" ADDRESS: %p OFFSET: %ld LENGTH: %ld\n", fh->f_io_array[i].memory_address, - (OPAL_PTRDIFF_TYPE)fh->f_io_array[i].offset, + (ptrdiff_t)fh->f_io_array[i].offset, fh->f_io_array[i].length); } #endif diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c index 6c4b717bc9..f5de324664 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_read_all.c @@ -11,9 +11,11 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. - * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -165,11 +167,11 @@ mca_fcoll_two_phase_file_read_all (mca_io_ompio_file_t *fh, for (ti = 0; ti < iov_count; ti++){ decoded_iov[ti].iov_base = (IOVBASE_TYPE *) - ((OPAL_PTRDIFF_TYPE)temp_iov[ti].iov_base - recv_buf_addr); + ((ptrdiff_t)temp_iov[ti].iov_base - recv_buf_addr); decoded_iov[ti].iov_len = temp_iov[ti].iov_len; #if DEBUG printf("d_offset[%d]: %ld, d_len[%d]: %ld\n", - ti, (OPAL_PTRDIFF_TYPE)decoded_iov[ti].iov_base, + ti, (ptrdiff_t)decoded_iov[ti].iov_base, ti, decoded_iov[ti].iov_len); #endif } diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c index f78cb14386..649d4ac99a 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase_file_write_all.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015-2016 Los Alamos National Security, LLC. All rights * reserved. @@ -190,7 +190,7 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, goto exit; } - send_buf_addr = (OPAL_PTRDIFF_TYPE)buf; + send_buf_addr = (ptrdiff_t)buf; if ( 0 < iov_count ) { decoded_iov = (struct iovec *)malloc (iov_count * sizeof(struct iovec)); @@ -201,13 +201,13 @@ mca_fcoll_two_phase_file_write_all (mca_io_ompio_file_t *fh, } for (ti = 0; ti < iov_count; ti ++){ decoded_iov[ti].iov_base = (IOVBASE_TYPE *)( - (OPAL_PTRDIFF_TYPE)temp_iov[ti].iov_base - + (ptrdiff_t)temp_iov[ti].iov_base - send_buf_addr); decoded_iov[ti].iov_len = temp_iov[ti].iov_len ; #if DEBUG_ON printf("d_offset[%d]: %ld, d_len[%d]: %ld\n", - ti, (OPAL_PTRDIFF_TYPE)decoded_iov[ti].iov_base, + ti, (ptrdiff_t)decoded_iov[ti].iov_base, ti, decoded_iov[ti].iov_len); #endif } diff --git a/ompi/mca/fs/pvfs2/fs_pvfs2_file_open.c b/ompi/mca/fs/pvfs2/fs_pvfs2_file_open.c index 6017cda148..211e39797b 100644 --- a/ompi/mca/fs/pvfs2/fs_pvfs2_file_open.c +++ b/ompi/mca/fs/pvfs2/fs_pvfs2_file_open.c @@ -10,7 +10,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2014 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -72,7 +72,7 @@ mca_fs_pvfs2_file_open (struct ompi_communicator_t *comm, struct ompi_datatype_t *open_status_type; struct ompi_datatype_t *types[2] = {&ompi_mpi_int.dt, &ompi_mpi_byte.dt}; int lens[2] = {1, sizeof(PVFS_object_ref)}; - OPAL_PTRDIFF_TYPE offsets[2]; + ptrdiff_t offsets[2]; char char_stripe[MPI_MAX_INFO_KEY]; int flag; int fs_pvfs2_stripe_size = -1; diff --git a/ompi/mca/io/ompio/io_ompio.c b/ompi/mca/io/ompio/io_ompio.c index b07d8ad2dd..6d3b5726e7 100644 --- a/ompi/mca/io/ompio/io_ompio.c +++ b/ompi/mca/io/ompio/io_ompio.c @@ -13,7 +13,7 @@ * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2011-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Inria. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -67,7 +67,7 @@ int ompi_io_ompio_generate_current_file_view (struct mca_io_ompio_file_t *fh, k = 0; while (bytes_to_write) { - OPAL_PTRDIFF_TYPE disp; + ptrdiff_t disp; /* reallocate if needed */ if (OMPIO_IOVEC_INITIAL_SIZE*block <= k) { block ++; @@ -93,7 +93,7 @@ int ompi_io_ompio_generate_current_file_view (struct mca_io_ompio_file_t *fh, } } - disp = (OPAL_PTRDIFF_TYPE)(fh->f_decoded_iov[j].iov_base) + + disp = (ptrdiff_t)(fh->f_decoded_iov[j].iov_base) + (fh->f_total_bytes - sum_previous_counts); iov[k].iov_base = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset); @@ -125,7 +125,7 @@ int ompi_io_ompio_generate_current_file_view (struct mca_io_ompio_file_t *fh, int *row_index=NULL, i=0, l=0, m=0; int column_index=0, r_index=0; int blocklen[3] = {1, 1, 1}; - OPAL_PTRDIFF_TYPE d[3], base; + ptrdiff_t d[3], base; ompi_datatype_t *types[3]; ompi_datatype_t *io_array_type=MPI_DATATYPE_NULL; int **adj_matrix=NULL; @@ -172,9 +172,9 @@ int ompi_io_ompio_generate_current_file_view (struct mca_io_ompio_file_t *fh, types[1] = &ompi_mpi_long.dt; types[2] = &ompi_mpi_int.dt; - d[0] = (OPAL_PTRDIFF_TYPE)&per_process[0]; - d[1] = (OPAL_PTRDIFF_TYPE)&per_process[0].length; - d[2] = (OPAL_PTRDIFF_TYPE)&per_process[0].process_id; + d[0] = (ptrdiff_t)&per_process[0]; + d[1] = (ptrdiff_t)&per_process[0].length; + d[2] = (ptrdiff_t)&per_process[0].process_id; base = d[0]; for (i=0;i<3;i++){ d[i] -= base; diff --git a/ompi/mca/io/ompio/io_ompio.h b/ompi/mca/io/ompio/io_ompio.h index 078e66c676..e2b552e534 100644 --- a/ompi/mca/io/ompio/io_ompio.h +++ b/ompi/mca/io/ompio/io_ompio.h @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2008-2016 University of Houston. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -237,7 +237,7 @@ struct mca_io_ompio_file_t { size_t f_position_in_file_view; /* in bytes */ size_t f_total_bytes; /* total bytes read/written within 1 Fview*/ int f_index_in_file_view; - OPAL_PTRDIFF_TYPE f_view_extent; + ptrdiff_t f_view_extent; size_t f_view_size; ompi_datatype_t *f_etype; ompi_datatype_t *f_filetype; diff --git a/ompi/mca/osc/base/osc_base_obj_convert.c b/ompi/mca/osc/base/osc_base_obj_convert.c index d91d4d3080..bb4641c659 100644 --- a/ompi/mca/osc/base/osc_base_obj_convert.c +++ b/ompi/mca/osc/base/osc_base_obj_convert.c @@ -11,7 +11,7 @@ * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Intel, Inc. All rights reserved. @@ -105,7 +105,7 @@ int ompi_osc_base_process_op (void *outbuf, void *inbuf, size_t inbuflen, struct iovec iov[OMPI_OSC_BASE_DECODE_MAX]; uint32_t iov_count; size_t size, primitive_size; - OPAL_PTRDIFF_TYPE lb, extent; + ptrdiff_t lb, extent; bool done; primitive_datatype = ompi_datatype_get_single_predefined_type_from_args(datatype); diff --git a/ompi/mca/osc/osc.h b/ompi/mca/osc/osc.h index 61ae288003..4ab065d888 100644 --- a/ompi/mca/osc/osc.h +++ b/ompi/mca/osc/osc.h @@ -11,7 +11,7 @@ * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -207,7 +207,7 @@ typedef int (*ompi_osc_base_module_put_fn_t)(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -217,7 +217,7 @@ typedef int (*ompi_osc_base_module_get_fn_t)(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -227,7 +227,7 @@ typedef int (*ompi_osc_base_module_accumulate_fn_t)(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -238,14 +238,14 @@ typedef int (*ompi_osc_base_module_compare_and_swap_fn_t)(const void *origin_add void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win); typedef int (*ompi_osc_base_module_fetch_and_op_fn_t)(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win); @@ -256,7 +256,7 @@ typedef int (*ompi_osc_base_module_get_accumulate_fn_t)(const void *origin_addr, int result_count, struct ompi_datatype_t *result_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, @@ -266,7 +266,7 @@ typedef int (*ompi_osc_base_module_rput_fn_t)(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -276,7 +276,7 @@ typedef int (*ompi_osc_base_module_rget_fn_t)(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -287,7 +287,7 @@ typedef int (*ompi_osc_base_module_raccumulate_fn_t)(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -301,7 +301,7 @@ typedef int (*ompi_osc_base_module_rget_accumulate_fn_t)(const void *origin_addr int result_count, struct ompi_datatype_t *result_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, diff --git a/ompi/mca/osc/portals4/osc_portals4.h b/ompi/mca/osc/portals4/osc_portals4.h index b35c0ed905..161ac4b291 100644 --- a/ompi/mca/osc/portals4/osc_portals4.h +++ b/ompi/mca/osc/portals4/osc_portals4.h @@ -3,7 +3,7 @@ * Copyright (c) 2011-2017 Sandia National Laboratories. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -143,7 +143,7 @@ int ompi_osc_portals4_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -152,7 +152,7 @@ int ompi_osc_portals4_get(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -161,7 +161,7 @@ int ompi_osc_portals4_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -172,14 +172,14 @@ int ompi_osc_portals4_compare_and_swap(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win); int ompi_osc_portals4_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win); @@ -190,7 +190,7 @@ int ompi_osc_portals4_get_accumulate(const void *origin_addr, int result_count, struct ompi_datatype_t *result_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, @@ -200,7 +200,7 @@ int ompi_osc_portals4_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -210,7 +210,7 @@ int ompi_osc_portals4_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -220,7 +220,7 @@ int ompi_osc_portals4_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -234,7 +234,7 @@ int ompi_osc_portals4_rget_accumulate(const void *origin_addr, int result_count, struct ompi_datatype_t *result_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_datatype, struct ompi_op_t *op, diff --git a/ompi/mca/osc/portals4/osc_portals4_comm.c b/ompi/mca/osc/portals4/osc_portals4_comm.c index 3b197f9708..b792d20f8b 100644 --- a/ompi/mca/osc/portals4/osc_portals4_comm.c +++ b/ompi/mca/osc/portals4/osc_portals4_comm.c @@ -3,7 +3,7 @@ * Copyright (c) 2014 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -501,7 +501,7 @@ get_to_iovec(ompi_osc_portals4_module_t *module, { int ret; size_t size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; ptl_md_t md; if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) { @@ -588,7 +588,7 @@ atomic_get_to_iovec(ompi_osc_portals4_module_t *module, { int ret; size_t size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; ptl_md_t md; if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) { @@ -670,7 +670,7 @@ put_from_iovec(ompi_osc_portals4_module_t *module, { int ret; size_t size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; ptl_md_t md; if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) { @@ -759,7 +759,7 @@ atomic_put_from_iovec(ompi_osc_portals4_module_t *module, { int ret; size_t size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; ptl_md_t md; if (module->origin_iovec_md_h != PTL_INVALID_HANDLE) { @@ -844,7 +844,7 @@ atomic_from_iovec(ompi_osc_portals4_module_t *module, { int ret; size_t size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; ptl_md_t md; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; @@ -944,7 +944,7 @@ swap_to_iovec(ompi_osc_portals4_module_t *module, int ret; size_t size; ptl_size_t iovec_count=0; - OPAL_PTRDIFF_TYPE length, result_lb, origin_lb, target_lb, extent; + ptrdiff_t length, result_lb, origin_lb, target_lb, extent; ptl_md_t md; ptl_datatype_t ptl_dt; @@ -1069,7 +1069,7 @@ fetch_atomic_to_iovec(ompi_osc_portals4_module_t *module, int ret; size_t size; ptl_size_t iovec_count=0; - OPAL_PTRDIFF_TYPE length, result_lb, origin_lb, target_lb, extent; + ptrdiff_t length, result_lb, origin_lb, target_lb, extent; ptl_md_t md; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; @@ -2021,7 +2021,7 @@ ompi_osc_portals4_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -2033,7 +2033,7 @@ ompi_osc_portals4_rput(const void *origin_addr, (ompi_osc_portals4_module_t*) win->w_osc_module; ptl_process_t peer = ompi_osc_portals4_get_peer(module, target); size_t size, offset; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "rput: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", @@ -2133,7 +2133,7 @@ ompi_osc_portals4_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -2145,7 +2145,7 @@ ompi_osc_portals4_rget(void *origin_addr, (ompi_osc_portals4_module_t*) win->w_osc_module; ptl_process_t peer = ompi_osc_portals4_get_peer(module, target); size_t offset, size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "rget: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", @@ -2238,7 +2238,7 @@ ompi_osc_portals4_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -2253,7 +2253,7 @@ ompi_osc_portals4_raccumulate(const void *origin_addr, size_t offset, size; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; - OPAL_PTRDIFF_TYPE sent, length, origin_lb, target_lb, extent; + ptrdiff_t sent, length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "raccumulate: 0x%lx, %d, %s, %d, %lu, %d, %s, %s 0x%lx", @@ -2449,7 +2449,7 @@ ompi_osc_portals4_rget_accumulate(const void *origin_addr, int result_count, struct ompi_datatype_t *result_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -2464,7 +2464,7 @@ ompi_osc_portals4_rget_accumulate(const void *origin_addr, size_t target_offset, size; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, result_lb, extent; + ptrdiff_t length, origin_lb, target_lb, result_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "rget_accumulate: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", @@ -2798,7 +2798,7 @@ ompi_osc_portals4_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) @@ -2808,7 +2808,7 @@ ompi_osc_portals4_put(const void *origin_addr, (ompi_osc_portals4_module_t*) win->w_osc_module; ptl_process_t peer = ompi_osc_portals4_get_peer(module, target); size_t offset, size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "put: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", @@ -2897,7 +2897,7 @@ ompi_osc_portals4_get(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) @@ -2907,7 +2907,7 @@ ompi_osc_portals4_get(void *origin_addr, (ompi_osc_portals4_module_t*) win->w_osc_module; ptl_process_t peer = ompi_osc_portals4_get_peer(module, target); size_t offset, size; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, extent; + ptrdiff_t length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "get: 0x%lx, %d, %s, %d, %lu, %d, %s, 0x%lx", @@ -2993,7 +2993,7 @@ ompi_osc_portals4_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -3006,7 +3006,7 @@ ompi_osc_portals4_accumulate(const void *origin_addr, size_t offset, size; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; - OPAL_PTRDIFF_TYPE sent, length, origin_lb, target_lb, extent; + ptrdiff_t sent, length, origin_lb, target_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "accumulate: 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", @@ -3186,7 +3186,7 @@ ompi_osc_portals4_get_accumulate(const void *origin_addr, int result_count, struct ompi_datatype_t *result_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -3199,7 +3199,7 @@ ompi_osc_portals4_get_accumulate(const void *origin_addr, size_t target_offset, size; ptl_op_t ptl_op; ptl_datatype_t ptl_dt; - OPAL_PTRDIFF_TYPE length, origin_lb, target_lb, result_lb, extent; + ptrdiff_t length, origin_lb, target_lb, result_lb, extent; OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output, "get_accumulate: 0x%lx, %d, %s, 0x%lx, %d, %s, %d, %lu, %d, %s, %s, 0x%lx", @@ -3504,7 +3504,7 @@ ompi_osc_portals4_compare_and_swap(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win) { int ret; @@ -3572,7 +3572,7 @@ ompi_osc_portals4_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win) { diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt.h b/ompi/mca/osc/pt2pt/osc_pt2pt.h index 5901aa2e1a..e3434f6504 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt.h +++ b/ompi/mca/osc/pt2pt/osc_pt2pt.h @@ -12,7 +12,7 @@ * reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2015-2016 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 FUJITSU LIMITED. All rights reserved. * $COPYRIGHT$ @@ -328,7 +328,7 @@ int ompi_osc_pt2pt_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -337,7 +337,7 @@ int ompi_osc_pt2pt_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -347,7 +347,7 @@ int ompi_osc_pt2pt_get(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -357,14 +357,14 @@ int ompi_osc_pt2pt_compare_and_swap(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win); int ompi_osc_pt2pt_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win); @@ -385,7 +385,7 @@ int ompi_osc_pt2pt_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -395,7 +395,7 @@ int ompi_osc_pt2pt_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -405,7 +405,7 @@ int ompi_osc_pt2pt_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, diff --git a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c index f093527344..a8c218c4cf 100644 --- a/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c +++ b/ompi/mca/osc/pt2pt/osc_pt2pt_comm.c @@ -12,7 +12,7 @@ * reserved. * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2012-2013 Sandia National Laboratories. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 FUJITSU LIMITED. All rights reserved. * Copyright (c) 2016 IBM Corporation. All rights reserved. @@ -108,7 +108,7 @@ static int ompi_osc_pt2pt_dt_send_complete (ompi_request_t *request) /* self communication optimizations */ static inline int ompi_osc_pt2pt_put_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, const void *source, int source_count, - ompi_datatype_t *source_datatype, OPAL_PTRDIFF_TYPE target_disp, int target_count, + ompi_datatype_t *source_datatype, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_osc_pt2pt_module_t *module, ompi_osc_pt2pt_request_t *request) { @@ -133,7 +133,7 @@ static inline int ompi_osc_pt2pt_put_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, co } static inline int ompi_osc_pt2pt_get_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, void *target, int target_count, ompi_datatype_t *target_datatype, - OPAL_PTRDIFF_TYPE source_disp, int source_count, ompi_datatype_t *source_datatype, + ptrdiff_t source_disp, int source_count, ompi_datatype_t *source_datatype, ompi_osc_pt2pt_module_t *module, ompi_osc_pt2pt_request_t *request) { void *source = (unsigned char*) module->baseptr + @@ -157,7 +157,7 @@ static inline int ompi_osc_pt2pt_get_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, vo } static inline int ompi_osc_pt2pt_cas_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, const void *source, const void *compare, void *result, - ompi_datatype_t *datatype, OPAL_PTRDIFF_TYPE target_disp, ompi_osc_pt2pt_module_t *module) + ompi_datatype_t *datatype, ptrdiff_t target_disp, ompi_osc_pt2pt_module_t *module) { void *target = (unsigned char*) module->baseptr + ((unsigned long) target_disp * module->disp_unit); @@ -179,7 +179,7 @@ static inline int ompi_osc_pt2pt_cas_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, co } static inline int ompi_osc_pt2pt_acc_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, const void *source, int source_count, ompi_datatype_t *source_datatype, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_osc_pt2pt_module_t *module, ompi_osc_pt2pt_request_t *request) { void *target = (unsigned char*) module->baseptr + @@ -214,7 +214,7 @@ static inline int ompi_osc_pt2pt_acc_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, co static inline int ompi_osc_pt2pt_gacc_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, const void *source, int source_count, ompi_datatype_t *source_datatype, void *result, int result_count, ompi_datatype_t *result_datatype, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_osc_pt2pt_module_t *module, ompi_osc_pt2pt_request_t *request) { void *target = (unsigned char*) module->baseptr + @@ -267,7 +267,7 @@ static inline int ompi_osc_pt2pt_gacc_self (ompi_osc_pt2pt_sync_t *pt2pt_sync, c static inline int ompi_osc_pt2pt_put_w_req (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, ompi_win_t *win, ompi_osc_pt2pt_request_t *request) { @@ -418,7 +418,7 @@ static inline int ompi_osc_pt2pt_put_w_req (const void *origin_addr, int origin_ int ompi_osc_pt2pt_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, ompi_win_t *win) { @@ -431,7 +431,7 @@ ompi_osc_pt2pt_put(const void *origin_addr, int origin_count, static int ompi_osc_pt2pt_accumulate_w_req (const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, ompi_win_t *win, @@ -593,7 +593,7 @@ ompi_osc_pt2pt_accumulate_w_req (const void *origin_addr, int origin_count, int ompi_osc_pt2pt_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, ompi_win_t *win) @@ -605,7 +605,7 @@ ompi_osc_pt2pt_accumulate(const void *origin_addr, int origin_count, int ompi_osc_pt2pt_compare_and_swap (const void *origin_addr, const void *compare_addr, void *result_addr, struct ompi_datatype_t *dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, struct ompi_win_t *win) { ompi_osc_pt2pt_module_t *module = GET_MODULE(win); @@ -697,7 +697,7 @@ int ompi_osc_pt2pt_compare_and_swap (const void *origin_addr, const void *compar int ompi_osc_pt2pt_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, struct ompi_op_t *op, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win) { return ompi_osc_pt2pt_get_accumulate(origin_addr, 1, dt, result_addr, 1, dt, @@ -706,7 +706,7 @@ int ompi_osc_pt2pt_fetch_and_op(const void *origin_addr, void *result_addr, int ompi_osc_pt2pt_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request) { @@ -746,7 +746,7 @@ int ompi_osc_pt2pt_rput(const void *origin_addr, int origin_count, static inline int ompi_osc_pt2pt_rget_internal (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, bool release_req, @@ -879,7 +879,7 @@ static inline int ompi_osc_pt2pt_rget_internal (void *origin_addr, int origin_co } int ompi_osc_pt2pt_rget (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, struct ompi_request_t **request) { @@ -890,7 +890,7 @@ int ompi_osc_pt2pt_rget (void *origin_addr, int origin_count, struct ompi_dataty int ompi_osc_pt2pt_get (void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) { ompi_request_t *request; @@ -901,7 +901,7 @@ int ompi_osc_pt2pt_get (void *origin_addr, int origin_count, struct ompi_datatyp int ompi_osc_pt2pt_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, int target_count, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, struct ompi_win_t *win, struct ompi_request_t **request) { diff --git a/ompi/mca/osc/rdma/osc_rdma_accumulate.c b/ompi/mca/osc/rdma/osc_rdma_accumulate.c index 0fd2bbdd6e..8ddfbd1087 100644 --- a/ompi/mca/osc/rdma/osc_rdma_accumulate.c +++ b/ompi/mca/osc/rdma/osc_rdma_accumulate.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2016 Research Organization for Information Science + * Copyright (c) 2016-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * Copyright (c) 2016 Intel, Inc. All rights reserved. * $COPYRIGHT$ @@ -959,7 +959,7 @@ static inline int cas_rdma (ompi_osc_rdma_sync_t *sync, const void *source_addr, int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare_addr, void *result_addr, - ompi_datatype_t *dt, int target_rank, OPAL_PTRDIFF_TYPE target_disp, + ompi_datatype_t *dt, int target_rank, ptrdiff_t target_disp, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -1133,7 +1133,7 @@ int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, om } int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -1167,7 +1167,7 @@ int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_d } int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -1190,7 +1190,7 @@ int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_da int ompi_osc_rdma_fetch_and_op (const void *origin_addr, void *result_addr, ompi_datatype_t *dt, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, ompi_op_t *op, ompi_win_t *win) + ptrdiff_t target_disp, ompi_op_t *op, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); ompi_osc_rdma_peer_t *peer; diff --git a/ompi/mca/osc/rdma/osc_rdma_accumulate.h b/ompi/mca/osc/rdma/osc_rdma_accumulate.h index 7ab370ab2b..74f41abf6e 100644 --- a/ompi/mca/osc/rdma/osc_rdma_accumulate.h +++ b/ompi/mca/osc/rdma/osc_rdma_accumulate.h @@ -2,6 +2,8 @@ /* * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2016-2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -15,15 +17,15 @@ #include "osc_rdma.h" int ompi_osc_rdma_compare_and_swap (const void *origin_addr, const void *compare_addr, void *result_addr, - ompi_datatype_t *dt, int target_rank, OPAL_PTRDIFF_TYPE target_disp, + ompi_datatype_t *dt, int target_rank, ptrdiff_t target_disp, ompi_win_t *win); int ompi_osc_rdma_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win); int ompi_osc_rdma_fetch_and_op (const void *origin_addr, void *result_addr, ompi_datatype_t *dt, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, ompi_op_t *op, ompi_win_t *win); + ptrdiff_t target_disp, ompi_op_t *op, ompi_win_t *win); int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, void *result_addr, int result_count, ompi_datatype_t *result_datatype, @@ -31,7 +33,7 @@ int ompi_osc_rdma_get_accumulate (const void *origin_addr, int origin_count, omp ompi_op_t *op, ompi_win_t *win); int ompi_osc_rdma_raccumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, int target_rank, - OPAL_PTRDIFF_TYPE target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_op_t *op, ompi_win_t *win, ompi_request_t **request); int ompi_osc_rdma_rget_accumulate (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.c b/ompi/mca/osc/rdma/osc_rdma_comm.c index d4daad37b6..adea62ced5 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -3,6 +3,8 @@ * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2016 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -774,7 +776,7 @@ static int ompi_osc_rdma_get_contig (ompi_osc_rdma_sync_t *sync, ompi_osc_rdma_p static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, ompi_osc_rdma_peer_t *peer, - OPAL_PTRDIFF_TYPE target_disp, int target_count, + ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_osc_rdma_request_t *request) { ompi_osc_rdma_module_t *module = sync->module; @@ -809,7 +811,7 @@ static inline int ompi_osc_rdma_put_w_req (ompi_osc_rdma_sync_t *sync, const voi } static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - ompi_osc_rdma_peer_t *peer, OPAL_PTRDIFF_TYPE source_disp, int source_count, + ompi_osc_rdma_peer_t *peer, ptrdiff_t source_disp, int source_count, ompi_datatype_t *source_datatype, ompi_osc_rdma_request_t *request) { ompi_osc_rdma_module_t *module = sync->module; @@ -843,7 +845,7 @@ static inline int ompi_osc_rdma_get_w_req (ompi_osc_rdma_sync_t *sync, void *ori module->selected_btl->btl_get_limit, ompi_osc_rdma_get_contig, true); } int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int target_rank, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target_rank, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -864,7 +866,7 @@ int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_ } int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int target_rank, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target_rank, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_datatype, ompi_win_t *win, ompi_request_t **request) { @@ -899,7 +901,7 @@ int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype } int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int source_rank, OPAL_PTRDIFF_TYPE source_disp, int source_count, + int source_rank, ptrdiff_t source_disp, int source_count, ompi_datatype_t *source_datatype, ompi_win_t *win) { ompi_osc_rdma_module_t *module = GET_MODULE(win); @@ -920,7 +922,7 @@ int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *ori } int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_datatype, - int source_rank, OPAL_PTRDIFF_TYPE source_disp, int source_count, + int source_rank, ptrdiff_t source_disp, int source_count, ompi_datatype_t *source_datatype, ompi_win_t *win, ompi_request_t **request) { diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.h b/ompi/mca/osc/rdma/osc_rdma_comm.h index e9b048c56e..0e2daf2b4e 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.h +++ b/ompi/mca/osc/rdma/osc_rdma_comm.h @@ -2,6 +2,8 @@ /* * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -53,7 +55,7 @@ static inline void ompi_osc_rdma_cleanup_rdma (ompi_osc_rdma_sync_t *sync, ompi_ * @returns OMPI_ERR_RMA_RANGE if the address range is not valid at the remote window * @returns other OMPI error on error */ -static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer, OPAL_PTRDIFF_TYPE target_disp, +static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, ompi_osc_rdma_peer_t *peer, ptrdiff_t target_disp, size_t length, uint64_t *remote_address, mca_btl_base_registration_handle_t **remote_handle) { ompi_osc_rdma_region_t *region; @@ -97,20 +99,20 @@ static inline int osc_rdma_get_remote_segment (ompi_osc_rdma_module_t *module, o /* prototypes for implementations of MPI RMA window functions. these will be called from the * mpi interface (ompi/mpi/c) */ int ompi_osc_rdma_put (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_dt, ompi_win_t *win); int ompi_osc_rdma_get (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_dt, ompi_win_t *win); int ompi_osc_rdma_rput (const void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_dt, ompi_win_t *win, ompi_request_t **request); int ompi_osc_rdma_rget (void *origin_addr, int origin_count, ompi_datatype_t *origin_dt, - int target, OPAL_PTRDIFF_TYPE target_disp, int target_count, + int target, ptrdiff_t target_disp, int target_count, ompi_datatype_t *target_dt, ompi_win_t *win, ompi_request_t **request); diff --git a/ompi/mca/osc/sm/osc_sm.h b/ompi/mca/osc/sm/osc_sm.h index 7c058465b0..5ed2f5731e 100644 --- a/ompi/mca/osc/sm/osc_sm.h +++ b/ompi/mca/osc/sm/osc_sm.h @@ -3,7 +3,7 @@ * Copyright (c) 2012 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014-2015 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -97,7 +97,7 @@ int ompi_osc_sm_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -106,7 +106,7 @@ int ompi_osc_sm_get(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win); @@ -115,7 +115,7 @@ int ompi_osc_sm_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -126,14 +126,14 @@ int ompi_osc_sm_compare_and_swap(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win); int ompi_osc_sm_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win); @@ -154,7 +154,7 @@ int ompi_osc_sm_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -164,7 +164,7 @@ int ompi_osc_sm_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -174,7 +174,7 @@ int ompi_osc_sm_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, diff --git a/ompi/mca/osc/sm/osc_sm_comm.c b/ompi/mca/osc/sm/osc_sm_comm.c index e6f3da44e6..b6094dd16e 100644 --- a/ompi/mca/osc/sm/osc_sm_comm.c +++ b/ompi/mca/osc/sm/osc_sm_comm.c @@ -3,7 +3,7 @@ * Copyright (c) 2011 Sandia National Laboratories. All rights reserved. * Copyright (c) 2014 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -25,7 +25,7 @@ ompi_osc_sm_rput(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -65,7 +65,7 @@ ompi_osc_sm_rget(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win, @@ -105,7 +105,7 @@ ompi_osc_sm_raccumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -210,7 +210,7 @@ ompi_osc_sm_put(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) @@ -241,7 +241,7 @@ ompi_osc_sm_get(void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_win_t *win) @@ -272,7 +272,7 @@ ompi_osc_sm_accumulate(const void *origin_addr, int origin_count, struct ompi_datatype_t *origin_dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, int target_count, struct ompi_datatype_t *target_dt, struct ompi_op_t *op, @@ -365,7 +365,7 @@ ompi_osc_sm_compare_and_swap(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_win_t *win) { ompi_osc_sm_module_t *module = @@ -404,7 +404,7 @@ ompi_osc_sm_fetch_and_op(const void *origin_addr, void *result_addr, struct ompi_datatype_t *dt, int target, - OPAL_PTRDIFF_TYPE target_disp, + ptrdiff_t target_disp, struct ompi_op_t *op, struct ompi_win_t *win) { diff --git a/ompi/patterns/comm/allgather.c b/ompi/patterns/comm/allgather.c index 48321bf3cf..ceef10bbbe 100644 --- a/ompi/patterns/comm/allgather.c +++ b/ompi/patterns/comm/allgather.c @@ -3,7 +3,7 @@ * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -40,7 +40,7 @@ OMPI_DECLSPEC int comm_allgather_pml(void *src_buf, void *dest_buf, int count, netpatterns_pair_exchange_node_t my_exchange_node; size_t message_extent,current_data_extent,current_data_count; size_t dt_size; - OPAL_PTRDIFF_TYPE dt_extent; + ptrdiff_t dt_extent; char *src_buf_current; char *dest_buf_current; struct iovec send_iov[2] = {{0,0},{0,0}}, diff --git a/ompi/patterns/comm/allreduce.c b/ompi/patterns/comm/allreduce.c index 2fbf9e2177..c7342a41e8 100644 --- a/ompi/patterns/comm/allreduce.c +++ b/ompi/patterns/comm/allreduce.c @@ -3,7 +3,7 @@ * Copyright (c) 2009-2012 Oak Ridge National Laboratory. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2014 Research Organization for Information Science + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -51,7 +51,7 @@ OMPI_DECLSPEC int comm_allreduce_pml(void *sbuf, void *rbuf, int count, if( OMPI_SUCCESS != rc ) { goto Error; } - rc = ompi_datatype_type_extent(dtype, (OPAL_PTRDIFF_TYPE *)&dt_extent); + rc = ompi_datatype_type_extent(dtype, (ptrdiff_t *)&dt_extent); if( OMPI_SUCCESS != rc ) { goto Error; } diff --git a/opal/datatype/opal_convertor.c b/opal/datatype/opal_convertor.c index 46aff82972..e555e4df83 100644 --- a/opal/datatype/opal_convertor.c +++ b/opal/datatype/opal_convertor.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2013-2016 Research Organization for Information Science + * Copyright (c) 2013-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -333,7 +333,7 @@ static inline int opal_convertor_create_stack_with_pos_contig( opal_convertor_t* const opal_datatype_t* pData = pConvertor->pDesc; dt_elem_desc_t* pElems; uint32_t count; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; pStack = pConvertor->pStack; /** @@ -599,7 +599,7 @@ int32_t opal_convertor_prepare_for_send( opal_convertor_t* convertor, convertor->fAdvance = opal_pack_general_checksum; } else { if( datatype->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { - if( ((datatype->ub - datatype->lb) == (OPAL_PTRDIFF_TYPE)datatype->size) + if( ((datatype->ub - datatype->lb) == (ptrdiff_t)datatype->size) || (1 >= convertor->count) ) convertor->fAdvance = opal_pack_homogeneous_contig_checksum; else @@ -613,7 +613,7 @@ int32_t opal_convertor_prepare_for_send( opal_convertor_t* convertor, convertor->fAdvance = opal_pack_general; } else { if( datatype->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { - if( ((datatype->ub - datatype->lb) == (OPAL_PTRDIFF_TYPE)datatype->size) + if( ((datatype->ub - datatype->lb) == (ptrdiff_t)datatype->size) || (1 >= convertor->count) ) convertor->fAdvance = opal_pack_homogeneous_contig; else diff --git a/opal/datatype/opal_convertor.h b/opal/datatype/opal_convertor.h index 7c5de1af39..716c336622 100644 --- a/opal/datatype/opal_convertor.h +++ b/opal/datatype/opal_convertor.h @@ -12,6 +12,8 @@ * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -70,7 +72,7 @@ struct dt_stack_t { int32_t index; /**< index in the element description */ int16_t type; /**< the type used for the last pack/unpack (original or OPAL_DATATYPE_UINT1) */ size_t count; /**< number of times we still have to do it */ - OPAL_PTRDIFF_TYPE disp; /**< actual displacement depending on the count field */ + ptrdiff_t disp; /**< actual displacement depending on the count field */ }; typedef struct dt_stack_t dt_stack_t; diff --git a/opal/datatype/opal_convertor_internal.h b/opal/datatype/opal_convertor_internal.h index 8c7f9f05da..025633cb7e 100644 --- a/opal/datatype/opal_convertor_internal.h +++ b/opal/datatype/opal_convertor_internal.h @@ -4,7 +4,9 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -21,9 +23,9 @@ BEGIN_C_DECLS typedef int32_t (*conversion_fct_t)( opal_convertor_t* pConvertor, uint32_t count, - const void* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, - void* to, size_t to_length, OPAL_PTRDIFF_TYPE to_extent, - OPAL_PTRDIFF_TYPE *advance ); + const void* from, size_t from_len, ptrdiff_t from_extent, + void* to, size_t to_length, ptrdiff_t to_extent, + ptrdiff_t *advance ); typedef struct opal_convertor_master_t { struct opal_convertor_master_t* next; diff --git a/opal/datatype/opal_convertor_raw.c b/opal/datatype/opal_convertor_raw.c index ce0eaf3330..0901938812 100644 --- a/opal/datatype/opal_convertor_raw.c +++ b/opal/datatype/opal_convertor_raw.c @@ -4,7 +4,9 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -164,7 +166,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor, pos_desc, (long)pStack->disp, (unsigned long)raw_data ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)source_base; + ptrdiff_t local_disp = (ptrdiff_t)source_base; ddt_endloop_desc_t* end_loop = (ddt_endloop_desc_t*)(pElem + pElem->loop.items); if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { @@ -185,7 +187,7 @@ opal_convertor_raw( opal_convertor_t* pConvertor, goto update_loop_description; } } - local_disp = (OPAL_PTRDIFF_TYPE)source_base - local_disp; + local_disp = (ptrdiff_t)source_base - local_disp; PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp); pos_desc++; diff --git a/opal/datatype/opal_copy_functions.c b/opal/datatype/opal_copy_functions.c index 433cf4173e..221d07a920 100644 --- a/opal/datatype/opal_copy_functions.c +++ b/opal/datatype/opal_copy_functions.c @@ -4,9 +4,9 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. - * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -40,9 +40,9 @@ */ #define COPY_TYPE( TYPENAME, TYPE, COUNT ) \ static int copy_##TYPENAME( opal_convertor_t *pConvertor, uint32_t count, \ - char* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, \ - char* to, size_t to_len, OPAL_PTRDIFF_TYPE to_extent, \ - OPAL_PTRDIFF_TYPE *advance) \ + char* from, size_t from_len, ptrdiff_t from_extent, \ + char* to, size_t to_len, ptrdiff_t to_extent, \ + ptrdiff_t *advance) \ { \ uint32_t i; \ size_t remote_TYPE_size = sizeof(TYPE) * (COUNT); /* TODO */ \ @@ -61,8 +61,8 @@ static int copy_##TYPENAME( opal_convertor_t *pConvertor, uint32_t count, DUMP( " copy %s count %d from buffer %p with length %d to %p space %d\n", \ #TYPE, count, from, from_len, to, to_len ); \ \ - if( (from_extent == (OPAL_PTRDIFF_TYPE)local_TYPE_size) && \ - (to_extent == (OPAL_PTRDIFF_TYPE)remote_TYPE_size) ) { \ + if( (from_extent == (ptrdiff_t)local_TYPE_size) && \ + (to_extent == (ptrdiff_t)remote_TYPE_size) ) { \ /* copy of contigous data at both source and destination */ \ MEMCPY( to, from, count * local_TYPE_size ); \ } else { \ @@ -93,9 +93,9 @@ static int copy_##TYPENAME( opal_convertor_t *pConvertor, uint32_t count, */ #define COPY_CONTIGUOUS_BYTES( TYPENAME, COUNT ) \ static int copy_##TYPENAME##_##COUNT( opal_convertor_t *pConvertor, uint32_t count, \ - char* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, \ - char* to, size_t to_len, OPAL_PTRDIFF_TYPE to_extent, \ - OPAL_PTRDIFF_TYPE *advance ) \ + char* from, size_t from_len, ptrdiff_t from_extent, \ + char* to, size_t to_len, ptrdiff_t to_extent, \ + ptrdiff_t *advance ) \ { \ uint32_t i; \ size_t remote_TYPE_size = (size_t)(COUNT); /* TODO */ \ @@ -113,8 +113,8 @@ static int copy_##TYPENAME##_##COUNT( opal_convertor_t *pConvertor, uint32_t cou DUMP( " copy %s count %d from buffer %p with length %d to %p space %d\n", \ #TYPENAME, count, from, from_len, to, to_len ); \ \ - if( (from_extent == (OPAL_PTRDIFF_TYPE)local_TYPE_size) && \ - (to_extent == (OPAL_PTRDIFF_TYPE)remote_TYPE_size) ) { \ + if( (from_extent == (ptrdiff_t)local_TYPE_size) && \ + (to_extent == (ptrdiff_t)remote_TYPE_size) ) { \ MEMCPY( to, from, count * local_TYPE_size ); \ } else { \ for( i = 0; i < count; i++ ) { \ diff --git a/opal/datatype/opal_copy_functions_heterogeneous.c b/opal/datatype/opal_copy_functions_heterogeneous.c index 956a1d46bc..56d27b82e3 100644 --- a/opal/datatype/opal_copy_functions_heterogeneous.c +++ b/opal/datatype/opal_copy_functions_heterogeneous.c @@ -4,7 +4,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -71,9 +71,9 @@ opal_dt_swap_bytes(void *to_p, const void *from_p, const size_t size, size_t cou #define COPY_TYPE_HETEROGENEOUS( TYPENAME, TYPE ) \ static int32_t \ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \ - const char* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, \ - char* to, size_t to_length, OPAL_PTRDIFF_TYPE to_extent, \ - OPAL_PTRDIFF_TYPE *advance) \ + const char* from, size_t from_len, ptrdiff_t from_extent, \ + char* to, size_t to_length, ptrdiff_t to_extent, \ + ptrdiff_t *advance) \ { \ uint32_t i; \ \ @@ -92,8 +92,8 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, from += from_extent; \ } \ } \ - } else if ((OPAL_PTRDIFF_TYPE)sizeof(TYPE) == to_extent && \ - (OPAL_PTRDIFF_TYPE)sizeof(TYPE) == from_extent) { \ + } else if ((ptrdiff_t)sizeof(TYPE) == to_extent && \ + (ptrdiff_t)sizeof(TYPE) == from_extent) { \ MEMCPY( to, from, count * sizeof(TYPE) ); \ } else { \ /* source or destination are non-contigous */ \ @@ -110,9 +110,9 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, #define COPY_2SAMETYPE_HETEROGENEOUS( TYPENAME, TYPE ) \ static int32_t \ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \ - const char* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, \ - char* to, size_t to_length, OPAL_PTRDIFF_TYPE to_extent, \ - OPAL_PTRDIFF_TYPE *advance) \ + const char* from, size_t from_len, ptrdiff_t from_extent, \ + char* to, size_t to_length, ptrdiff_t to_extent, \ + ptrdiff_t *advance) \ { \ uint32_t i; \ \ @@ -131,8 +131,8 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, from += from_extent; \ } \ } \ - } else if ((OPAL_PTRDIFF_TYPE)sizeof(TYPE) == to_extent && \ - (OPAL_PTRDIFF_TYPE)sizeof(TYPE) == from_extent) { \ + } else if ((ptrdiff_t)sizeof(TYPE) == to_extent && \ + (ptrdiff_t)sizeof(TYPE) == from_extent) { \ MEMCPY( to, from, count * sizeof(TYPE) ); \ } else { \ /* source or destination are non-contigous */ \ @@ -149,9 +149,9 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, #define COPY_2TYPE_HETEROGENEOUS( TYPENAME, TYPE1, TYPE2 ) \ static int32_t \ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \ - const char* from, uint32_t from_len, OPAL_PTRDIFF_TYPE from_extent, \ - char* to, uint32_t to_length, OPAL_PTRDIFF_TYPE to_extent, \ - OPAL_PTRDIFF_TYPE *advance) \ + const char* from, uint32_t from_len, ptrdiff_t from_extent, \ + char* to, uint32_t to_length, ptrdiff_t to_extent, \ + ptrdiff_t *advance) \ { \ uint32_t i; \ \ @@ -173,8 +173,8 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \ to += to_extent; \ from += from_extent; \ } \ - } else if ((OPAL_PTRDIFF_TYPE)(sizeof(TYPE1) + sizeof(TYPE2)) == to_extent && \ - (OPAL_PTRDIFF_TYPE)(sizeof(TYPE1) + sizeof(TYPE2)) == from_extent) { \ + } else if ((ptrdiff_t)(sizeof(TYPE1) + sizeof(TYPE2)) == to_extent && \ + (ptrdiff_t)(sizeof(TYPE1) + sizeof(TYPE2)) == from_extent) { \ /* source and destination are contigous */ \ MEMCPY( to, from, count * (sizeof(TYPE1) + sizeof(TYPE2)) ); \ } else { \ @@ -192,8 +192,8 @@ copy_##TYPENAME##_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, \ static inline void datatype_check(char *type, size_t local_size, size_t remote_size, uint32_t *count, - const char* from, size_t from_len, OPAL_PTRDIFF_TYPE from_extent, - char* to, size_t to_len, OPAL_PTRDIFF_TYPE to_extent) + const char* from, size_t from_len, ptrdiff_t from_extent, + char* to, size_t to_len, ptrdiff_t to_extent) { /* make sure the remote buffer is large enough to hold the data */ if( (remote_size * *count) > from_len ) { @@ -219,9 +219,9 @@ datatype_check(char *type, size_t local_size, size_t remote_size, uint32_t *coun } static int32_t copy_cxx_bool_heterogeneous(opal_convertor_t *pConvertor, uint32_t count, - const char* from, uint32_t from_len, OPAL_PTRDIFF_TYPE from_extent, - char* to, uint32_t to_length, OPAL_PTRDIFF_TYPE to_extent, - OPAL_PTRDIFF_TYPE *advance) + const char* from, uint32_t from_len, ptrdiff_t from_extent, + char* to, uint32_t to_length, ptrdiff_t to_extent, + ptrdiff_t *advance) { uint32_t i; diff --git a/opal/datatype/opal_datatype.h b/opal/datatype/opal_datatype.h index 34c7b4e1b6..74349b6146 100644 --- a/opal/datatype/opal_datatype.h +++ b/opal/datatype/opal_datatype.h @@ -108,10 +108,10 @@ struct opal_datatype_t { uint32_t bdt_used; /**< bitset of which basic datatypes are used in the data description */ size_t size; /**< total size in bytes of the memory used by the data if the data is put on a contiguous buffer */ - OPAL_PTRDIFF_TYPE true_lb; /**< the true lb of the data without user defined lb and ub */ - OPAL_PTRDIFF_TYPE true_ub; /**< the true ub of the data without user defined lb and ub */ - OPAL_PTRDIFF_TYPE lb; /**< lower bound in memory */ - OPAL_PTRDIFF_TYPE ub; /**< upper bound in memory */ + ptrdiff_t true_lb; /**< the true lb of the data without user defined lb and ub */ + ptrdiff_t true_ub; /**< the true ub of the data without user defined lb and ub */ + ptrdiff_t lb; /**< lower bound in memory */ + ptrdiff_t ub; /**< upper bound in memory */ /* --- cacheline 1 boundary (64 bytes) --- */ size_t nbElems; /**< total number of elements inside the datatype */ uint32_t align; /**< data should be aligned to */ @@ -226,19 +226,19 @@ OPAL_DECLSPEC void opal_datatype_dump( const opal_datatype_t* pData ); /* data creation functions */ OPAL_DECLSPEC int32_t opal_datatype_clone( const opal_datatype_t * src_type, opal_datatype_t * dest_type ); OPAL_DECLSPEC int32_t opal_datatype_create_contiguous( int count, const opal_datatype_t* oldType, opal_datatype_t** newType ); -OPAL_DECLSPEC int32_t opal_datatype_resize( opal_datatype_t* type, OPAL_PTRDIFF_TYPE lb, OPAL_PTRDIFF_TYPE extent ); +OPAL_DECLSPEC int32_t opal_datatype_resize( opal_datatype_t* type, ptrdiff_t lb, ptrdiff_t extent ); OPAL_DECLSPEC int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtAdd, uint32_t count, - OPAL_PTRDIFF_TYPE disp, OPAL_PTRDIFF_TYPE extent ); + ptrdiff_t disp, ptrdiff_t extent ); static inline int32_t -opal_datatype_type_lb( const opal_datatype_t* pData, OPAL_PTRDIFF_TYPE* disp ) +opal_datatype_type_lb( const opal_datatype_t* pData, ptrdiff_t* disp ) { *disp = pData->lb; return 0; } static inline int32_t -opal_datatype_type_ub( const opal_datatype_t* pData, OPAL_PTRDIFF_TYPE* disp ) +opal_datatype_type_ub( const opal_datatype_t* pData, ptrdiff_t* disp ) { *disp = pData->ub; return 0; @@ -252,21 +252,21 @@ opal_datatype_type_size( const opal_datatype_t* pData, size_t *size ) } static inline int32_t -opal_datatype_type_extent( const opal_datatype_t* pData, OPAL_PTRDIFF_TYPE* extent ) +opal_datatype_type_extent( const opal_datatype_t* pData, ptrdiff_t* extent ) { *extent = pData->ub - pData->lb; return 0; } static inline int32_t -opal_datatype_get_extent( const opal_datatype_t* pData, OPAL_PTRDIFF_TYPE* lb, OPAL_PTRDIFF_TYPE* extent) +opal_datatype_get_extent( const opal_datatype_t* pData, ptrdiff_t* lb, ptrdiff_t* extent) { *lb = pData->lb; *extent = pData->ub - pData->lb; return 0; } static inline int32_t -opal_datatype_get_true_extent( const opal_datatype_t* pData, OPAL_PTRDIFF_TYPE* true_lb, OPAL_PTRDIFF_TYPE* true_extent) +opal_datatype_get_true_extent( const opal_datatype_t* pData, ptrdiff_t* true_lb, ptrdiff_t* true_extent) { *true_lb = pData->true_lb; *true_extent = (pData->true_ub - pData->true_lb); @@ -297,12 +297,12 @@ opal_datatype_sndrcv( void *sbuf, int32_t scount, const opal_datatype_t* sdtype, OPAL_DECLSPEC int32_t opal_datatype_get_args( const opal_datatype_t* pData, int32_t which, int32_t * ci, int32_t * i, - int32_t * ca, OPAL_PTRDIFF_TYPE* a, + int32_t * ca, ptrdiff_t* a, int32_t * cd, opal_datatype_t** d, int32_t * type); OPAL_DECLSPEC int32_t opal_datatype_set_args( opal_datatype_t* pData, int32_t ci, int32_t ** i, - int32_t ca, OPAL_PTRDIFF_TYPE* a, + int32_t ca, ptrdiff_t* a, int32_t cd, opal_datatype_t** d,int32_t type); OPAL_DECLSPEC int32_t opal_datatype_copy_args( const opal_datatype_t* source_data, @@ -340,12 +340,12 @@ opal_datatype_create_from_packed_description( void** packed_buffer, * Returns: the memory span of count repetition of the datatype, and in the gap * argument, the number of bytes of the gap at the beginning. */ -static inline OPAL_PTRDIFF_TYPE +static inline ptrdiff_t opal_datatype_span( const opal_datatype_t* pData, int64_t count, - OPAL_PTRDIFF_TYPE* gap) + ptrdiff_t* gap) { - OPAL_PTRDIFF_TYPE extent = (pData->ub - pData->lb); - OPAL_PTRDIFF_TYPE true_extent = (pData->true_ub - pData->true_lb); + ptrdiff_t extent = (pData->ub - pData->lb); + ptrdiff_t true_extent = (pData->true_ub - pData->true_lb); if (OPAL_UNLIKELY(0 == pData->size) || (0 == count)) { return 0; } diff --git a/opal/datatype/opal_datatype_add.c b/opal/datatype/opal_datatype_add.c index 890f5503bb..18a90d322d 100644 --- a/opal/datatype/opal_datatype_add.c +++ b/opal/datatype/opal_datatype_add.c @@ -11,7 +11,9 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -34,19 +36,19 @@ #define UNSET_CONTIGUOUS_FLAG( INT_VALUE ) (INT_VALUE) = (INT_VALUE) & (~(OPAL_DATATYPE_FLAG_CONTIGUOUS | OPAL_DATATYPE_FLAG_NO_GAPS)) #if defined(__GNUC__) && !defined(__STDC__) -#define LMAX(A,B) ({ OPAL_PTRDIFF_TYPE _a = (A), _b = (B); (_a < _b ? _b : _a) }) -#define LMIN(A,B) ({ OPAL_PTRDIFF_TYPE _a = (A), _b = (B); (_a < _b ? _a : _b); }) +#define LMAX(A,B) ({ ptrdiff_t _a = (A), _b = (B); (_a < _b ? _b : _a) }) +#define LMIN(A,B) ({ ptrdiff_t _a = (A), _b = (B); (_a < _b ? _a : _b); }) #define IMAX(A,B) ({ int _a = (A), _b = (B); (_a < _b ? _b : _a); }) #else -static inline OPAL_PTRDIFF_TYPE LMAX( OPAL_PTRDIFF_TYPE a, OPAL_PTRDIFF_TYPE b ) { return ( a < b ? b : a ); } -static inline OPAL_PTRDIFF_TYPE LMIN( OPAL_PTRDIFF_TYPE a, OPAL_PTRDIFF_TYPE b ) { return ( a < b ? a : b ); } +static inline ptrdiff_t LMAX( ptrdiff_t a, ptrdiff_t b ) { return ( a < b ? b : a ); } +static inline ptrdiff_t LMIN( ptrdiff_t a, ptrdiff_t b ) { return ( a < b ? a : b ); } static inline int IMAX( int a, int b ) { return ( a < b ? b : a ); } #endif /* __GNU__ */ #define OPAL_DATATYPE_COMPUTE_REQUIRED_ENTRIES( _pdtAdd, _count, _extent, _place_needed) \ { \ if( (_pdtAdd)->flags & OPAL_DATATYPE_FLAG_PREDEFINED ) { /* add a basic datatype */ \ - (_place_needed) = ((_extent) == (OPAL_PTRDIFF_TYPE)(_pdtAdd)->size ? 1 : 3); \ + (_place_needed) = ((_extent) == (ptrdiff_t)(_pdtAdd)->size ? 1 : 3); \ } else { \ (_place_needed) = (_pdtAdd)->desc.used; \ if( (_count) != 1 ) { \ @@ -70,7 +72,7 @@ static inline int IMAX( int a, int b ) { return ( a < b ? b : a ); } _new_lb = (_old_lb) + (_disp); \ _new_ub = (_old_ub) + (_disp); \ } else { \ - OPAL_PTRDIFF_TYPE lower, upper; \ + ptrdiff_t lower, upper; \ upper = (_disp) + (_old_extent) * ((_count) - 1); \ lower = (_disp); \ if( lower < upper ) { \ @@ -101,12 +103,12 @@ static inline int IMAX( int a, int b ) { return ( a < b ? b : a ); } * set to ZERO if it's a empty datatype. */ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtAdd, - uint32_t count, OPAL_PTRDIFF_TYPE disp, OPAL_PTRDIFF_TYPE extent ) + uint32_t count, ptrdiff_t disp, ptrdiff_t extent ) { uint32_t newLength, place_needed = 0, i; short localFlags = 0; /* no specific options yet */ dt_elem_desc_t *pLast, *pLoop = NULL; - OPAL_PTRDIFF_TYPE lb, ub, true_lb, true_ub, epsilon, old_true_ub; + ptrdiff_t lb, ub, true_lb, true_ub, epsilon, old_true_ub; /** * From MPI-3, page 84, lines 18-20: Most datatype constructors have @@ -130,7 +132,7 @@ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtA pdtBase->lb = disp; pdtBase->flags |= OPAL_DATATYPE_FLAG_USER_LB; } - if( (pdtBase->ub - pdtBase->lb) != (OPAL_PTRDIFF_TYPE)pdtBase->size ) { + if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) { pdtBase->flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS; } return OPAL_SUCCESS; /* Just ignore the OPAL_DATATYPE_LOOP and OPAL_DATATYPE_END_LOOP */ @@ -142,7 +144,7 @@ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtA pdtBase->ub = disp; pdtBase->flags |= OPAL_DATATYPE_FLAG_USER_UB; } - if( (pdtBase->ub - pdtBase->lb) != (OPAL_PTRDIFF_TYPE)pdtBase->size ) { + if( (pdtBase->ub - pdtBase->lb) != (ptrdiff_t)pdtBase->size ) { pdtBase->flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS; } return OPAL_SUCCESS; /* Just ignore the OPAL_DATATYPE_LOOP and OPAL_DATATYPE_END_LOOP */ @@ -284,7 +286,7 @@ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtA pLast->elem.extent = extent; pdtBase->desc.used++; pLast->elem.common.flags = pdtAdd->flags & ~(OPAL_DATATYPE_FLAG_COMMITTED); - if( (extent != (OPAL_PTRDIFF_TYPE)pdtAdd->size) && (count > 1) ) { /* gaps around the datatype */ + if( (extent != (ptrdiff_t)pdtAdd->size) && (count > 1) ) { /* gaps around the datatype */ pLast->elem.common.flags &= ~(OPAL_DATATYPE_FLAG_CONTIGUOUS | OPAL_DATATYPE_FLAG_NO_GAPS); } } else { @@ -344,11 +346,11 @@ int32_t opal_datatype_add( opal_datatype_t* pdtBase, const opal_datatype_t* pdtA UNSET_CONTIGUOUS_FLAG(pdtBase->flags); if( (localFlags & OPAL_DATATYPE_FLAG_CONTIGUOUS) /* both type were contiguous */ && ((disp + pdtAdd->true_lb) == old_true_ub) /* and there is no gap between them */ - && ( ((OPAL_PTRDIFF_TYPE)pdtAdd->size == extent) /* the size and the extent of the + && ( ((ptrdiff_t)pdtAdd->size == extent) /* the size and the extent of the * added type have to match */ || (count < 2)) ) { /* if the count is bigger than 2 */ SET_CONTIGUOUS_FLAG(pdtBase->flags); - if( (OPAL_PTRDIFF_TYPE)pdtBase->size == (pdtBase->ub - pdtBase->lb) ) + if( (ptrdiff_t)pdtBase->size == (pdtBase->ub - pdtBase->lb) ) SET_NO_GAP_FLAG(pdtBase->flags); } diff --git a/opal/datatype/opal_datatype_copy.c b/opal/datatype/opal_datatype_copy.c index d1027a2d63..7bf94ef97b 100644 --- a/opal/datatype/opal_datatype_copy.c +++ b/opal/datatype/opal_datatype_copy.c @@ -12,8 +12,8 @@ * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -99,7 +99,7 @@ static size_t opal_datatype_memop_block_size = 128 * 1024; int32_t opal_datatype_copy_content_same_ddt( const opal_datatype_t* datatype, int32_t count, char* destination_base, char* source_base ) { - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; int32_t (*fct)( const opal_datatype_t*, int32_t, char*, char*); #if OPAL_CUDA_SUPPORT diff --git a/opal/datatype/opal_datatype_copy.h b/opal/datatype/opal_datatype_copy.h index 5557142b1f..d2e6a9b519 100644 --- a/opal/datatype/opal_datatype_copy.h +++ b/opal/datatype/opal_datatype_copy.h @@ -4,7 +4,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -98,7 +98,7 @@ static inline void _contiguous_loop( const dt_elem_desc_t* ELEM, size_t _copy_loops = (COUNT); uint32_t _i; - if( _loop->extent == (OPAL_PTRDIFF_TYPE)_end_loop->size ) { /* the loop is contiguous */ + if( _loop->extent == (ptrdiff_t)_end_loop->size ) { /* the loop is contiguous */ _copy_loops *= _end_loop->size; OPAL_DATATYPE_SAFEGUARD_POINTER( _source, _copy_loops, (SOURCE_BASE), (DATATYPE), (TOTAL_COUNT) ); @@ -140,13 +140,13 @@ static inline int32_t _copy_content_same_ddt( const opal_datatype_t* datatype, i * do a MEM_OP. */ if( datatype->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { - OPAL_PTRDIFF_TYPE extent = (datatype->ub - datatype->lb); + ptrdiff_t extent = (datatype->ub - datatype->lb); /* Now that we know the datatype is contiguous, we should move the 2 pointers * source and destination to the correct displacement. */ destination += datatype->true_lb; source += datatype->true_lb; - if( (OPAL_PTRDIFF_TYPE)datatype->size == extent ) { /* all contiguous == no gaps around */ + if( (ptrdiff_t)datatype->size == extent ) { /* all contiguous == no gaps around */ size_t total_length = iov_len_local; size_t memop_chunk = opal_datatype_memop_block_size; while( total_length > 0 ) { @@ -233,14 +233,14 @@ static inline int32_t _copy_content_same_ddt( const opal_datatype_t* datatype, i (int)pStack->count, stack_pos, pos_desc, (long)pStack->disp, (unsigned long)iov_len_local ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)source; + ptrdiff_t local_disp = (ptrdiff_t)source; if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { _contiguous_loop( pElem, datatype, (unsigned char*)source_base, count, count_desc, source, destination, &iov_len_local ); pos_desc += pElem->loop.items + 1; goto update_loop_description; } - local_disp = (OPAL_PTRDIFF_TYPE)source - local_disp; + local_disp = (ptrdiff_t)source - local_disp; PUSH_STACK( pStack, stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp); pos_desc++; diff --git a/opal/datatype/opal_datatype_fake_stack.c b/opal/datatype/opal_datatype_fake_stack.c index 4f72b34367..8259f3d0fa 100644 --- a/opal/datatype/opal_datatype_fake_stack.c +++ b/opal/datatype/opal_datatype_fake_stack.c @@ -11,6 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -78,7 +80,7 @@ int opal_convertor_create_stack_with_pos_general( opal_convertor_t* pConvertor, if( (pConvertor->flags & CONVERTOR_HOMOGENEOUS) && (pData->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) ) { /* Special case for contiguous datatypes */ int32_t cnt = (int32_t)(starting_point / pData->size); - OPAL_PTRDIFF_TYPE extent = pData->ub - pData->lb; + ptrdiff_t extent = pData->ub - pData->lb; loop_length = GET_FIRST_NON_LOOP( pElems ); pStack[0].disp = pElems[loop_length].elem.disp; @@ -90,7 +92,7 @@ int opal_convertor_create_stack_with_pos_general( opal_convertor_t* pConvertor, pStack[1].disp = pStack[0].disp; pStack[1].count = pData->size - cnt; - if( (OPAL_PTRDIFF_TYPE)pData->size == extent ) { /* all elements are contiguous */ + if( (ptrdiff_t)pData->size == extent ) { /* all elements are contiguous */ pStack[1].disp += starting_point; } else { /* each is contiguous but there are gaps inbetween */ pStack[1].disp += (pConvertor->count - pStack[0].count) * extent + cnt; @@ -122,7 +124,7 @@ int opal_convertor_create_stack_with_pos_general( opal_convertor_t* pConvertor, while( pos_desc < (int32_t)pConvertor->use_desc->used ) { if( OPAL_DATATYPE_END_LOOP == pElems->elem.common.type ) { /* end of the current loop */ ddt_endloop_desc_t* end_loop = (ddt_endloop_desc_t*)pElems; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; if( (loop_length * pStack->count) > resting_place ) { /* We will stop somewhere on this loop. To avoid moving inside the loop diff --git a/opal/datatype/opal_datatype_internal.h b/opal/datatype/opal_datatype_internal.h index 5fdd2c59d9..ab4d1b2bc6 100644 --- a/opal/datatype/opal_datatype_internal.h +++ b/opal/datatype/opal_datatype_internal.h @@ -13,7 +13,9 @@ * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2013 Los Alamos National Security, LLC. All rights * reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -155,8 +157,8 @@ struct ddt_elem_desc { ddt_elem_id_description common; /**< basic data description and flags */ uint32_t count; /**< number of blocks */ uint32_t blocklen; /**< number of elements on each block */ - OPAL_PTRDIFF_TYPE extent; /**< extent of each block (in bytes) */ - OPAL_PTRDIFF_TYPE disp; /**< displacement of the first block */ + ptrdiff_t extent; /**< extent of each block (in bytes) */ + ptrdiff_t disp; /**< displacement of the first block */ }; typedef struct ddt_elem_desc ddt_elem_desc_t; @@ -173,7 +175,7 @@ struct ddt_loop_desc { uint32_t loops; /**< number of elements */ uint32_t items; /**< number of items in the loop */ size_t unused; /**< not used right now */ - OPAL_PTRDIFF_TYPE extent; /**< extent of the whole loop */ + ptrdiff_t extent; /**< extent of the whole loop */ }; typedef struct ddt_loop_desc ddt_loop_desc_t; @@ -182,7 +184,7 @@ struct ddt_endloop_desc { uint32_t items; /**< number of elements */ uint32_t unused; /**< not used right now */ size_t size; /**< real size of the data in the loop */ - OPAL_PTRDIFF_TYPE first_elem_disp; /**< the displacement of the first block in the loop */ + ptrdiff_t first_elem_disp; /**< the displacement of the first block in the loop */ }; typedef struct ddt_endloop_desc ddt_endloop_desc_t; diff --git a/opal/datatype/opal_datatype_optimize.c b/opal/datatype/opal_datatype_optimize.c index 5b66e4df59..d5313a8b8e 100644 --- a/opal/datatype/opal_datatype_optimize.c +++ b/opal/datatype/opal_datatype_optimize.c @@ -12,7 +12,7 @@ * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2014 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -52,7 +52,7 @@ opal_datatype_optimize_short( opal_datatype_t* pData, int32_t pos_desc = 0; /* actual position in the description of the derived datatype */ int32_t stack_pos = 0, last_type = OPAL_DATATYPE_UINT1, last_length = 0; int32_t type = OPAL_DATATYPE_LOOP, nbElems = 0, continuity; - OPAL_PTRDIFF_TYPE total_disp = 0, last_extent = 1, last_disp = 0; + ptrdiff_t total_disp = 0, last_extent = 1, last_disp = 0; uint16_t last_flags = 0xFFFF; /* keep all for the first datatype */ uint32_t i; @@ -96,13 +96,13 @@ opal_datatype_optimize_short( opal_datatype_t* pData, ddt_loop_desc_t* loop = (ddt_loop_desc_t*)&(pData->desc.desc[pos_desc]); ddt_endloop_desc_t* end_loop = (ddt_endloop_desc_t*)&(pData->desc.desc[pos_desc + loop->items]); int index = GET_FIRST_NON_LOOP( &(pData->desc.desc[pos_desc]) ); - OPAL_PTRDIFF_TYPE loop_disp = pData->desc.desc[pos_desc + index].elem.disp; + ptrdiff_t loop_disp = pData->desc.desc[pos_desc + index].elem.disp; - continuity = ((last_disp + last_length * (OPAL_PTRDIFF_TYPE)opal_datatype_basicDatatypes[last_type]->size) + continuity = ((last_disp + last_length * (ptrdiff_t)opal_datatype_basicDatatypes[last_type]->size) == (total_disp + loop_disp)); if( loop->common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { /* the loop is contiguous or composed by contiguous elements with a gap */ - if( loop->extent == (OPAL_PTRDIFF_TYPE)end_loop->size ) { + if( loop->extent == (ptrdiff_t)end_loop->size ) { /* the whole loop is contiguous */ if( !continuity ) { if( 0 != last_length ) { @@ -119,7 +119,7 @@ opal_datatype_optimize_short( opal_datatype_t* pData, last_extent = 1; } else { int counter = loop->loops; - OPAL_PTRDIFF_TYPE merged_disp = 0; + ptrdiff_t merged_disp = 0; /* if the previous data is contiguous with this piece and it has a length not ZERO */ if( last_length != 0 ) { if( continuity ) { @@ -175,14 +175,14 @@ opal_datatype_optimize_short( opal_datatype_t* pData, } if( 2 == loop->items ) { /* small loop */ if( (1 == elem->count) - && (elem->extent == (OPAL_PTRDIFF_TYPE)opal_datatype_basicDatatypes[elem->common.type]->size) ) { + && (elem->extent == (ptrdiff_t)opal_datatype_basicDatatypes[elem->common.type]->size) ) { CREATE_ELEM( pElemDesc, elem->common.type, elem->common.flags & ~OPAL_DATATYPE_FLAG_CONTIGUOUS, loop->loops, elem->disp, loop->extent ); pElemDesc++; nbElems++; pos_desc += loop->items + 1; goto complete_loop; } else if( loop->loops < 3 ) { - OPAL_PTRDIFF_TYPE elem_displ = elem->disp; + ptrdiff_t elem_displ = elem->disp; for( i = 0; i < loop->loops; i++ ) { CREATE_ELEM( pElemDesc, elem->common.type, elem->common.flags, elem->count, elem_displ, elem->extent ); @@ -206,7 +206,7 @@ opal_datatype_optimize_short( opal_datatype_t* pData, while( pData->desc.desc[pos_desc].elem.common.flags & OPAL_DATATYPE_FLAG_DATA ) { /* keep doing it until we reach a non datatype element */ /* now here we have a basic datatype */ type = pData->desc.desc[pos_desc].elem.common.type; - continuity = ((last_disp + last_length * (OPAL_PTRDIFF_TYPE)opal_datatype_basicDatatypes[last_type]->size) + continuity = ((last_disp + last_length * (ptrdiff_t)opal_datatype_basicDatatypes[last_type]->size) == (total_disp + pData->desc.desc[pos_desc].elem.disp)); if( (pData->desc.desc[pos_desc].elem.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) && continuity && @@ -254,7 +254,7 @@ opal_datatype_optimize_short( opal_datatype_t* pData, int32_t opal_datatype_commit( opal_datatype_t * pData ) { ddt_endloop_desc_t* pLast = &(pData->desc.desc[pData->desc.used].end_loop); - OPAL_PTRDIFF_TYPE first_elem_disp = 0; + ptrdiff_t first_elem_disp = 0; if( pData->flags & OPAL_DATATYPE_FLAG_COMMITTED ) return OPAL_SUCCESS; pData->flags |= OPAL_DATATYPE_FLAG_COMMITTED; diff --git a/opal/datatype/opal_datatype_pack.c b/opal/datatype/opal_datatype_pack.c index 08ae1ecf7a..9af53f4dd5 100644 --- a/opal/datatype/opal_datatype_pack.c +++ b/opal/datatype/opal_datatype_pack.c @@ -11,7 +11,9 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -66,7 +68,7 @@ opal_pack_homogeneous_contig_function( opal_convertor_t* pConv, unsigned char *source_base = NULL; uint32_t iov_count; size_t length = pConv->local_size - pConv->bConverted, initial_amount = pConv->bConverted; - OPAL_PTRDIFF_TYPE initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; + ptrdiff_t initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; source_base = (pConv->pBaseBuf + initial_displ + pStack[0].disp + pStack[1].disp); @@ -114,10 +116,10 @@ opal_pack_homogeneous_contig_with_gaps_function( opal_convertor_t* pConv, unsigned char *user_memory, *packed_buffer; uint32_t i, index, iov_count; size_t bConverted, remaining, length, initial_bytes_converted = pConv->bConverted; - OPAL_PTRDIFF_TYPE extent= pData->ub - pData->lb; - OPAL_PTRDIFF_TYPE initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; + ptrdiff_t extent= pData->ub - pData->lb; + ptrdiff_t initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; - assert( (pData->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) && ((OPAL_PTRDIFF_TYPE)pData->size != extent) ); + assert( (pData->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) && ((ptrdiff_t)pData->size != extent) ); DO_DEBUG( opal_output( 0, "pack_homogeneous_contig( pBaseBuf %p, iov_count %d )\n", (void*)pConv->pBaseBuf, *out_size ); ); if( stack[1].type != opal_datatype_uint1.id ) { @@ -354,7 +356,7 @@ opal_generic_simple_pack_function( opal_convertor_t* pConvertor, count_desc, (long)pStack->disp, (unsigned long)iov_len_local ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr; + ptrdiff_t local_disp = (ptrdiff_t)conv_ptr; if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, conv_ptr, iov_ptr, iov_len_local ); @@ -364,7 +366,7 @@ opal_generic_simple_pack_function( opal_convertor_t* pConvertor, } /* Save the stack with the correct last_count value. */ } - local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr - local_disp; + local_disp = (ptrdiff_t)conv_ptr - local_disp; PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp); pos_desc++; @@ -417,7 +419,7 @@ pack_predefined_heterogeneous( opal_convertor_t* CONVERTOR, const opal_convertor_master_t* master = (CONVERTOR)->master; const ddt_elem_desc_t* _elem = &((ELEM)->elem); unsigned char* _source = (*SOURCE) + _elem->disp; - OPAL_PTRDIFF_TYPE advance; + ptrdiff_t advance; uint32_t _count = *(COUNT); size_t _r_blength; @@ -430,8 +432,8 @@ pack_predefined_heterogeneous( opal_convertor_t* CONVERTOR, OPAL_DATATYPE_SAFEGUARD_POINTER( _source, (_count * _elem->extent), (CONVERTOR)->pBaseBuf, (CONVERTOR)->pDesc, (CONVERTOR)->count ); DO_DEBUG( opal_output( 0, "pack [l %s r %s] memcpy( %p, %p, %lu ) => space %lu\n", - ((OPAL_PTRDIFF_TYPE)(opal_datatype_basicDatatypes[_elem->common.type]->size) == _elem->extent) ? "cont" : "----", - ((OPAL_PTRDIFF_TYPE)_r_blength == _elem->extent) ? "cont" : "----", + ((ptrdiff_t)(opal_datatype_basicDatatypes[_elem->common.type]->size) == _elem->extent) ? "cont" : "----", + ((ptrdiff_t)_r_blength == _elem->extent) ? "cont" : "----", (void*)*(DESTINATION), (void*)_source, (unsigned long)_r_blength, (unsigned long)(*(SPACE)) ); ); master->pFunctions[_elem->common.type]( CONVERTOR, _count, @@ -542,7 +544,7 @@ opal_pack_general_function( opal_convertor_t* pConvertor, count_desc, (long)pStack->disp, (unsigned long)iov_len_local ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr; + ptrdiff_t local_disp = (ptrdiff_t)conv_ptr; #if 0 if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { PACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, @@ -554,7 +556,7 @@ opal_pack_general_function( opal_convertor_t* pConvertor, /* Save the stack with the correct last_count value. */ } #endif /* in a heterogeneous environment we can't handle the contiguous loops */ - local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr - local_disp; + local_disp = (ptrdiff_t)conv_ptr - local_disp; PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp); pos_desc++; diff --git a/opal/datatype/opal_datatype_pack.h b/opal/datatype/opal_datatype_pack.h index 541a4fbe24..2176e53e89 100644 --- a/opal/datatype/opal_datatype_pack.h +++ b/opal/datatype/opal_datatype_pack.h @@ -5,6 +5,8 @@ * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -44,7 +46,7 @@ static inline void pack_predefined_data( opal_convertor_t* CONVERTOR, if( 0 == _copy_count ) return; /* nothing to do */ } - if( (OPAL_PTRDIFF_TYPE)_copy_blength == _elem->extent ) { + if( (ptrdiff_t)_copy_blength == _elem->extent ) { _copy_blength *= _copy_count; /* the extent and the size of the basic datatype are equal */ OPAL_DATATYPE_SAFEGUARD_POINTER( _source, _copy_blength, (CONVERTOR)->pBaseBuf, diff --git a/opal/datatype/opal_datatype_position.c b/opal/datatype/opal_datatype_position.c index c710a4ae3e..a4a088ffbd 100644 --- a/opal/datatype/opal_datatype_position.c +++ b/opal/datatype/opal_datatype_position.c @@ -11,8 +11,8 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2014-2015 Research Organization for Information Science + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2014-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -121,7 +121,7 @@ int opal_convertor_generic_simple_position( opal_convertor_t* pConvertor, dt_elem_desc_t* pElem; /* current position */ unsigned char *base_pointer = pConvertor->pBaseBuf; size_t iov_len_local; - OPAL_PTRDIFF_TYPE extent = pConvertor->pDesc->ub - pConvertor->pDesc->lb; + ptrdiff_t extent = pConvertor->pDesc->ub - pConvertor->pDesc->lb; DUMP( "opal_convertor_generic_simple_position( %p, &%ld )\n", (void*)pConvertor, (long)*position ); assert(*position > pConvertor->bConverted); @@ -207,7 +207,7 @@ int opal_convertor_generic_simple_position( opal_convertor_t* pConvertor, (unsigned long long)pStack->disp, (unsigned long)iov_len_local ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)base_pointer; + ptrdiff_t local_disp = (ptrdiff_t)base_pointer; if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { POSITION_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, base_pointer, iov_len_local ); @@ -217,7 +217,7 @@ int opal_convertor_generic_simple_position( opal_convertor_t* pConvertor, } /* Save the stack with the correct last_count value. */ } - local_disp = (OPAL_PTRDIFF_TYPE)base_pointer - local_disp; + local_disp = (ptrdiff_t)base_pointer - local_disp; PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp ); pos_desc++; diff --git a/opal/datatype/opal_datatype_resize.c b/opal/datatype/opal_datatype_resize.c index b239c675b0..62147645fc 100644 --- a/opal/datatype/opal_datatype_resize.c +++ b/opal/datatype/opal_datatype_resize.c @@ -4,7 +4,7 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -18,13 +18,13 @@ #include "opal/datatype/opal_datatype.h" #include "opal/datatype/opal_datatype_internal.h" -int32_t opal_datatype_resize( opal_datatype_t* type, OPAL_PTRDIFF_TYPE lb, OPAL_PTRDIFF_TYPE extent ) +int32_t opal_datatype_resize( opal_datatype_t* type, ptrdiff_t lb, ptrdiff_t extent ) { type->lb = lb; type->ub = lb + extent; type->flags &= ~OPAL_DATATYPE_FLAG_NO_GAPS; - if( (extent == (OPAL_PTRDIFF_TYPE)type->size) && + if( (extent == (ptrdiff_t)type->size) && (type->flags & OPAL_DATATYPE_FLAG_CONTIGUOUS) ) { type->flags |= OPAL_DATATYPE_FLAG_NO_GAPS; } diff --git a/opal/datatype/opal_datatype_unpack.c b/opal/datatype/opal_datatype_unpack.c index 195bca48f1..093610b897 100644 --- a/opal/datatype/opal_datatype_unpack.c +++ b/opal/datatype/opal_datatype_unpack.c @@ -12,7 +12,9 @@ * All rights reserved. * Copyright (c) 2008-2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. - * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2013 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -71,8 +73,8 @@ opal_unpack_homogeneous_contig_function( opal_convertor_t* pConv, uint32_t iov_count, i; size_t bConverted, remaining, length, initial_bytes_converted = pConv->bConverted; dt_stack_t* stack = pConv->pStack; - OPAL_PTRDIFF_TYPE extent = pData->ub - pData->lb; - OPAL_PTRDIFF_TYPE initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; + ptrdiff_t extent = pData->ub - pData->lb; + ptrdiff_t initial_displ = pConv->use_desc->desc[pConv->use_desc->used].end_loop.first_elem_disp; DO_DEBUG( opal_output( 0, "unpack_homogeneous_contig( pBaseBuf %p, iov_count %d )\n", (void*)pConv->pBaseBuf, *out_size ); ); @@ -89,7 +91,7 @@ opal_unpack_homogeneous_contig_function( opal_convertor_t* pConv, bConverted = remaining; /* how much will get unpacked this time */ user_memory = pConv->pBaseBuf + initial_displ; - if( (OPAL_PTRDIFF_TYPE)pData->size == extent ) { + if( (ptrdiff_t)pData->size == extent ) { user_memory += pConv->bConverted; DO_DEBUG( opal_output( 0, "unpack_homogeneous_contig( user_memory %p, packed_buffer %p length %lu\n", (void*)user_memory, (void*)packed_buffer, (unsigned long)remaining ); ); @@ -177,7 +179,7 @@ opal_unpack_homogeneous_contig_function( opal_convertor_t* pConv, static inline uint32_t opal_unpack_partial_datatype( opal_convertor_t* pConvertor, dt_elem_desc_t* pElem, unsigned char* partial_data, - OPAL_PTRDIFF_TYPE start_position, OPAL_PTRDIFF_TYPE length, + ptrdiff_t start_position, ptrdiff_t length, unsigned char** user_buffer ) { char unused_byte = 0x7F, saved_data[16]; @@ -377,7 +379,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor, (long)pStack->disp, (unsigned long)iov_len_local ); ); } if( OPAL_DATATYPE_LOOP == pElem->elem.common.type ) { - OPAL_PTRDIFF_TYPE local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr; + ptrdiff_t local_disp = (ptrdiff_t)conv_ptr; if( pElem->loop.common.flags & OPAL_DATATYPE_FLAG_CONTIGUOUS ) { UNPACK_CONTIGUOUS_LOOP( pConvertor, pElem, count_desc, iov_ptr, conv_ptr, iov_len_local ); @@ -387,7 +389,7 @@ opal_generic_simple_unpack_function( opal_convertor_t* pConvertor, } /* Save the stack with the correct last_count value. */ } - local_disp = (OPAL_PTRDIFF_TYPE)conv_ptr - local_disp; + local_disp = (ptrdiff_t)conv_ptr - local_disp; PUSH_STACK( pStack, pConvertor->stack_pos, pos_desc, OPAL_DATATYPE_LOOP, count_desc, pStack->disp + local_disp); pos_desc++; @@ -448,7 +450,7 @@ opal_unpack_general_function( opal_convertor_t* pConvertor, uint32_t iov_count; const opal_convertor_master_t* master = pConvertor->master; - OPAL_PTRDIFF_TYPE advance; /* number of bytes that we should advance the buffer */ + ptrdiff_t advance; /* number of bytes that we should advance the buffer */ int32_t rc; DO_DEBUG( opal_output( 0, "opal_convertor_general_unpack( %p, {%p, %lu}, %u )\n", diff --git a/opal/datatype/opal_datatype_unpack.h b/opal/datatype/opal_datatype_unpack.h index bbc8d30e39..44f7505a58 100644 --- a/opal/datatype/opal_datatype_unpack.h +++ b/opal/datatype/opal_datatype_unpack.h @@ -5,6 +5,8 @@ * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -43,7 +45,7 @@ unpack_predefined_data( opal_convertor_t* CONVERTOR, /* the convertor */ if( 0 == _copy_count ) return; /* nothing to do */ } - if( (OPAL_PTRDIFF_TYPE)_copy_blength == _elem->extent ) { + if( (ptrdiff_t)_copy_blength == _elem->extent ) { _copy_blength *= _copy_count; /* the extent and the size of the basic datatype are equal */ OPAL_DATATYPE_SAFEGUARD_POINTER( _destination, _copy_blength, (CONVERTOR)->pBaseBuf, diff --git a/test/datatype/ddt_pack.c b/test/datatype/ddt_pack.c index 3439e16c40..1164e6feca 100644 --- a/test/datatype/ddt_pack.c +++ b/test/datatype/ddt_pack.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2006 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006 Sun Microsystems Inc. All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -30,7 +30,7 @@ #include -static int get_extents(ompi_datatype_t * type, OPAL_PTRDIFF_TYPE *lb, OPAL_PTRDIFF_TYPE *extent, OPAL_PTRDIFF_TYPE *true_lb, OPAL_PTRDIFF_TYPE *true_extent) { +static int get_extents(ompi_datatype_t * type, ptrdiff_t *lb, ptrdiff_t *extent, ptrdiff_t *true_lb, ptrdiff_t *true_extent) { int ret; ret = ompi_datatype_get_extent(type, lb, extent); @@ -50,10 +50,10 @@ main(int argc, char* argv[]) struct ompi_datatype_t *unpacked_dt; int ret = 0; int blen[4]; - OPAL_PTRDIFF_TYPE disp[4]; + ptrdiff_t disp[4]; ompi_datatype_t *newType, *types[4], *struct_type, *vec_type; - OPAL_PTRDIFF_TYPE old_lb, old_extent, old_true_lb, old_true_extent; - OPAL_PTRDIFF_TYPE lb, extent, true_lb, true_extent; + ptrdiff_t old_lb, old_extent, old_true_lb, old_true_extent; + ptrdiff_t lb, extent, true_lb, true_extent; /* make ompi_proc_local () work ... */ struct ompi_proc_t dummy_proc; diff --git a/test/datatype/opal_datatype_test.c b/test/datatype/opal_datatype_test.c index fcb8164faf..0dcb508f0d 100644 --- a/test/datatype/opal_datatype_test.c +++ b/test/datatype/opal_datatype_test.c @@ -12,6 +12,8 @@ * All rights reserved. * Copyright (c) 2006 Sun Microsystems Inc. All rights reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -49,7 +51,7 @@ uint32_t remote_arch = 0xffffffff; */ static size_t compute_memory_size( opal_datatype_t const * const pdt, int count ) { - OPAL_PTRDIFF_TYPE extent, true_lb, true_extent; + ptrdiff_t extent, true_lb, true_extent; opal_datatype_type_extent( pdt, &extent ); opal_datatype_get_true_extent( pdt, &true_lb, &true_extent ); @@ -140,7 +142,7 @@ static int test_upper( unsigned int length ) */ static int local_copy_ddt_count( opal_datatype_t const * const pdt, int count ) { - OPAL_PTRDIFF_TYPE lb, extent; + ptrdiff_t lb, extent; size_t malloced_size; char *odst, *osrc; void *pdst, *psrc; @@ -202,7 +204,7 @@ local_copy_with_convertor_2datatypes( opal_datatype_t const * const send_type, i opal_datatype_t const * const recv_type, int recv_count, int chunk ) { - OPAL_PTRDIFF_TYPE send_lb, send_extent, recv_lb, recv_extent; + ptrdiff_t send_lb, send_extent, recv_lb, recv_extent; void *pdst = NULL, *psrc = NULL, *ptemp = NULL; char *odst, *osrc; opal_convertor_t *send_convertor = NULL, *recv_convertor = NULL; @@ -306,7 +308,7 @@ local_copy_with_convertor_2datatypes( opal_datatype_t const * const send_type, i static int local_copy_with_convertor( opal_datatype_t const * const pdt, int count, int chunk ) { - OPAL_PTRDIFF_TYPE lb, extent; + ptrdiff_t lb, extent; void *pdst = NULL, *psrc = NULL, *ptemp = NULL; char *odst, *osrc; opal_convertor_t *send_convertor = NULL, *recv_convertor = NULL; diff --git a/test/datatype/opal_ddt_lib.c b/test/datatype/opal_ddt_lib.c index 5fabd90a2b..f7368960d3 100644 --- a/test/datatype/opal_ddt_lib.c +++ b/test/datatype/opal_ddt_lib.c @@ -4,6 +4,8 @@ * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2009 Oak Ridge National Labs. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,14 +29,14 @@ uint32_t outputFlags = VALIDATE_DATA | CHECK_PACK_UNPACK | RESET_CONVERTORS | QU static int32_t opal_datatype_create_indexed( int count, const int* pBlockLength, const int* pDisp, const opal_datatype_t* oldType, opal_datatype_t** newType ); -static int32_t opal_datatype_create_hindexed( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +static int32_t opal_datatype_create_hindexed( int count, const int* pBlockLength, const ptrdiff_t* pDisp, const opal_datatype_t* oldType, opal_datatype_t** newType ); static int32_t opal_datatype_create_struct( int count, const int* pBlockLength, - const OPAL_PTRDIFF_TYPE* pDisp, + const ptrdiff_t* pDisp, opal_datatype_t** pTypes, opal_datatype_t** newType ); static int32_t opal_datatype_create_vector( int count, int bLength, int stride, const opal_datatype_t* oldType, opal_datatype_t** newType ); -static int32_t opal_datatype_create_hvector( int count, int bLength, OPAL_PTRDIFF_TYPE stride, +static int32_t opal_datatype_create_hvector( int count, int bLength, ptrdiff_t stride, const opal_datatype_t* oldType, opal_datatype_t** newType ); @@ -136,7 +138,7 @@ opal_datatype_t* test_struct( void ) NULL, (opal_datatype_t*)&opal_datatype_int1 }; int lengths[] = { 2, 1, 3 }; - OPAL_PTRDIFF_TYPE disp[] = { 0, 16, 26 }; + ptrdiff_t disp[] = { 0, 16, 26 }; opal_datatype_t* pdt, *pdt1; printf( "test struct\n" ); @@ -166,7 +168,7 @@ opal_datatype_t* test_struct_char_double( void ) { char_double_t data; int lengths[] = {1, 1}; - OPAL_PTRDIFF_TYPE displ[] = {0, 0}; + ptrdiff_t displ[] = {0, 0}; opal_datatype_t *pdt; opal_datatype_t* types[] = { (opal_datatype_t*)&opal_datatype_int1, (opal_datatype_t*)&opal_datatype_float8}; @@ -200,7 +202,7 @@ typedef struct { opal_datatype_t* create_strange_dt( void ) { sdata_intern v[2]; - OPAL_PTRDIFF_TYPE displ[3]; + ptrdiff_t displ[3]; opal_datatype_t *pdt, *pdt1; opal_datatype_create_contiguous(0, &opal_datatype_empty, &pdt1); @@ -280,7 +282,7 @@ static int32_t opal_datatype_create_indexed( int count, const int* pBlockLength, { opal_datatype_t* pdt; int i, dLength, endat, disp; - OPAL_PTRDIFF_TYPE extent; + ptrdiff_t extent; if( 0 == count ) { *newType = opal_datatype_create( 0 ); @@ -317,12 +319,12 @@ static int32_t opal_datatype_create_indexed( int count, const int* pBlockLength, return OPAL_SUCCESS; } -static int32_t opal_datatype_create_hindexed( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +static int32_t opal_datatype_create_hindexed( int count, const int* pBlockLength, const ptrdiff_t* pDisp, const opal_datatype_t* oldType, opal_datatype_t** newType ) { opal_datatype_t* pdt; int i, dLength; - OPAL_PTRDIFF_TYPE extent, disp, endat; + ptrdiff_t extent, disp, endat; if( 0 == count ) { *newType = opal_datatype_create( 0 ); @@ -360,11 +362,11 @@ static int32_t opal_datatype_create_hindexed( int count, const int* pBlockLength } -static int32_t opal_datatype_create_struct( int count, const int* pBlockLength, const OPAL_PTRDIFF_TYPE* pDisp, +static int32_t opal_datatype_create_struct( int count, const int* pBlockLength, const ptrdiff_t* pDisp, opal_datatype_t** pTypes, opal_datatype_t** newType ) { int i; - OPAL_PTRDIFF_TYPE disp = 0, endto, lastExtent, lastDisp; + ptrdiff_t disp = 0, endto, lastExtent, lastDisp; int lastBlock; opal_datatype_t *pdt, *lastType; @@ -433,7 +435,7 @@ static int32_t opal_datatype_create_vector( int count, int bLength, int stride, const opal_datatype_t* oldType, opal_datatype_t** newType ) { opal_datatype_t *pTempData, *pData; - OPAL_PTRDIFF_TYPE extent = oldType->ub - oldType->lb; + ptrdiff_t extent = oldType->ub - oldType->lb; if( 0 == count ) { @@ -461,11 +463,11 @@ static int32_t opal_datatype_create_vector( int count, int bLength, int stride, } -static int32_t opal_datatype_create_hvector( int count, int bLength, OPAL_PTRDIFF_TYPE stride, +static int32_t opal_datatype_create_hvector( int count, int bLength, ptrdiff_t stride, const opal_datatype_t* oldType, opal_datatype_t** newType ) { opal_datatype_t *pTempData, *pData; - OPAL_PTRDIFF_TYPE extent = oldType->ub - oldType->lb; + ptrdiff_t extent = oldType->ub - oldType->lb; if( 0 == count ) { *newType = opal_datatype_create( 0 ); @@ -637,8 +639,8 @@ opal_datatype_t* test_contiguous( void ) int mpich_typeub( void ) { int errs = 0; - OPAL_PTRDIFF_TYPE extent, lb, extent1, extent2, extent3; - OPAL_PTRDIFF_TYPE displ[2]; + ptrdiff_t extent, lb, extent1, extent2, extent3; + ptrdiff_t displ[2]; int blens[2]; opal_datatype_t *type1, *type2, *type3, *types[2]; @@ -700,7 +702,7 @@ int mpich_typeub2( void ) { int blocklen[3], err = 0; size_t sz1, sz2, sz3; - OPAL_PTRDIFF_TYPE disp[3], lb, ub, ex1, ex2, ex3; + ptrdiff_t disp[3], lb, ub, ex1, ex2, ex3; opal_datatype_t *types[3], *dt1, *dt2, *dt3; blocklen[0] = 1; @@ -779,7 +781,7 @@ int mpich_typeub3( void ) { int blocklen[3], err = 0, idisp[3]; size_t sz; - OPAL_PTRDIFF_TYPE disp[3], lb, ub, ex; + ptrdiff_t disp[3], lb, ub, ex; opal_datatype_t *types[3], *dt1, *dt2, *dt3, *dt4, *dt5; /* Create a datatype with explicit LB and UB */