Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 8 Jun 2017 19:27:18 +0000 (21:27 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 8 Jun 2017 19:27:18 +0000 (21:27 +0200)
include/simgrid/s4u/NetZone.hpp
src/s4u/s4u_netzone.cpp
src/surf/instr_routing.cpp
src/surf/sg_platf.cpp
src/surf/xml/platf_private.hpp

index 4dc88c3..fe9d878 100644 (file)
@@ -68,6 +68,7 @@ public:
                                    std::vector<surf::LinkImpl*>* link_list)>
       onRouteCreation;
   static simgrid::xbt::signal<void(NetZone&)> onCreation;
+  static simgrid::xbt::signal<void(NetZone&)> onSeal;
 
 protected:
   std::vector<kernel::routing::NetPoint*>
index 3886322..1eec476 100644 (file)
@@ -21,6 +21,7 @@ simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kern
                           std::vector<surf::LinkImpl*>* link_list)>
     NetZone::onRouteCreation;
 simgrid::xbt::signal<void(NetZone&)> NetZone::onCreation;
+simgrid::xbt::signal<void(NetZone&)> NetZone::onSeal;
 
 NetZone::NetZone(NetZone* father, const char* name) : father_(father), name_(xbt_strdup(name))
 {
index 4f4902a..ed350fe 100644 (file)
@@ -195,7 +195,7 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
   }
 }
 
-void sg_instr_AS_end()
+static void sg_instr_AS_end(simgrid::s4u::NetZone& /*netzone*/)
 {
   if (TRACE_needs_platform()){
     currentContainer.pop_back();
@@ -326,6 +326,7 @@ void instr_routing_define_callbacks ()
     simgrid::s4u::Host::onCreation.connect(sg_instr_new_host);
   }
   simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin);
+  simgrid::s4u::NetZone::onSeal.connect(sg_instr_AS_end);
 }
 
 /*
index f2be0fe..9079b8c 100644 (file)
@@ -677,10 +677,8 @@ void sg_platf_new_AS_seal()
 {
   xbt_assert(current_routing, "Cannot seal the current AS: none under construction");
   current_routing->seal();
-  current_routing = static_cast<simgrid::kernel::routing::NetZoneImpl*>(current_routing->father());
-
-  if (TRACE_is_enabled())
-    sg_instr_AS_end();
+  simgrid::s4u::NetZone::onSeal(*current_routing);
+  current_routing = static_cast<simgrid::kernel::routing::NetZoneImpl*>(current_routing->father()); 
 }
 
 /** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
index a5182d8..931f78a 100644 (file)
@@ -241,7 +241,6 @@ XBT_PUBLIC(int) surf_parse_lex_destroy();
 XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route);
 /********** Instr. **********/
 XBT_PRIVATE void sg_instr_new_router(const char* name);
-XBT_PRIVATE void sg_instr_AS_end();
 
 SG_END_DECL()