X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b33bdec7b1eb6f5780141d3df13200c608d42ed7..4a8bc21517c2e7759a0036d879338f84ed6bf56e:/src/smpi/bindings/smpi_f77_type.cpp diff --git a/src/smpi/bindings/smpi_f77_type.cpp b/src/smpi/bindings/smpi_f77_type.cpp index 9a28137385..ffd647b1c7 100644 --- a/src/smpi/bindings/smpi_f77_type.cpp +++ b/src/smpi/bindings/smpi_f77_type.cpp @@ -63,9 +63,10 @@ void mpi_type_get_attr_ (int* type, int* type_keyval, int *attribute_val, int* f *attribute_val = *value; } -void mpi_type_set_attr_ (int* type, int* type_keyval, void *attribute_val, int* ierr){ - - *ierr = MPI_Type_set_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval, attribute_val); +void mpi_type_set_attr_ (int* type, int* type_keyval, int *attribute_val, int* ierr){ + int* val = (int*)xbt_malloc(sizeof(int)); + *val=*attribute_val; + *ierr = MPI_Type_set_attr ( simgrid::smpi::Datatype::f2c(*type), *type_keyval, val); } void mpi_type_delete_attr_ (int* type, int* type_keyval, int* ierr){ @@ -74,9 +75,9 @@ void mpi_type_delete_attr_ (int* type, int* type_keyval, int* ierr){ } void mpi_type_create_keyval_ (void* copy_fn, void* delete_fn, int* keyval, void* extra_state, int* ierr){ - - *ierr = MPI_Type_create_keyval(reinterpret_cast(copy_fn), reinterpret_cast(delete_fn), - keyval, extra_state) ; + smpi_copy_fn _copy_fn={nullptr,nullptr,nullptr,nullptr,(*(int*)copy_fn) == 0 ? nullptr : reinterpret_cast(copy_fn),nullptr}; + smpi_delete_fn _delete_fn={nullptr,nullptr,nullptr,nullptr,(*(int*)delete_fn) == 0 ? nullptr : reinterpret_cast(delete_fn),nullptr}; + *ierr = simgrid::smpi::Keyval::keyval_create(_copy_fn, _delete_fn, keyval, extra_state); } void mpi_type_free_keyval_ (int* keyval, int* ierr) {