Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use isend instead of send to set the simdata->comm so that get_remaining can work.
authorNavarrop <Pierre.Navarro@imag.fr>
Fri, 16 Dec 2011 15:20:16 +0000 (16:20 +0100)
committerNavarrop <Pierre.Navarro@imag.fr>
Fri, 16 Dec 2011 15:59:58 +0000 (16:59 +0100)
src/msg/msg_gos.c
src/msg/msg_mailbox.c

index c41dc38..7f1e3a5 100644 (file)
@@ -469,8 +469,9 @@ void MSG_task_dsend(m_task_t task, const char *alias, void_f_pvoid_t cleanup)
   msg_global->sent_msg++;
 
   /* Send it by calling SIMIX network layer */
-  SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
+  smx_action_t comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
                        t_simdata->rate, task, sizeof(void *), NULL, cleanup, 1);
+  t_simdata->comm = comm;
 }
 
 /** \ingroup msg_gos_functions
index e25051c..9872c2b 100644 (file)
@@ -153,21 +153,16 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
 
   /* Try to send it by calling SIMIX network layer */
   TRY {
-#ifdef HAVE_TRACING
-    if (TRACE_is_enabled()) {
       smx_action_t comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size,
                                   t_simdata->rate, task, sizeof(void *),
                                   NULL, NULL, 0);
-      SIMIX_req_set_category(comm, task->category);
-      SIMIX_req_comm_wait(comm, timeout);
-    } else {
-#endif
-      SIMIX_req_comm_send(mailbox, t_simdata->message_size,
-                          t_simdata->rate, task, sizeof(void*),
-                          NULL, NULL, timeout);
 #ifdef HAVE_TRACING
+    if (TRACE_is_enabled()) {
+      SIMIX_req_set_category(comm, task->category);
     }
 #endif
+     t_simdata->comm = comm;
+     SIMIX_req_comm_wait(comm, timeout);
   }
 
   CATCH(e) {
@@ -190,6 +185,7 @@ MSG_mailbox_put_with_timeout(msg_mailbox_t mailbox, m_task_t task,
     t_simdata->isused = 0;
   }
 
+
   p_simdata->waiting_task = NULL;
 #ifdef HAVE_TRACING
   if (call_end)