From cdcfa50107cc897b89de650afa5c7447c21d87d3 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 27 Dec 2011 00:20:56 +0100 Subject: [PATCH 1/1] When the process exits, don't cancel the communications it is involved into if it's the sender of detached sends --- src/simix/smx_process.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index a13e5653d2..f45d326155 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -41,8 +41,9 @@ void SIMIX_process_cleanup(smx_process_t process) smx_action_t action; while ((action = xbt_fifo_pop(process->comms))) { - /* make sure no one will finish the comm after this process is destroyed */ - SIMIX_comm_cancel(action); + /* make sure no one will finish the comm after this process is destroyed (unless it's detached) */ + if (!action->comm.detached || action->comm.src_proc != process) + SIMIX_comm_cancel(action); if (action->comm.src_proc == process) { XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", @@ -51,15 +52,14 @@ void SIMIX_process_cleanup(smx_process_t process) if (action->comm.detached) { if (action->comm.refcount == 0) { - XBT_DEBUG("Increase the refcount before destroying it"); + XBT_DEBUG("Increase the refcount before destroying it since it's detached"); /* I'm not supposed to destroy a detached comm from the sender side, * unless there is no receiver matching the rdv */ action->comm.refcount++; SIMIX_comm_destroy(action); } XBT_DEBUG("Don't destroy it since its refcount is %d",action->comm.refcount); - } - else { + } else { SIMIX_comm_destroy(action); } } -- 2.20.1