Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to fix some supurious failures with Thread san
[simgrid.git] / src / smpi / smpi_op.cpp
index 96ac1b8..8251f94 100644 (file)
@@ -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)");
 
@@ -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)                             \
@@ -242,7 +241,7 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
     if(! is_fortran_op_)
       this->func_(invec, inoutvec, len, &datatype);
     else{
-      int tmp = smpi_type_c2f(datatype);
+      int tmp = datatype->c2f();
       /* 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<MPI_Datatype*>(&tmp) );
@@ -250,5 +249,9 @@ void Op::apply(void *invec, void *inoutvec, int *len, MPI_Datatype datatype)
   }
 }
 
+Op* Op::f2c(int id){
+  return static_cast<Op*>(F2C::f2c(id));
+}
+
 }
 }