Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove comm from src_proc->comms and dst_proc->comms when finish it,
authorMarion Guthmuller <marion.guthmuller@loria.fr>
Fri, 14 Dec 2012 14:57:57 +0000 (15:57 +0100)
committerMarion Guthmuller <marion.guthmuller@loria.fr>
Sun, 16 Dec 2012 17:34:16 +0000 (18:34 +0100)
if is detached (dsend)

Currently, with dsend action, the wait of src_proc is not necessary to
finish the communication. In this case, only dst_proc removes this
communication from its list and destroys it, if src_proc is always
running. When src_proc makes a process_cleanup after that, it
retrieves this communication in its list while it doesn't exist
anymore and thinks that this communication isn't for it. This led to a
simulation error.

src/simix/smx_network.c

index 11eb250..23600af 100644 (file)
@@ -877,6 +877,16 @@ void SIMIX_comm_finish(smx_action_t action)
 
     simcall->issuer->waiting_action = NULL;
     xbt_fifo_remove(simcall->issuer->comms, action);
 
     simcall->issuer->waiting_action = NULL;
     xbt_fifo_remove(simcall->issuer->comms, action);
+    if(action->comm.detached){
+      if(simcall->issuer == action->comm.src_proc){
+        if(action->comm.dst_proc)
+          xbt_fifo_remove(action->comm.dst_proc->comms, action);
+      }
+      if(simcall->issuer == action->comm.dst_proc){
+        if(action->comm.src_proc)
+          xbt_fifo_remove(action->comm.src_proc->comms, action);
+      }
+    }
     SIMIX_simcall_answer(simcall);
     destroy_count++;
   }
     SIMIX_simcall_answer(simcall);
     destroy_count++;
   }