Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fixed a bug in comm_copy_data, it wasn't handling messages with zero-size
[simgrid.git] / src / simix / smx_network.c
index 992f98c..d16566f 100644 (file)
@@ -721,6 +721,10 @@ double SIMIX_comm_get_remains(smx_action_t action)
 {
   double remains;
 
+  if(!action){
+      return 0;
+  }
+
   switch (action->state) {
 
     case SIMIX_RUNNING:
@@ -841,10 +845,8 @@ void SIMIX_comm_copy_data(smx_action_t comm)
   if (comm->comm.dst_buff_size)
     *comm->comm.dst_buff_size = buff_size;
 
-  if (buff_size == 0)
-    return;
-
-  (*SIMIX_comm_copy_data_callback) (comm, buff_size);
+  if (buff_size > 0)
+    (*SIMIX_comm_copy_data_callback) (comm, buff_size);
 
   /* Set the copied flag so we copy data only once */
   /* (this function might be called from both communication ends) */