From b38d5c15755a98cc7ef99a0a9c4936357dbedce3 Mon Sep 17 00:00:00 2001 From: cristianrosa Date: Mon, 10 May 2010 14:14:45 +0000 Subject: [PATCH 1/1] Do not use the src_buff and dst_buff to flag that the communication's data was copied, they are usefull for MC. Use a new flag "copied". git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7729 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/simix/private.h | 2 ++ src/simix/smx_network.c | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/simix/private.h b/src/simix/private.h index 6e7b3289cf..eec2c34c6f 100644 --- a/src/simix/private.h +++ b/src/simix/private.h @@ -158,6 +158,8 @@ typedef struct s_smx_comm { void *dst_buff; size_t src_buff_size; size_t *dst_buff_size; + char copied; + void *data; /* User data associated to communication */ } s_smx_comm_t; diff --git a/src/simix/smx_network.c b/src/simix/smx_network.c index 573cabd16b..c8c5ac9363 100644 --- a/src/simix/smx_network.c +++ b/src/simix/smx_network.c @@ -362,7 +362,7 @@ void SIMIX_network_copy_data(smx_comm_t comm) size_t buff_size = comm->src_buff_size; /* If there is no data to be copy then return */ - if(!comm->src_buff || !comm->dst_buff) + if(!comm->src_buff || !comm->dst_buff || comm->copied == 1) return; DEBUG6("Copying comm %p data from %s (%p) -> %s (%p) (%zu bytes)", @@ -383,10 +383,9 @@ void SIMIX_network_copy_data(smx_comm_t comm) return; (*SIMIX_network_copy_data_callback)(comm, buff_size); - /* Set the buffers to null so we copy data only once */ + /* Set the copied flag so we copy data only once */ /* (this function might be called from both communication ends)*/ - comm->src_buff = NULL; - comm->dst_buff = NULL; + comm->copied = 1; /* pimple to display the message sizes */ { -- 2.20.1