From 9da7af4c96e90fdcadf38c18e742a19f8278ae6b Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 26 May 2006 20:53:35 +0000 Subject: [PATCH] Remove all warnings except the missing prototypes. This commit was SVN r10108. --- test/datatype/ddt_test.c | 366 +++++++++++++++++++-------------------- 1 file changed, 182 insertions(+), 184 deletions(-) diff --git a/test/datatype/ddt_test.c b/test/datatype/ddt_test.c index a4f44f651b..fd48719054 100644 --- a/test/datatype/ddt_test.c +++ b/test/datatype/ddt_test.c @@ -47,7 +47,7 @@ uint32_t remote_arch; * Cache cleanup. */ #define CACHE_SIZE (4*1024*1024) -void cache_trash( void ) +static void cache_trash( void ) { char* buffer; @@ -303,7 +303,7 @@ int mpich_typeub3( void ) void print_double_mat( unsigned int N, double* mat ) { - int i, j; + unsigned int i, j; double* pMat; for( i = 0; i < N; i++ ) { @@ -319,7 +319,7 @@ void print_double_mat( unsigned int N, double* mat ) int init_random_upper_matrix( unsigned int N, double* mat ) { - int i, j; + unsigned int i, j; srand( time(NULL) ); for( i = 0; i < N; i++ ) { @@ -334,7 +334,7 @@ int init_random_upper_matrix( unsigned int N, double* mat ) int check_diag_matrix( unsigned int N, double* mat1, double* mat2 ) { - int i, j; + unsigned int i, j; for( i = 0; i < N; i++ ) { mat1 += i; @@ -353,7 +353,8 @@ int check_diag_matrix( unsigned int N, double* mat1, double* mat2 ) ompi_datatype_t* upper_matrix( unsigned int mat_size ) { - int *disp, i, *blocklen; + int *disp, *blocklen; + unsigned int i; ompi_datatype_t* upper; disp = (int*)malloc( sizeof(int) * mat_size ); @@ -377,7 +378,8 @@ ompi_datatype_t* upper_matrix( unsigned int mat_size ) ompi_datatype_t* lower_matrix( unsigned int mat_size ) { - int *disp, i, *blocklen; + int *disp, *blocklen; + unsigned int i; ompi_datatype_t* upper; disp = (int*)malloc( sizeof(int) * mat_size ); @@ -403,8 +405,8 @@ int test_upper( unsigned int length ) ompi_datatype_t *pdt, *pdt1; ompi_convertor_t * pConv; char *ptr; - int i, j, split_chunk, total_length, rc, freeAfter; - unsigned int iov_count; + int rc, freeAfter; + unsigned int i, j, iov_count, split_chunk, total_length; size_t max_data; struct iovec a; TIMER_DATA_TYPE start, end; @@ -961,173 +963,171 @@ int main( int argc, char* argv[] ) * By default simulate homogeneous architectures. */ remote_arch = ompi_mpi_local_arch; - /* - printf( "\n\n#\n * TEST INVERSED VECTOR\n #\n\n" ); - pdt = create_inversed_vector( &ompi_mpi_int, 10 ); - if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_ddt_count(pdt, 100); - local_copy_with_convertor(pdt, 100, 956); - } - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "\n\n#\n * TEST STRANGE DATATYPE\n #\n\n" ); - pdt = create_strange_dt(); - if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_ddt_count(pdt, 1); - local_copy_with_convertor(pdt, 1, 956); - } - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - - printf( "\n\n#\n * TEST UPPER TRIANGULAR MATRIX (size 100)\n #\n\n" ); - pdt = upper_matrix(100); - if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_ddt_count(pdt, 1); - local_copy_with_convertor(pdt, 1, 48); - } - OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "\n\n#\n * TEST INVERSED VECTOR\n #\n\n" ); + pdt = create_inversed_vector( &ompi_mpi_int, 10 ); + if( outputFlags & CHECK_PACK_UNPACK ) { + local_copy_ddt_count(pdt, 100); + local_copy_with_convertor(pdt, 100, 956); + } + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "\n\n#\n * TEST STRANGE DATATYPE\n #\n\n" ); + pdt = create_strange_dt(); + if( outputFlags & CHECK_PACK_UNPACK ) { + local_copy_ddt_count(pdt, 1); + local_copy_with_convertor(pdt, 1, 956); + } + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + printf( "\n\n#\n * TEST UPPER TRIANGULAR MATRIX (size 100)\n #\n\n" ); + pdt = upper_matrix(100); + if( outputFlags & CHECK_PACK_UNPACK ) { + local_copy_ddt_count(pdt, 1); + local_copy_with_convertor(pdt, 1, 48); + } + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + mpich_typeub(); + mpich_typeub2(); + mpich_typeub3(); + + printf( "\n\n#\n * TEST UPPER MATRIX\n #\n\n" ); + rc = test_upper( length ); + if( rc == 0 ) + printf( "decode [PASSED]\n" ); + else + printf( "decode [NOT PASSED]\n" ); + + printf( "\n\n#\n * TEST MATRIX BORDERS\n #\n\n" ); + pdt = test_matrix_borders( length, 100 ); + if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { + ompi_ddt_dump( pdt ); + } + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + printf( "\n\n#\n * TEST CONTIGUOUS\n #\n\n" ); + pdt = test_contiguous(); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "\n\n#\n * TEST STRUCT\n #\n\n" ); + pdt = test_struct(); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + pdt1 = ompi_ddt_create( -1 ); + pdt2 = ompi_ddt_create( -1 ); + pdt3 = ompi_ddt_create( -1 ); + ompi_ddt_add( pdt3, ompi_ddt_basicDatatypes[DT_INT], 10, 0, -1 ); + ompi_ddt_add( pdt3, ompi_ddt_basicDatatypes[DT_FLOAT], 5, 10 * sizeof(int), -1 ); + + ompi_ddt_add( pdt2, ompi_ddt_basicDatatypes[DT_INT], 1, 0, -1 ); + ompi_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 ); + + ompi_ddt_add( pdt1, ompi_ddt_basicDatatypes[DT_LONG_LONG_INT], 5, 0, -1 ); + ompi_ddt_add( pdt1, ompi_ddt_basicDatatypes[DT_LONG_DOUBLE], 2, sizeof(long long) * 5, -1 ); + + printf( ">>--------------------------------------------<<\n" ); + if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { + ompi_ddt_dump( pdt1 ); + } + printf( ">>--------------------------------------------<<\n" ); + if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { + ompi_ddt_dump( pdt2 ); + } + printf( ">>--------------------------------------------<<\n" ); + if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { + ompi_ddt_dump( pdt3 ); + } + + OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL ); + OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL ); + OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL ); - mpich_typeub(); - mpich_typeub2(); - mpich_typeub3(); + printf( ">>--------------------------------------------<<\n" ); + printf( " Contiguous data-type (MPI_DOUBLE)\n" ); + pdt = MPI_DOUBLE; + 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 ); + } + printf( ">>--------------------------------------------<<\n" ); + + printf( ">>--------------------------------------------<<\n" ); + if( outputFlags & CHECK_PACK_UNPACK ) { + printf( "Contiguous multiple data-type (4500*1)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 4500 ); + local_copy_ddt_count(pdt, 1); + local_copy_with_convertor( pdt, 1, 12 ); + local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "Contiguous multiple data-type (450*10)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 450 ); + local_copy_ddt_count(pdt, 10); + local_copy_with_convertor( pdt, 10, 12 ); + local_copy_with_convertor_2datatypes( pdt, 10, pdt, 10, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "Contiguous multiple data-type (45*100)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 45 ); + local_copy_ddt_count(pdt, 100); + local_copy_with_convertor( pdt, 100, 12 ); + local_copy_with_convertor_2datatypes( pdt, 100, pdt, 100, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "Contiguous multiple data-type (100*45)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 100 ); + local_copy_ddt_count(pdt, 45); + local_copy_with_convertor( pdt, 45, 12 ); + local_copy_with_convertor_2datatypes( pdt, 45, pdt, 45, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "Contiguous multiple data-type (10*450)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 10 ); + local_copy_ddt_count(pdt, 450); + local_copy_with_convertor( pdt, 450, 12 ); + local_copy_with_convertor_2datatypes( pdt, 450, pdt, 450, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + printf( "Contiguous multiple data-type (1*4500)\n" ); + pdt = create_contiguous_type( MPI_DOUBLE, 1 ); + local_copy_ddt_count(pdt, 4500); + local_copy_with_convertor( pdt, 4500, 12 ); + local_copy_with_convertor_2datatypes( pdt, 4500, pdt, 4500, 12 ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + } + printf( ">>--------------------------------------------<<\n" ); + printf( ">>--------------------------------------------<<\n" ); + printf( "Vector data-type (450 times 10 double stride 11)\n" ); + pdt = create_vector_type( MPI_DOUBLE, 450, 10, 11 ); + ompi_ddt_dump( pdt ); + if( outputFlags & CHECK_PACK_UNPACK ) { + local_copy_ddt_count(pdt, 1); + local_copy_with_convertor( pdt, 1, 12 ); + local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 12 ); + local_copy_with_convertor( pdt, 1, 82 ); + local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 82 ); + local_copy_with_convertor( pdt, 1, 6000 ); + local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 6000 ); + local_copy_with_convertor( pdt, 1, 36000 ); + local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 36000 ); + } + printf( ">>--------------------------------------------<<\n" ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + printf( ">>--------------------------------------------<<\n" ); + pdt = test_struct_char_double(); + 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 ); + } + printf( ">>--------------------------------------------<<\n" ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); + + printf( ">>--------------------------------------------<<\n" ); + pdt = test_create_twice_two_doubles(); + 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 ); + } + printf( ">>--------------------------------------------<<\n" ); + OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "\n\n#\n * TEST UPPER MATRIX\n #\n\n" ); - rc = test_upper( length ); - if( rc == 0 ) - printf( "decode [PASSED]\n" ); - else - printf( "decode [NOT PASSED]\n" ); - - printf( "\n\n#\n * TEST MATRIX BORDERS\n #\n\n" ); - pdt = test_matrix_borders( length, 100 ); - if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { - ompi_ddt_dump( pdt ); - } - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - - printf( "\n\n#\n * TEST CONTIGUOUS\n #\n\n" ); - pdt = test_contiguous(); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "\n\n#\n * TEST STRUCT\n #\n\n" ); - pdt = test_struct(); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - - pdt1 = ompi_ddt_create( -1 ); - pdt2 = ompi_ddt_create( -1 ); - pdt3 = ompi_ddt_create( -1 ); - ompi_ddt_add( pdt3, ompi_ddt_basicDatatypes[DT_INT], 10, 0, -1 ); - ompi_ddt_add( pdt3, ompi_ddt_basicDatatypes[DT_FLOAT], 5, 10 * sizeof(int), -1 ); - - ompi_ddt_add( pdt2, ompi_ddt_basicDatatypes[DT_INT], 1, 0, -1 ); - ompi_ddt_add( pdt2, pdt3, 3, sizeof(int) * 1, -1 ); - - ompi_ddt_add( pdt1, ompi_ddt_basicDatatypes[DT_LONG_LONG_INT], 5, 0, -1 ); - ompi_ddt_add( pdt1, ompi_ddt_basicDatatypes[DT_LONG_DOUBLE], 2, sizeof(long long) * 5, -1 ); - - printf( ">>--------------------------------------------<<\n" ); - if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { - ompi_ddt_dump( pdt1 ); - } - printf( ">>--------------------------------------------<<\n" ); - if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { - ompi_ddt_dump( pdt2 ); - } - printf( ">>--------------------------------------------<<\n" ); - if( outputFlags & DUMP_DATA_AFTER_COMMIT ) { - ompi_ddt_dump( pdt3 ); - } - - OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL ); - OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL ); - OBJ_RELEASE( pdt3 ); assert( pdt3 == NULL ); - */ - /* - printf( ">>--------------------------------------------<<\n" ); - printf( " Contiguous data-type (MPI_DOUBLE)\n" ); - pdt = MPI_DOUBLE; - 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 ); - } - printf( ">>--------------------------------------------<<\n" ); - - printf( ">>--------------------------------------------<<\n" ); - if( outputFlags & CHECK_PACK_UNPACK ) { - printf( "Contiguous multiple data-type (4500*1)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 4500 ); - local_copy_ddt_count(pdt, 1); - local_copy_with_convertor( pdt, 1, 12 ); - local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "Contiguous multiple data-type (450*10)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 450 ); - local_copy_ddt_count(pdt, 10); - local_copy_with_convertor( pdt, 10, 12 ); - local_copy_with_convertor_2datatypes( pdt, 10, pdt, 10, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "Contiguous multiple data-type (45*100)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 45 ); - local_copy_ddt_count(pdt, 100); - local_copy_with_convertor( pdt, 100, 12 ); - local_copy_with_convertor_2datatypes( pdt, 100, pdt, 100, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "Contiguous multiple data-type (100*45)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 100 ); - local_copy_ddt_count(pdt, 45); - local_copy_with_convertor( pdt, 45, 12 ); - local_copy_with_convertor_2datatypes( pdt, 45, pdt, 45, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "Contiguous multiple data-type (10*450)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 10 ); - local_copy_ddt_count(pdt, 450); - local_copy_with_convertor( pdt, 450, 12 ); - local_copy_with_convertor_2datatypes( pdt, 450, pdt, 450, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - printf( "Contiguous multiple data-type (1*4500)\n" ); - pdt = create_contiguous_type( MPI_DOUBLE, 1 ); - local_copy_ddt_count(pdt, 4500); - local_copy_with_convertor( pdt, 4500, 12 ); - local_copy_with_convertor_2datatypes( pdt, 4500, pdt, 4500, 12 ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - } - printf( ">>--------------------------------------------<<\n" ); - printf( ">>--------------------------------------------<<\n" ); - printf( "Vector data-type (450 times 10 double stride 11)\n" ); - pdt = create_vector_type( MPI_DOUBLE, 450, 10, 11 ); - ompi_ddt_dump( pdt ); - if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_ddt_count(pdt, 1); - local_copy_with_convertor( pdt, 1, 12 ); - local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 12 ); - local_copy_with_convertor( pdt, 1, 82 ); - local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 82 ); - local_copy_with_convertor( pdt, 1, 6000 ); - local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 6000 ); - local_copy_with_convertor( pdt, 1, 36000 ); - local_copy_with_convertor_2datatypes( pdt, 1, pdt, 1, 36000 ); - } - printf( ">>--------------------------------------------<<\n" ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - - printf( ">>--------------------------------------------<<\n" ); - pdt = test_struct_char_double(); - 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 ); - } - printf( ">>--------------------------------------------<<\n" ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - - printf( ">>--------------------------------------------<<\n" ); - pdt = test_create_twice_two_doubles(); - 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 ); - } - printf( ">>--------------------------------------------<<\n" ); - OBJ_RELEASE( pdt ); assert( pdt == NULL ); - */ printf( ">>--------------------------------------------<<\n" ); pdt = test_create_blacs_type(); if( outputFlags & CHECK_PACK_UNPACK ) { @@ -1143,17 +1143,15 @@ int main( int argc, char* argv[] ) printf( ">>--------------------------------------------<<\n" ); OBJ_RELEASE( pdt ); assert( pdt == NULL ); - /* - printf( ">>--------------------------------------------<<\n" ); - pdt1 = test_create_blacs_type1( &ompi_mpi_int ); - pdt2 = test_create_blacs_type2( &ompi_mpi_int ); - if( outputFlags & CHECK_PACK_UNPACK ) { - local_copy_with_convertor_2datatypes( pdt1, 1, pdt2, 1, 100 ); - } - printf( ">>--------------------------------------------<<\n" ); - OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL ); - OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL ); - */ + printf( ">>--------------------------------------------<<\n" ); + pdt1 = test_create_blacs_type1( &ompi_mpi_int ); + pdt2 = test_create_blacs_type2( &ompi_mpi_int ); + if( outputFlags & CHECK_PACK_UNPACK ) { + local_copy_with_convertor_2datatypes( pdt1, 1, pdt2, 1, 100 ); + } + printf( ">>--------------------------------------------<<\n" ); + OBJ_RELEASE( pdt1 ); assert( pdt1 == NULL ); + OBJ_RELEASE( pdt2 ); assert( pdt2 == NULL ); /* clean-ups all data allocations */ ompi_ddt_finalize();