X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f3d85e5d91158b55c5dcd30d0400059574e4425..9104957deccc59e0e804215d5db498fabfd40d29:/teshsuite/smpi/mpich3-test/perf/nestvec.c diff --git a/teshsuite/smpi/mpich3-test/perf/nestvec.c b/teshsuite/smpi/mpich3-test/perf/nestvec.c index 494f847f20..6ee12f5e65 100644 --- a/teshsuite/smpi/mpich3-test/perf/nestvec.c +++ b/teshsuite/smpi/mpich3-test/perf/nestvec.c @@ -30,161 +30,161 @@ static int verbose = 0; -int main( int argc, char **argv ) +int main(int argc, char **argv) { - int vcount = 16, vblock = vcount*vcount/2, vstride=2*vcount*vblock; - int v2stride, typesize, packsize, i, position, errs = 0; - char *inbuf, *outbuf, *outbuf2; + int vcount = 16, vblock = vcount * vcount / 2, vstride = 2 * vcount * vblock; + int v2stride, typesize, packsize, i, position, errs = 0; + char *inbuf, *outbuf, *outbuf2; MPI_Datatype ft1type, ft2type, ft3type; MPI_Datatype ftopttype; - MPI_Aint lb, extent; - double t0, t1; - double tpack, tmanual, tpackopt; - int ntry; - - MPI_Init( &argc, &argv ); - - MPI_Type_contiguous( 6, MPI_FLOAT, &ft1type ); - MPI_Type_size( ft1type, &typesize ); + MPI_Aint lb, extent; + double t0, t1; + double tpack, tmanual, tpackopt; + int ntry; + + MPI_Init(&argc, &argv); + + MPI_Type_contiguous(6, MPI_FLOAT, &ft1type); + MPI_Type_size(ft1type, &typesize); v2stride = vcount * vcount * vcount * vcount * typesize; - MPI_Type_vector( vcount, vblock, vstride, ft1type, &ft2type ); - MPI_Type_create_hvector( 2, 1, v2stride, ft2type, &ft3type ); - MPI_Type_commit( &ft3type ); - MPI_Type_free( &ft1type ); - MPI_Type_free( &ft2type ); + MPI_Type_vector(vcount, vblock, vstride, ft1type, &ft2type); + MPI_Type_create_hvector(2, 1, v2stride, ft2type, &ft3type); + MPI_Type_commit(&ft3type); + MPI_Type_free(&ft1type); + MPI_Type_free(&ft2type); #if defined(MPICH) && defined(PRINT_DATATYPE_INTERNALS) /* To use MPIDU_Datatype_debug to print the datatype internals, - you must configure MPICH with --enable-g=log */ + * you must configure MPICH with --enable-g=log */ if (verbose) { - printf( "Original datatype:\n" ); - MPIDU_Datatype_debug( ft3type, 10 ); + printf("Original datatype:\n"); + MPIDU_Datatype_debug(ft3type, 10); } #endif /* The same type, but without using the contiguous type */ - MPI_Type_vector( vcount, 6*vblock, 6*vstride, MPI_FLOAT, &ft2type ); - MPI_Type_create_hvector( 2, 1, v2stride, ft2type, &ftopttype ); - MPI_Type_commit( &ftopttype ); - MPI_Type_free( &ft2type ); + MPI_Type_vector(vcount, 6 * vblock, 6 * vstride, MPI_FLOAT, &ft2type); + MPI_Type_create_hvector(2, 1, v2stride, ft2type, &ftopttype); + MPI_Type_commit(&ftopttype); + MPI_Type_free(&ft2type); #if defined(MPICH) && defined(PRINT_DATATYPE_INTERNALS) if (verbose) { - printf( "\n\nMerged datatype:\n" ); - MPIDU_Datatype_debug( ftopttype, 10 ); + printf("\n\nMerged datatype:\n"); + MPIDU_Datatype_debug(ftopttype, 10); } #endif - MPI_Type_get_extent( ft3type, &lb, &extent ); - MPI_Type_size( ft3type, &typesize ); + MPI_Type_get_extent(ft3type, &lb, &extent); + MPI_Type_size(ft3type, &typesize); - MPI_Pack_size( 1, ft3type, MPI_COMM_WORLD, &packsize ); + MPI_Pack_size(1, ft3type, MPI_COMM_WORLD, &packsize); - inbuf = (char *)malloc( extent ); - outbuf = (char *)malloc( packsize ); - outbuf2 = (char *)malloc( packsize ); + inbuf = (char *) malloc(extent); + outbuf = (char *) malloc(packsize); + outbuf2 = (char *) malloc(packsize); if (!inbuf) { - fprintf( stderr, "Unable to allocate %ld for inbuf\n", (long)extent ); - MPI_Abort( MPI_COMM_WORLD, 1 ); + fprintf(stderr, "Unable to allocate %ld for inbuf\n", (long) extent); + MPI_Abort(MPI_COMM_WORLD, 1); } if (!outbuf) { - fprintf( stderr, "Unable to allocate %ld for outbuf\n", (long)packsize ); - MPI_Abort( MPI_COMM_WORLD, 1 ); + fprintf(stderr, "Unable to allocate %ld for outbuf\n", (long) packsize); + MPI_Abort(MPI_COMM_WORLD, 1); } if (!outbuf2) { - fprintf( stderr, "Unable to allocate %ld for outbuf2\n", (long)packsize ); - MPI_Abort( MPI_COMM_WORLD, 1 ); + fprintf(stderr, "Unable to allocate %ld for outbuf2\n", (long) packsize); + MPI_Abort(MPI_COMM_WORLD, 1); } - for (i=0; i