Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some fct to simix for function wait in gos.c
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 1 Jul 2010 12:10:29 +0000 (12:10 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 1 Jul 2010 12:10:29 +0000 (12:10 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7955 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/include/simix/simix.h
src/msg/gos.c
src/simix/smx_network.c

index 7b9cb19..d673c4e 100644 (file)
@@ -212,6 +212,11 @@ XBT_PUBLIC(void) SIMIX_communication_destroy(smx_comm_t comm);
 XBT_PUBLIC(double) SIMIX_communication_get_remains(smx_comm_t comm);
 XBT_PUBLIC(void *) SIMIX_communication_get_data(smx_comm_t comm);
 
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf_size(smx_comm_t comm);
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf_size(smx_comm_t comm);
+
 /*****Networking*****/
 XBT_PUBLIC(void) SIMIX_network_set_copy_data_callback(void (*callback)(smx_comm_t, size_t));
 XBT_PUBLIC(void) SIMIX_network_copy_pointer_callback(smx_comm_t comm, size_t buff_size);
index 54b4fa8..f59e937 100644 (file)
@@ -48,7 +48,6 @@ MSG_error_t MSG_task_execute(m_task_t task)
   TRACE_msg_task_execute_start (task);
 #endif
 
-
   xbt_assert1((!simdata->compute) && (task->simdata->refcount == 1),
               "This task is executed somewhere else. Go fix your code! %d", task->simdata->refcount);
 
@@ -427,7 +426,6 @@ msg_comm_t MSG_task_isend(m_task_t task, const char *alias) {
 
   t_simdata->refcount++;
   msg_global->sent_msg++;
-
   process->simdata->waiting_task = task;
 
   /* Send it by calling SIMIX network layer */
@@ -469,12 +467,19 @@ msg_comm_t MSG_task_irecv(m_task_t * task, const char *alias) {
 int MSG_comm_test(msg_comm_t comm) {
   return SIMIX_network_test(comm);
 }
-MSG_error_t MSG_comm_wait(msg_comm_t comm,double timeout) {
+
+MSG_error_t MSG_comm_wait(msg_comm_t comm, double timeout) {
   xbt_ex_t e;
   MSG_error_t res = MSG_OK;
   TRY {
     SIMIX_network_wait(comm,timeout);
-    //  (*task)->simdata->refcount--;
+
+    if(!(comm->src_proc == SIMIX_process_self()))
+    {
+       m_task_t  task;
+       task = (m_task_t) SIMIX_communication_get_src_buf(comm);
+       task->simdata->refcount--;
+    }
 
     /* FIXME: these functions are not tracable */
   }  CATCH(e){
index 923173b..53af644 100644 (file)
@@ -436,6 +436,23 @@ XBT_INLINE void *SIMIX_communication_get_data(smx_comm_t comm)
   return comm->data;
 }
 
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf(smx_comm_t comm)
+{
+  return comm->src_buff;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf(smx_comm_t comm)
+{
+  return comm->dst_buff;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_src_buf_size(smx_comm_t comm)
+{
+  return comm->src_buff_size;
+}
+XBT_PUBLIC(void *) SIMIX_communication_get_dst_buf_size(smx_comm_t comm)
+{
+  return comm->dst_buff_size;
+}
+
 /******************************************************************************/
 /*                        Synchronous Communication                           */
 /******************************************************************************/