]> AND Private Git Repository - loba.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
Experimental tracing support.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 21 Jan 2011 15:57:04 +0000 (16:57 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 21 Jan 2011 15:57:04 +0000 (16:57 +0100)
communicator.cpp
main.cpp
process.cpp
tracing.h [new file with mode: 0644]

index 90cf990ebb07c31f70d30f89e6723a94bd78bdca..7784a483ab724d10d41c9c96aef264b2f387f773 100644 (file)
@@ -9,6 +9,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm);
 
 #include "misc.h"
 #include "options.h"
+#include "tracing.h"
 
 #include "communicator.h"
 
@@ -79,6 +80,9 @@ void communicator::send(const char* dest, message* msg)
     if (msg->get_type() == message::LOAD)
         msg_size += opt::comm_cost(msg->get_amount());
     m_task_t task = MSG_task_create("message", 0.0, msg_size, msg);    
+    TRACE_msg_set_task_category(task,
+                                msg->get_type() == message::LOAD ?
+                                TRACE_CAT_DATA : TRACE_CAT_CTRL);
     msg_comm_t comm = MSG_task_isend(task, dest);
     sent_comm.push_back(comm);
 }
index 92e48827635c67a5f3c2b9ceef8e0502e635adab..b5ab711b38b32056dfa4122997b64a27bed2a4db 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -25,6 +25,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(main);
 #include "options.h"
 #include "process.h"
 #include "timer.h"
+#include "tracing.h"
 #include "version.h"
 
 namespace {
@@ -196,6 +197,11 @@ int main(int argc, char* argv[])
             MSG_launch_application(opt::deployment_file.c_str());
         }
 
+        // Register tracing categories
+        TRACE_category(TRACE_CAT_COMP);
+        TRACE_category(TRACE_CAT_CTRL);
+        TRACE_category(TRACE_CAT_DATA);
+
         exit_status = EXIT_FAILURE_SIMU; // =====
 
         // Launch the MSG simulation.
index 80fd618e2e2f2153af4b44269a771d89a41de88b..03c173432cbfee93576d6dfc6ca65909b6ab0da0 100644 (file)
@@ -11,6 +11,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(proc);
 
 #include "misc.h"
 #include "options.h"
+#include "tracing.h"
 
 #include "process.h"
 
@@ -196,6 +197,7 @@ void process::compute()
     if (load > 0.0) {
         double flops = opt::comp_cost(load);
         m_task_t task = MSG_task_create("computation", flops, 0.0, NULL);
+        TRACE_msg_set_task_category(task, TRACE_CAT_COMP);
         DEBUG2("compute %g flop%s", flops, ESSE(flops));
         MSG_task_execute(task);
         comp += flops;
diff --git a/tracing.h b/tracing.h
new file mode 100644 (file)
index 0000000..f283465
--- /dev/null
+++ b/tracing.h
@@ -0,0 +1,12 @@
+#ifndef TRACING_H
+#define TRACING_H
+
+#define TRACE_CAT_COMP "comp_task"
+#define TRACE_CAT_CTRL "ctrl_mesg"
+#define TRACE_CAT_DATA "data_mesg"
+
+#endif // !TRACING_H
+
+// Local variables:
+// mode: c++
+// End: