From f7cfe95e71206adaba49d464f040d7014b9ab686 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 16 May 2011 11:24:00 +0200 Subject: [PATCH] [trace] Do not split comm if trace is not active. --- src/msg/msg_mailbox.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/msg/msg_mailbox.c b/src/msg/msg_mailbox.c index 979b95786e..cd5990b3cb 100644 --- a/src/msg/msg_mailbox.c +++ b/src/msg/msg_mailbox.c @@ -158,14 +158,20 @@ 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 - comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size, - t_simdata->rate, task, sizeof(void *), NULL, NULL, 0); - t_simdata->comm = comm; - SIMIX_req_set_category(comm, task->category); - SIMIX_req_comm_wait(comm, timeout); -#else - SIMIX_req_comm_send(mailbox, t_simdata->message_size, - t_simdata->rate, task, sizeof(void*), NULL, NULL, timeout); + if (TRACE_is_active()) { + comm = SIMIX_req_comm_isend(mailbox, t_simdata->message_size, + t_simdata->rate, task, sizeof(void *), + NULL, NULL, 0); + t_simdata->comm = comm; + 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 + } #endif } -- 2.20.1