From 6dcde87625a4a148bffb674a18306813761509da Mon Sep 17 00:00:00 2001 From: Navarrop Date: Fri, 16 Dec 2011 16:20:16 +0100 Subject: [PATCH] Use isend instead of send to set the simdata->comm so that get_remaining can work. --- src/msg/msg_gos.c | 3 ++- src/msg/msg_mailbox.c | 14 +++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index c41dc38d4b..7f1e3a56ee 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -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 diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index e25051c3fc..9872c2bcea 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -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) -- 2.20.1