diff --git a/test/datatype/ddt_lib.c b/test/datatype/ddt_lib.c index c34938473e..647ee2c7f2 100644 --- a/test/datatype/ddt_lib.c +++ b/test/datatype/ddt_lib.c @@ -56,7 +56,7 @@ void cache_trash( void ) /** * Data-type functions. */ -ompi_datatype_t* create_inversed_vector( ompi_datatype_t* type, int length ) +ompi_datatype_t* create_inversed_vector( const ompi_datatype_t const* type, int length ) { ompi_datatype_t* type1; @@ -517,7 +517,7 @@ ompi_datatype_t* test_create_blacs_type( void ) return pdt; } -ompi_datatype_t* test_create_blacs_type1( ompi_datatype_t* base_type ) +ompi_datatype_t* test_create_blacs_type1( const ompi_datatype_t const * base_type ) { ompi_datatype_t *pdt; @@ -529,7 +529,7 @@ ompi_datatype_t* test_create_blacs_type1( ompi_datatype_t* base_type ) return pdt; } -ompi_datatype_t* test_create_blacs_type2( ompi_datatype_t* base_type ) +ompi_datatype_t* test_create_blacs_type2( const ompi_datatype_t const* base_type ) { ompi_datatype_t *pdt; diff --git a/test/datatype/ddt_lib.h b/test/datatype/ddt_lib.h index b7c698218f..711954b99a 100644 --- a/test/datatype/ddt_lib.h +++ b/test/datatype/ddt_lib.h @@ -44,7 +44,7 @@ extern void cache_trash( void ); /** * Data-type functions. */ -ompi_datatype_t* create_inversed_vector( ompi_datatype_t* type, int length ); +ompi_datatype_t* create_inversed_vector( const ompi_datatype_t const* type, int length ); extern int mpich_typeub( void ); extern int mpich_typeub2( void ); @@ -84,11 +84,11 @@ extern ompi_datatype_t* test_create_twice_two_doubles( void ); --C-----D*-[ C ][INT] MPI_INT count 1 disp 0xa80 (2688) extent 4 */ extern ompi_datatype_t* test_create_blacs_type( void ); -extern ompi_datatype_t* test_create_blacs_type1( ompi_datatype_t* base_type ); -extern ompi_datatype_t* test_create_blacs_type2( ompi_datatype_t* base_type ); +extern ompi_datatype_t* test_create_blacs_type1( const ompi_datatype_t const* base_type ); +extern ompi_datatype_t* test_create_blacs_type2( const ompi_datatype_t const* base_type ); extern ompi_datatype_t* test_struct( void ); extern ompi_datatype_t* create_strange_dt( void ); -extern ompi_datatype_t* create_contiguous_type( const ompi_datatype_t* data, int count ); -extern ompi_datatype_t* create_vector_type( const ompi_datatype_t* data, int count, +extern ompi_datatype_t* create_contiguous_type( const ompi_datatype_t const* data, int count ); +extern ompi_datatype_t* create_vector_type( const ompi_datatype_t const* data, int count, int length, int stride ); diff --git a/test/datatype/opal_datatype_test.c b/test/datatype/opal_datatype_test.c index 6f852608f3..93a5c139ce 100644 --- a/test/datatype/opal_datatype_test.c +++ b/test/datatype/opal_datatype_test.c @@ -123,7 +123,7 @@ static int test_upper( unsigned int length ) * - and one using 2 convertors created from different data-types. * */ -static int local_copy_ddt_count( opal_datatype_t* pdt, int count ) +static int local_copy_ddt_count( const opal_datatype_t const* pdt, int count ) { OPAL_PTRDIFF_TYPE extent; void *pdst, *psrc; @@ -159,8 +159,8 @@ static int local_copy_ddt_count( opal_datatype_t* pdt, int count ) } static int -local_copy_with_convertor_2datatypes( opal_datatype_t* send_type, int send_count, - opal_datatype_t* recv_type, int recv_count, +local_copy_with_convertor_2datatypes( const opal_datatype_t const * send_type, int send_count, + const opal_datatype_t const * recv_type, int recv_count, int chunk ) { OPAL_PTRDIFF_TYPE send_extent, recv_extent; @@ -247,7 +247,7 @@ local_copy_with_convertor_2datatypes( opal_datatype_t* send_type, int send_count } -static int local_copy_with_convertor( opal_datatype_t* pdt, int count, int chunk ) +static int local_copy_with_convertor( const opal_datatype_t const* pdt, int count, int chunk ) { OPAL_PTRDIFF_TYPE extent; void *pdst = NULL, *psrc = NULL, *ptemp = NULL; @@ -428,11 +428,11 @@ int main( int argc, char* argv[] ) printf( ">>--------------------------------------------<<\n" ); printf( " Contiguous data-type (opal_datatype_float8)\n" ); - pdt = &opal_datatype_float8; if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_ddt_count(pdt, 4500); - local_copy_with_convertor( pdt, 4500, 12 ); - local_copy_with_convertor_2datatypes( pdt, 4500, pdt, 4500, 12 ); + const opal_datatype_t const* ddt = &opal_datatype_float8; + local_copy_ddt_count( ddt, 4500); + local_copy_with_convertor( ddt, 4500, 12 ); + local_copy_with_convertor_2datatypes( ddt, 4500, ddt, 4500, 12 ); } printf( ">>--------------------------------------------<<\n" ); diff --git a/test/datatype/opal_ddt_lib.c b/test/datatype/opal_ddt_lib.c index d472417862..3f1506d2ef 100644 --- a/test/datatype/opal_ddt_lib.c +++ b/test/datatype/opal_ddt_lib.c @@ -108,7 +108,7 @@ opal_datatype_t* test_create_blacs_type( void ) return pdt; } -opal_datatype_t* test_create_blacs_type1( opal_datatype_t* base_type ) +opal_datatype_t* test_create_blacs_type1( const opal_datatype_t const* base_type ) { opal_datatype_t *pdt; @@ -120,7 +120,7 @@ opal_datatype_t* test_create_blacs_type1( opal_datatype_t* base_type ) return pdt; } -opal_datatype_t* test_create_blacs_type2( opal_datatype_t* base_type ) +opal_datatype_t* test_create_blacs_type2( const opal_datatype_t const* base_type ) { opal_datatype_t *pdt; diff --git a/test/datatype/opal_ddt_lib.h b/test/datatype/opal_ddt_lib.h index 86b0b62707..10eb3a0c71 100644 --- a/test/datatype/opal_ddt_lib.h +++ b/test/datatype/opal_ddt_lib.h @@ -29,8 +29,8 @@ extern uint32_t outputFlags; extern void cache_trash( void ); -extern opal_datatype_t* create_contiguous_type( const opal_datatype_t* type, int length ); -extern opal_datatype_t* create_vector_type( const opal_datatype_t* data, int count, int length, int stride ); +extern opal_datatype_t* create_contiguous_type( const opal_datatype_t const* type, int length ); +extern opal_datatype_t* create_vector_type( const opal_datatype_t const* data, int count, int length, int stride ); extern opal_datatype_t* create_strange_dt( void ); extern opal_datatype_t* upper_matrix( unsigned int mat_size ); extern opal_datatype_t* lower_matrix( unsigned int mat_size ); @@ -42,11 +42,11 @@ extern opal_datatype_t* test_struct_char_double( void ); extern opal_datatype_t* test_create_twice_two_doubles( void ); extern opal_datatype_t* test_struct( void ); extern opal_datatype_t* test_create_blacs_type( void ); -extern opal_datatype_t* test_create_blacs_type1( opal_datatype_t* base_type ); -extern opal_datatype_t* test_create_blacs_type2( opal_datatype_t* base_type ); +extern opal_datatype_t* test_create_blacs_type1( const opal_datatype_t const* base_type ); +extern opal_datatype_t* test_create_blacs_type2( const opal_datatype_t const* base_type ); extern int mpich_typeub( void ); extern int mpich_typeub2( void ); extern int mpich_typeub3( void ); -#endif /* TEST_OPAL_DDT_LIB_H */ \ No newline at end of file +#endif /* TEST_OPAL_DDT_LIB_H */ diff --git a/test/datatype/to_self.c b/test/datatype/to_self.c index 58b1ee364b..3cff9293b0 100644 --- a/test/datatype/to_self.c +++ b/test/datatype/to_self.c @@ -45,7 +45,7 @@ create_indexed_constant_gap_ddt( int number, /* number of repetitions */ bLength[i] = contig_size; displ[i] = displ[i-1] + sizeof(double) * (contig_size + gap_size); } - MPI_Type_struct( number, bLength, displ, types, &dt ); + MPI_Type_create_struct( number, bLength, displ, types, &dt ); MPI_DDT_DUMP( dt ); free(types); free(bLength); @@ -86,23 +86,23 @@ create_indexed_gap_ddt( void ) MPI_Datatype types[2] = { MPI_INT, MPI_FLOAT }; MPI_Aint displ[2]; - MPI_Address( &(dt[0].is[0].i[0]), &(displ[0]) ); - MPI_Address( &(dt[0].is[0].f), &(displ[1]) ); + MPI_Get_address( &(dt[0].is[0].i[0]), &(displ[0]) ); + MPI_Get_address( &(dt[0].is[0].f), &(displ[1]) ); displ[1] -= displ[0]; displ[0] -= displ[0]; - MPI_Type_struct( 2, bLength, displ, types, &dt1 ); + MPI_Type_create_struct( 2, bLength, displ, types, &dt1 ); /*MPI_DDT_DUMP( dt1 );*/ MPI_Type_contiguous( 3, dt1, &dt2 ); /*MPI_DDT_DUMP( dt2 );*/ bLength[0] = 1; bLength[1] = 1; - MPI_Address( &(dt[0].v1), &(displ[0]) ); - MPI_Address( &(dt[0].is[0]), &(displ[1]) ); + MPI_Get_address( &(dt[0].v1), &(displ[0]) ); + MPI_Get_address( &(dt[0].is[0]), &(displ[1]) ); displ[1] -= displ[0]; displ[0] -= displ[0]; types[0] = MPI_INT; types[1] = dt2; - MPI_Type_struct( 2, bLength, displ, types, &dt3 ); + MPI_Type_create_struct( 2, bLength, displ, types, &dt3 ); /*MPI_DDT_DUMP( dt3 );*/ MPI_Type_free( &dt1 ); MPI_Type_free( &dt2 ); @@ -136,7 +136,7 @@ create_indexed_gap_optimized_ddt( void ) displ[1] = 8; displ[2] = 44 * 9 + 8; - MPI_Type_struct( 3, bLength, displ, types, &dt3 ); + MPI_Type_create_struct( 3, bLength, displ, types, &dt3 ); MPI_Type_free( &dt1 ); MPI_Type_free( &dt2 ); @@ -301,10 +301,10 @@ static int irecv_isend_wait( int cycles, static int do_test_for_ddt( MPI_Datatype sddt, MPI_Datatype rddt, int length ) { int i; - MPI_Aint extent; + MPI_Aint lb, extent; char *sbuf, *rbuf; - MPI_Type_extent( sddt, &extent ); + MPI_Type_get_extent( sddt, &lb, &extent ); sbuf = (char*)malloc( length ); rbuf = (char*)malloc( length ); printf( "# Isend recv\n" );