Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not use the src_buff and dst_buff to flag that the communication's data was copied...
authorcristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 10 May 2010 14:14:45 +0000 (14:14 +0000)
committercristianrosa <cristianrosa@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 10 May 2010 14:14:45 +0000 (14:14 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7729 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/simix/private.h
src/simix/smx_network.c

index 6e7b328..eec2c34 100644 (file)
@@ -158,6 +158,8 @@ typedef struct s_smx_comm {
   void *dst_buff;
   size_t src_buff_size;
   size_t *dst_buff_size;
   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;
 
   void *data;             /* User data associated to communication */
 } s_smx_comm_t;
 
index 573cabd..c8c5ac9 100644 (file)
@@ -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 */
   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)",
     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);
 
     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)*/
   /* (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 */
   {
   
   /* pimple to display the message sizes */
   {