Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
please sonar and cosmetics
[simgrid.git] / src / smpi / smpi_op.cpp
index a4e42aa..805647b 100644 (file)
@@ -238,12 +238,12 @@ void Op::set_fortran_op()
 
 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
+  if(smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP){//we need to switch as the called function may silently touch global variables
     XBT_DEBUG("Applying operation, switch to the right data frame ");
     smpi_switch_data_segment(smpi_process()->index());
   }
 
-  if(!smpi_process()->replaying()){
+  if(!smpi_process()->replaying() && *len > 0){
     if(! is_fortran_op_)
       this->func_(invec, inoutvec, len, &datatype);
     else{