Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add SIMIX_rdv_{set,get}_data; tiny fixups
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 Oct 2009 13:08:47 +0000 (13:08 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 20 Oct 2009 13:08:47 +0000 (13:08 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6803 48e7efb5-ca39-0410-a469-dd3cf9ba447f

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

index e27e4f7..c0a0fa8 100644 (file)
@@ -183,6 +183,8 @@ XBT_PUBLIC(void) SIMIX_rdv_destroy(smx_rdv_t rvp);
 XBT_PUBLIC(int) SIMIX_rdv_get_count_waiting_comm(smx_rdv_t rdv, smx_host_t host);
 XBT_PUBLIC(smx_comm_t) SIMIX_rdv_get_head(smx_rdv_t rdv);
 XBT_PUBLIC(smx_comm_t) SIMIX_rdv_get_request(smx_rdv_t rdv, smx_comm_type_t type);
+XBT_PUBLIC(void) SIMIX_rdv_set_data(smx_rdv_t rdv,void *data);
+XBT_PUBLIC(void*) SIMIX_rdv_get_data(smx_rdv_t rdv);
 
 /*****Communication Requests*****/
 XBT_PUBLIC(void) SIMIX_communication_cancel(smx_comm_t comm);
@@ -195,7 +197,7 @@ XBT_PUBLIC(void) SIMIX_network_send(smx_rdv_t rdv, double task_size, double rate
                                     size_t src_buff_size, smx_comm_t *comm, void *data);
 XBT_PUBLIC(void) SIMIX_network_recv(smx_rdv_t rdv, double timeout, void *dst_buff,
                                     size_t *dst_buff_size, smx_comm_t *comm);
-XBT_PUBLIC(void) SIMIX_network_wait(smx_action_t comm);
+XBT_PUBLIC(void) SIMIX_network_wait(smx_action_t comm, double timeout);
 XBT_PUBLIC(int) SIMIX_network_test(smx_action_t comm);
 
 SG_END_DECL()
index df10ecb..6560c3e 100644 (file)
@@ -125,6 +125,7 @@ typedef struct s_smx_rvpoint {
   smx_mutex_t read;
   smx_mutex_t write;
   xbt_fifo_t comm_fifo;  
+  void *data;
 } s_smx_rvpoint_t;
 
 typedef struct s_smx_comm {
index f33b818..9c421ab 100644 (file)
@@ -123,6 +123,14 @@ smx_comm_t SIMIX_rdv_get_head(smx_rdv_t rdv)
   return (smx_comm_t)xbt_fifo_get_item_content(xbt_fifo_get_first_item(rdv->comm_fifo));
 }
 
+/** @brief adds some API-related data to the rendez-vous point */
+void SIMIX_rdv_set_data(smx_rdv_t rdv,void *data) {
+  rdv->data=data;
+}
+/** @brief gets API-related data from the rendez-vous point */
+void *SIMIX_rdv_get_data(smx_rdv_t rdv) {
+  return rdv->data;
+}
 
 /******************************************************************************/
 /*                           Communication Requests                           */
@@ -296,7 +304,8 @@ void SIMIX_network_copy_data(smx_comm_t comm)
   dst_buff_size = MIN(dst_buff_size, src_buff_size);
   
   /* Update the receiver's buffer size to the copied amount */
-  *comm->dst_buff_size = dst_buff_size;
+  if (comm->dst_buff_size)
+    *comm->dst_buff_size = dst_buff_size;
 
   if(dst_buff_size == 0)
     return;
@@ -418,16 +427,16 @@ void SIMIX_network_recv(smx_rdv_t rdv, double timeout, void *dst_buff,
 /*                        Asynchronous Communication                          */
 /******************************************************************************/
 
-/*
+
 void SIMIX_network_wait(smx_action_t comm, double timeout)
 {
-  TO BE IMPLEMENTED
+  THROW_UNIMPLEMENTED;
 }
 
 XBT_PUBLIC(int) SIMIX_network_test(smx_action_t comm)
 {
-  TO BE IMPLEMENTED
-}*/
+  THROW_UNIMPLEMENTED;
+}