Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
new tracing mask TRACE_VOLUME to trace the msg tasks communication size and group...
[simgrid.git] / src / instr / msg_volume.c
1 /*
2  * msg_volume.c
3  *
4  *  Created on: April 23, 2010
5  *      Author: Lucas Schnorr
6  *     License: This program is free software; you can redistribute
7  *              it and/or modify it under the terms of the license
8  *              (GNU LGPL) which comes with this package.
9  *
10  *     Copyright (c) 2009 The SimGrid team.
11  */
12
13 #include "instr/private.h"
14
15 #ifdef HAVE_TRACING
16
17 void __TRACE_msg_volume_start (m_task_t task)
18 {
19   if (!IS_TRACING_VOLUME) return;
20
21   /* check if task is traced */
22   if (!IS_TRACED(task)) return;
23
24   /* check if process is traced */
25   m_process_t process = MSG_process_self ();
26   if (!IS_TRACED(process)) return;
27
28   char process_name[200], process_alias[200];
29   m_host_t host = MSG_process_get_host (process);
30   TRACE_process_container (process, process_name, 200);
31   TRACE_process_alias_container (process, host, process_alias, 200);
32   char task_name[200];
33   TRACE_task_container (task, task_name, 200);
34
35   double volume = MSG_task_get_data_size (task);
36
37   pajeStartLinkWithVolume (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name, volume);
38 }
39
40 void __TRACE_msg_volume_finish (m_task_t task)
41 {
42   if (!IS_TRACING_VOLUME) return;
43
44   /* check if task is traced */
45   if (!IS_TRACED(task)) return;
46
47   /* check if process is traced */
48   m_process_t process = MSG_process_self ();
49   if (!IS_TRACED(process)) return;
50
51   char process_name[200], process_alias[200];
52   m_host_t host = MSG_process_get_host (process);
53   TRACE_process_container (process, process_name, 200);
54   TRACE_process_alias_container (process, host, process_alias, 200);
55   char task_name[200];
56   TRACE_task_container (task, task_name, 200);
57
58   pajeEndLink (MSG_get_clock(), "volume", "0", task->category, process_alias, task_name);
59 }
60
61 #endif