Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
align the Link callbacks with the ones of Host
authorMartin Quinson <martin.quinson@loria.fr>
Mon, 13 Feb 2017 22:17:45 +0000 (23:17 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Mon, 13 Feb 2017 22:17:45 +0000 (23:17 +0100)
include/simgrid/s4u/Link.hpp
src/s4u/s4u_link.cpp
src/surf/instr_routing.cpp
src/surf/network_cm02.cpp
src/surf/network_interface.cpp
src/surf/ptask_L07.cpp

index af44cb4..8c2a9f4 100644 (file)
@@ -70,13 +70,13 @@ public:
 
   /* The signals */
   /** @brief Callback signal fired when a new Link is created */
 
   /* The signals */
   /** @brief Callback signal fired when a new Link is created */
-  static simgrid::xbt::signal<void(surf::LinkImpl*)> onCreation;
+  static simgrid::xbt::signal<void(s4u::Link&)> onCreation;
 
   /** @brief Callback signal fired when a Link is destroyed */
 
   /** @brief Callback signal fired when a Link is destroyed */
-  static simgrid::xbt::signal<void(surf::LinkImpl*)> onDestruction;
+  static simgrid::xbt::signal<void(s4u::Link&)> onDestruction;
 
   /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off) */
 
   /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off) */
-  static simgrid::xbt::signal<void(surf::LinkImpl*)> onStateChange;
+  static simgrid::xbt::signal<void(s4u::Link&)> onStateChange;
 
   /** @brief Callback signal fired when a communication starts */
   static simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> onCommunicate;
 
   /** @brief Callback signal fired when a communication starts */
   static simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> onCommunicate;
index 3f719e5..4fd78e8 100644 (file)
@@ -152,9 +152,9 @@ void Link::setLatencyTrace(tmgr_trace_t trace)
 /*************
  * Callbacks *
  *************/
 /*************
  * Callbacks *
  *************/
-simgrid::xbt::signal<void(surf::LinkImpl*)> Link::onCreation;
-simgrid::xbt::signal<void(surf::LinkImpl*)> Link::onDestruction;
-simgrid::xbt::signal<void(surf::LinkImpl*)> Link::onStateChange;
+simgrid::xbt::signal<void(s4u::Link&)> Link::onCreation;
+simgrid::xbt::signal<void(s4u::Link&)> Link::onDestruction;
+simgrid::xbt::signal<void(s4u::Link&)> Link::onStateChange;
 simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> Link::onCommunicate;
 simgrid::xbt::signal<void(surf::NetworkAction*)> Link::onCommunicationStateChange;
 }
 simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> Link::onCommunicate;
 simgrid::xbt::signal<void(surf::NetworkAction*)> Link::onCommunicationStateChange;
 }
index 00b2555..bc6274b 100644 (file)
@@ -206,16 +206,16 @@ void sg_instr_AS_end()
   }
 }
 
   }
 }
 
-static void instr_routing_parse_start_link(simgrid::surf::LinkImpl* link)
+static void instr_routing_parse_start_link(simgrid::s4u::Link& link)
 {
   if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback?
     return;
   container_t father = currentContainer.back();
 
 {
   if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback?
     return;
   container_t father = currentContainer.back();
 
-  double bandwidth_value = link->bandwidth();
-  double latency_value   = link->latency();
+  double bandwidth_value = link.bandwidth();
+  double latency_value   = link.latency();
 
 
-  container_t container = PJ_container_new(link->cname(), INSTR_LINK, father);
+  container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) {
     type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type);
 
   if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) {
     type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type);
index 51b26da..ace3af8 100644 (file)
@@ -401,7 +401,7 @@ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, doub
   if (policy == SURF_LINK_FATPIPE)
     lmm_constraint_shared(constraint());
 
   if (policy == SURF_LINK_FATPIPE)
     lmm_constraint_shared(constraint());
 
-  simgrid::s4u::Link::onCreation(this);
+  simgrid::s4u::Link::onCreation(this->piface_);
 }
 
 void NetworkCm02Link::apply_event(tmgr_trace_iterator_t triggered, double value)
 }
 
 void NetworkCm02Link::apply_event(tmgr_trace_iterator_t triggered, double value)
index 7f1e590..0414e74 100644 (file)
@@ -126,7 +126,7 @@ namespace simgrid {
     {
       if (!currentlyDestroying_) {
         currentlyDestroying_ = true;
     {
       if (!currentlyDestroying_) {
         currentlyDestroying_ = true;
-        s4u::Link::onDestruction(this);
+        s4u::Link::onDestruction(this->piface_);
         delete this;
       }
     }
         delete this;
       }
     }
@@ -155,14 +155,14 @@ namespace simgrid {
     {
       if (isOff()) {
         Resource::turnOn();
     {
       if (isOff()) {
         Resource::turnOn();
-        s4u::Link::onStateChange(this);
+        s4u::Link::onStateChange(this->piface_);
       }
     }
     void LinkImpl::turnOff()
     {
       if (isOn()) {
         Resource::turnOff();
       }
     }
     void LinkImpl::turnOff()
     {
       if (isOn()) {
         Resource::turnOff();
-        s4u::Link::onStateChange(this);
+        s4u::Link::onStateChange(this->piface_);
       }
     }
     void LinkImpl::setStateTrace(tmgr_trace_t trace)
       }
     }
     void LinkImpl::setStateTrace(tmgr_trace_t trace)
index 8e90e06..e691b00 100644 (file)
@@ -273,7 +273,7 @@ LinkL07::LinkL07(NetworkL07Model* model, const char* name, double bandwidth, dou
   if (policy == SURF_LINK_FATPIPE)
     lmm_constraint_shared(constraint());
 
   if (policy == SURF_LINK_FATPIPE)
     lmm_constraint_shared(constraint());
 
-  s4u::Link::onCreation(this);
+  s4u::Link::onCreation(this->piface_);
 }
 
 Action *CpuL07::execution_start(double size)
 }
 
 Action *CpuL07::execution_start(double size)