X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/75d28c977a66ed60c69165faa5968326e8f14c57..64e7c8f9110c7054fa1ea365b750c737171c66ef:/src/smpi/smpi_op.cpp diff --git a/src/smpi/smpi_op.cpp b/src/smpi/smpi_op.cpp index e3d4e2a845..3cd260ea7c 100644 --- a/src/smpi/smpi_op.cpp +++ b/src/smpi/smpi_op.cpp @@ -5,7 +5,6 @@ #include "mc/mc.h" #include "private.h" -#include "smpi_mpi_dt_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_op, smpi, "Logging specific to SMPI (op)"); @@ -97,7 +96,7 @@ APPLY_OP_LOOP(MPI_2LONG, long_long,op) #define APPLY_END_OP_LOOP(op)\ {\ - xbt_die("Failed to apply " #op " to type %s", (*datatype)->name);\ + xbt_die("Failed to apply " #op " to type %s", (*datatype)->name());\ } static void max_func(void *a, void *b, int *length, MPI_Datatype * datatype) @@ -186,7 +185,7 @@ static void maxloc_func(void *a, void *b, int *length, MPI_Datatype * datatype) static void replace_func(void *a, void *b, int *length, MPI_Datatype * datatype) { - memcpy(b, a, *length * smpi_datatype_size(*datatype)); + memcpy(b, a, *length * (*datatype)->size()); } #define CREATE_MPI_OP(name, func) \ @@ -231,7 +230,7 @@ void Op::set_fortran_op() is_fortran_op_ = true; } -void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype * datatype) +void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype) { if(smpi_privatize_global_variables){//we need to switch as the called function may silently touch global variables XBT_DEBUG("Applying operation, switch to the right data frame "); @@ -240,9 +239,9 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype * datatype) if(!smpi_process_get_replaying()){ if(! is_fortran_op_) - this->func_(invec, inoutvec, len, datatype); + this->func_(invec, inoutvec, len, &datatype); else{ - int tmp = smpi_type_c2f(*datatype); + int tmp = smpi_type_c2f(datatype); /* Unfortunately, the C and Fortran version of the MPI standard do not agree on the type here, thus the reinterpret_cast. */ this->func_(invec, inoutvec, len, reinterpret_cast(&tmp) );