Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove SIMIX requests that get src and dst buffers and their sizes
[simgrid.git] / src / simix / smx_network.c
index 113b9d6..8956b25 100644 (file)
@@ -22,7 +22,7 @@ static smx_action_t SIMIX_comm_new(e_smx_comm_type_t type);
 static XBT_INLINE void SIMIX_rdv_push(smx_rdv_t rdv, smx_action_t comm);
 static XBT_INLINE void SIMIX_rdv_remove(smx_rdv_t rdv, smx_action_t comm);
 static smx_action_t SIMIX_rdv_get_request(smx_rdv_t rdv, e_smx_comm_type_t type,
-                                                                                 int (*match_fun)(void *, void *), void *);
+                                         int (*match_fun)(void *, void *), void *);
 static void SIMIX_rdv_free(void *data);
 
 void SIMIX_network_init(void)
@@ -271,7 +271,7 @@ smx_action_t SIMIX_comm_isend(smx_process_t src_proc, smx_rdv_t rdv,
 
   /* If the communication action is detached then decrease the refcount
    * by one, so it will be eliminated by the receivers destroy call */
-  if(detached){
+  if (detached) {
     action->comm.detached = 1;
     action->comm.refcount--;
   }
@@ -508,6 +508,7 @@ static XBT_INLINE void SIMIX_comm_start(smx_action_t action)
 
 void SIMIX_comm_finish(smx_action_t action)
 {
+  unsigned int destroy_count = 0;
   smx_req_t req;
 
   while ((req = xbt_fifo_shift(action->request_list))) {
@@ -606,7 +607,11 @@ void SIMIX_comm_finish(smx_action_t action)
 
     req->issuer->waiting_action = NULL;
     SIMIX_request_answer(req);
+    destroy_count++;
   }
+
+  while(destroy_count-- > 0)
+    SIMIX_comm_destroy(action);
 }
 
 void SIMIX_post_comm(smx_action_t action)
@@ -721,33 +726,6 @@ void* SIMIX_comm_get_dst_data(smx_action_t action)
   return action->comm.dst_data;
 }
 
-void* SIMIX_comm_get_src_buff(smx_action_t action)
-{
-  return action->comm.src_buff;
-}
-
-void* SIMIX_comm_get_dst_buff(smx_action_t action)
-{
-  return action->comm.dst_buff;
-}
-
-size_t SIMIX_comm_get_src_buff_size(smx_action_t action)
-{
-  return action->comm.src_buff_size;
-}
-
-size_t SIMIX_comm_get_dst_buff_size(smx_action_t action)
-{
-  size_t buff_size;
-
-  if (action->comm.dst_buff_size)
-    buff_size = *(action->comm.dst_buff_size);
-  else
-    buff_size = 0;
-
-  return buff_size;
-}
-
 smx_process_t SIMIX_comm_get_src_proc(smx_action_t action)
 {
   return action->comm.src_proc;