Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
end objectification of MSG tasks
[simgrid.git] / src / msg / msg_private.hpp
index 0f2c008..14384c6 100644 (file)
@@ -7,9 +7,11 @@
 #define MSG_PRIVATE_HPP
 
 #include "simgrid/msg.h"
-
 #include "src/kernel/activity/CommImpl.hpp"
 #include "src/kernel/activity/ExecImpl.hpp"
+#include <simgrid/modelchecker.h>
+
+static long long int msg_task_max_counter = 0;
 
 /**************** datatypes **********************************/
 namespace simgrid {
@@ -18,12 +20,16 @@ class Task {
   std::string name_             = "";
   std::string tracing_category_ = "";
   void* userdata_               = nullptr;
+  long long int counter_;
 
 public:
   ~Task();
   explicit Task(std::string name, double flops_amount, double bytes_amount, void* data)
       : name_(std::move(name)), userdata_(data), flops_amount(flops_amount), bytes_amount(bytes_amount)
   {
+    counter_ = msg_task_max_counter++;
+    if (MC_is_active())
+      MC_ignore_heap(&(counter_), sizeof(long long int));
   }
   void set_used();
   void set_not_used() { this->is_used = false; }
@@ -36,6 +42,7 @@ public:
   bool has_tracing_category() { return not tracing_category_.empty(); }
   void* get_user_data() { return userdata_; }
   void set_user_data(void* data) { userdata_ = data; }
+  long long int get_counter() { return counter_; }
 
   kernel::activity::ExecImplPtr compute          = nullptr; /* SIMIX modeling of computation */
   s4u::CommPtr comm                              = nullptr; /* S4U modeling of communication */