From: Augustin Degomme Date: Tue, 16 Jul 2013 15:13:48 +0000 (+0200) Subject: add two more functions X-Git-Tag: v3_9_90~130^2~9 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d9cdd4e949306eb118d2f1d7e51af1550bb61e7c add two more functions --- diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 9cff118109..11a4636573 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -279,6 +279,9 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Type_commit, (MPI_Datatype* datatype)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_hindexed, (int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype)); +MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hindexed, + (int count, int* blocklens, MPI_Aint* indices, + MPI_Datatype old_type, MPI_Datatype* newtype)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hindexed_block, (int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype)); @@ -291,6 +294,9 @@ MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_hvector, MPI_CALL(XBT_PUBLIC(int), MPI_Type_indexed, (int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype)); +MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_indexed, + (int count, int* blocklens, int* indices, + MPI_Datatype old_type, MPI_Datatype* newtype)); MPI_CALL(XBT_PUBLIC(int), MPI_Type_create_indexed_block, (int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype)); diff --git a/src/smpi/private.h b/src/smpi/private.h index 61c341b362..0a63808f69 100644 --- a/src/smpi/private.h +++ b/src/smpi/private.h @@ -469,6 +469,7 @@ void mpi_pack_external_size_ (char *datarep, int* incount, int* datatype, MPI_Ai void mpi_pack_external_ (char *datarep, void *inbuf, int* incount, int* datatype, void *outbuf, MPI_Aint* outcount, MPI_Aint *position, int* ierr); void mpi_unpack_external_ ( char *datarep, void *inbuf, MPI_Aint* insize, MPI_Aint *position, void *outbuf, int* outcount, int* datatype, int* ierr); void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) ; +void mpi_type_create_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) ; void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) ; void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int* newtype, int* ierr) ; void mpi_type_create_indexed_block_ (int* count, int* blocklength, int* indices, int* old_type, int*newtype, int* ierr); diff --git a/src/smpi/smpi_f77.c b/src/smpi/smpi_f77.c index d32ed1b560..e6e20f229c 100644 --- a/src/smpi/smpi_f77.c +++ b/src/smpi/smpi_f77.c @@ -1076,6 +1076,14 @@ void mpi_type_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old } } +void mpi_type_create_hindexed_ (int* count, int* blocklens, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) { + MPI_Datatype tmp; + *ierr = MPI_Type_create_hindexed(*count, blocklens, indices, get_datatype(*old_type), &tmp); + if(*ierr == MPI_SUCCESS) { + *newtype = new_datatype(tmp); + } +} + void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) { MPI_Datatype tmp; *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices, get_datatype(*old_type), &tmp); diff --git a/src/smpi/smpi_mpi.c b/src/smpi/smpi_mpi.c index 9191825e61..c3dd85ed92 100644 --- a/src/smpi/smpi_mpi.c +++ b/src/smpi/smpi_mpi.c @@ -663,6 +663,10 @@ int MPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype return PMPI_Type_hindexed(count, blocklens, indices, old_type, newtype); } +int MPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) { + return PMPI_Type_create_hindexed(count, blocklens,indices,old_type,new_type); +} + int MPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* newtype) { return PMPI_Type_create_hindexed_block(count, blocklength, indices, old_type, newtype); } @@ -675,6 +679,10 @@ int MPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_t return PMPI_Type_indexed(count, blocklens, indices, old_type, newtype); } +int MPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* newtype) { + return PMPI_Type_create_indexed(count, blocklens, indices, old_type, newtype); +} + int MPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype *newtype){ return PMPI_Type_create_indexed_block(count, blocklength, indices, old_type, newtype); } diff --git a/src/smpi/smpi_pmpi.c b/src/smpi/smpi_pmpi.c index 5e7d3b9c16..f3269fd81c 100644 --- a/src/smpi/smpi_pmpi.c +++ b/src/smpi/smpi_pmpi.c @@ -2317,6 +2317,21 @@ int PMPI_Type_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_ return retval; } +int PMPI_Type_create_indexed(int count, int* blocklens, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) { + int retval; + + smpi_bench_end(); + if (old_type == MPI_DATATYPE_NULL) { + retval = MPI_ERR_TYPE; + } else if (count<0){ + retval = MPI_ERR_COUNT; + } else { + retval = smpi_datatype_indexed(count, blocklens, indices, old_type, new_type); + } + smpi_bench_begin(); + return retval; +} + int PMPI_Type_create_indexed_block(int count, int blocklength, int* indices, MPI_Datatype old_type, MPI_Datatype* new_type) { int retval,i; @@ -2351,6 +2366,10 @@ int PMPI_Type_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatyp return retval; } +int PMPI_Type_create_hindexed(int count, int* blocklens, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) { + return PMPI_Type_hindexed(count, blocklens,indices,old_type,new_type); +} + int PMPI_Type_create_hindexed_block(int count, int blocklength, MPI_Aint* indices, MPI_Datatype old_type, MPI_Datatype* new_type) { int retval,i;