From: Augustin Degomme Date: Fri, 26 Jul 2019 13:15:25 +0000 (+0200) Subject: Partially revert 2b4dcee56 and activate a test. X-Git-Tag: v3.24~247 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/dd2f26defe03f7e9133972baa734db9c0dbd167c Partially revert 2b4dcee56 and activate a test. mpi_type_create_x actually handle MPI_Aint, only mpi_type_x need conversion --- diff --git a/src/smpi/bindings/smpi_f77_type.cpp b/src/smpi/bindings/smpi_f77_type.cpp index 1f71496026..e7207ff682 100644 --- a/src/smpi/bindings/smpi_f77_type.cpp +++ b/src/smpi/bindings/smpi_f77_type.cpp @@ -143,29 +143,21 @@ void mpi_type_hindexed_ (int* count, int* blocklens, int* indices, int* old_type delete[] indices_aint; } -void mpi_type_create_hindexed_(int* count, int* blocklens, int* 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){ MPI_Datatype tmp; - MPI_Aint* indices_aint=new MPI_Aint[*count]; - for(int i=0; i<*count; i++) - indices_aint[i]=indices[i]; - *ierr = MPI_Type_create_hindexed(*count, blocklens, indices_aint, simgrid::smpi::Datatype::f2c(*old_type), &tmp); + *ierr = MPI_Type_create_hindexed(*count, blocklens, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp); if(*ierr == MPI_SUCCESS) { *newtype = tmp->add_f(); } - delete[] indices_aint; } -void mpi_type_create_hindexed_block_ (int* count, int* blocklength, int* indices, int* old_type, int* newtype, +void mpi_type_create_hindexed_block_ (int* count, int* blocklength, MPI_Aint* indices, int* old_type, int* newtype, int* ierr) { MPI_Datatype tmp; - MPI_Aint* indices_aint=new MPI_Aint[*count]; - for(int i=0; i<*count; i++) - indices_aint[i]=indices[i]; - *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices_aint, simgrid::smpi::Datatype::f2c(*old_type), &tmp); + *ierr = MPI_Type_create_hindexed_block(*count, *blocklength, indices, simgrid::smpi::Datatype::f2c(*old_type), &tmp); if(*ierr == MPI_SUCCESS) { *newtype = tmp->add_f(); } - delete[] indices_aint; } void mpi_type_indexed_ (int* count, int* blocklens, int* indices, int* old_type, int* newtype, int* ierr) { @@ -210,21 +202,18 @@ void mpi_type_struct_ (int* count, int* blocklens, int* indices, int* old_types, delete[] indices_aint; } -void mpi_type_create_struct_(int* count, int* blocklens, int* indices, int* old_types, int* newtype, int* ierr){ +void mpi_type_create_struct_(int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr){ MPI_Datatype tmp; int i=0; MPI_Datatype* types = static_cast(xbt_malloc(*count*sizeof(MPI_Datatype))); - MPI_Aint* indices_aint=new MPI_Aint[*count]; for(i=0; i< *count; i++){ - indices_aint[i]=indices[i]; types[i] = simgrid::smpi::Datatype::f2c(old_types[i]); } - *ierr = MPI_Type_create_struct(*count, blocklens, indices_aint, types, &tmp); + *ierr = MPI_Type_create_struct(*count, blocklens, indices, types, &tmp); if(*ierr == MPI_SUCCESS) { *newtype = tmp->add_f(); } xbt_free(types); - delete[] indices_aint; } void mpi_pack_ (void* inbuf, int* incount, int* type, void* outbuf, int* outcount, int* position, int* comm, int* ierr) { diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index 32f9d3a71e..2c805a5209 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -361,14 +361,14 @@ void mpi_pack_external_(char* datarep, void* inbuf, int* incount, int* datatype, 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, int* indices, int* old_type, int* newtype, int* ierr); -void mpi_type_create_hindexed_(int* count, int* blocklens, int* indices, int* old_type, int* newtype, int* ierr); -void mpi_type_create_hindexed_block_(int* count, int* blocklength, int* indices, int* old_type, int* newtype, +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_(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); void mpi_type_struct_(int* count, int* blocklens, int* indices, int* old_types, int* newtype, int* ierr); -void mpi_type_create_struct_(int* count, int* blocklens, int* indices, int* old_types, int* newtype, int* ierr); +void mpi_type_create_struct_(int* count, int* blocklens, MPI_Aint* indices, int* old_types, int* newtype, int* ierr); void mpi_ssend_(void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* ierr); void mpi_ssend_init_(void* buf, int* count, int* datatype, int* dest, int* tag, int* comm, int* request, int* ierr); void mpi_intercomm_create_(int* local_comm, int* local_leader, int* peer_comm, int* remote_leader, int* tag, diff --git a/teshsuite/smpi/mpich3-test/f90/datatype/testlist b/teshsuite/smpi/mpich3-test/f90/datatype/testlist index f10917c31b..d6ed874674 100644 --- a/teshsuite/smpi/mpich3-test/f90/datatype/testlist +++ b/teshsuite/smpi/mpich3-test/f90/datatype/testlist @@ -10,7 +10,7 @@ gaddressf90 1 #allctypesf90 1 #hindex1f90 1 #hindexed_blockf90 1 mpiversion=1.0 -#structf 2 +structf 2 indtype 2 #createf90 1 #sizeof 1