From a03ea3e82cc23808a1fb55b1841dc3b4a833fb89 Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Sun, 1 May 2005 08:26:20 +0000 Subject: [PATCH] Correclt compute the dargs even for the first data. This commit was SVN r5557. --- src/mpi/c/type_create_darray.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mpi/c/type_create_darray.c b/src/mpi/c/type_create_darray.c index 26aa3b2c85..aae393ce48 100644 --- a/src/mpi/c/type_create_darray.c +++ b/src/mpi/c/type_create_darray.c @@ -74,7 +74,7 @@ int MPI_Type_create_darray(int size, MPI_Datatype *newtype) { - int32_t i, step, end_loop, *r; + int32_t i, darg_i, step, end_loop, *r; MPI_Datatype temptype; if (MPI_PARAM_CHECK) { @@ -135,9 +135,8 @@ int MPI_Type_create_darray(int size, end_loop = -1; } - temptype = cyclic( darg_array[i], gsize_array[i], r[i], psize_array[i], oldtype ); - for( i += step; i != end_loop; i += step ) { - int darg_i = darg_array[i]; + do { + darg_i = darg_array[i]; if( distrib_array[i] == MPI_DISTRIBUTE_BLOCK ) { if( darg_array[i] == MPI_DISTRIBUTE_DFLT_DARG ) darg_i = (gsize_array[i] + psize_array[i] - 1) / psize_array[i]; @@ -151,7 +150,8 @@ int MPI_Type_create_darray(int size, *newtype = cyclic( darg_i, gsize_array[i], r[i], psize_array[i], temptype ); ompi_ddt_destroy( &temptype ); temptype = *newtype; - } + i += step; + } while( i != end_loop ); free( r ); /* This function is not yet implemented */