Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'depencencies' of https://framagit.org/simgrid/simgrid into depencencies
[simgrid.git] / include / simgrid / s4u / Activity.hpp
index ccdcea1..76d41c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2006-2019. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2006-2020. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -14,6 +14,8 @@
 #include <vector>
 #include <xbt/signal.hpp>
 
+XBT_LOG_EXTERNAL_CATEGORY(s4u_activity);
+
 namespace simgrid {
 namespace s4u {
 
@@ -89,7 +91,7 @@ private:
 
 template <class AnyActivity> class Activity_T : public Activity {
 private:
-  std::string name_             = "";
+  std::string name_             = "unnamed";
   std::string tracing_category_ = "";
   void* user_data_              = nullptr;
   std::atomic_int_fast32_t refcount_{0};
@@ -124,6 +126,7 @@ public:
   {
     while (has_successors()) {
       AnyActivity* b = get_successor();
+      XBT_CDEBUG(s4u_activity, "Remove a dependency from '%s' on '%s'", get_cname(), b->get_cname());
       b->remove_dependency_on(static_cast<AnyActivity*>(this));
       if (not b->has_dependencies()) {
         b->vetoable_start();
@@ -138,6 +141,7 @@ public:
     if (has_dependencies())
       return static_cast<AnyActivity*>(this);
     set_state(State::STARTED);
+    XBT_CDEBUG(s4u_activity, "All dependencies are solved, let's start '%s'", get_cname());
     static_cast<AnyActivity*>(this)->start();
     return static_cast<AnyActivity*>(this);
   }