Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add some 'const' qualifiers.
[simgrid.git] / src / kernel / routing / NetZoneImpl.cpp
1 /* Copyright (c) 2006-2021. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
7 #include "simgrid/kernel/routing/NetPoint.hpp"
8 #include "simgrid/s4u/Engine.hpp"
9 #include "simgrid/s4u/Host.hpp"
10 #include "src/include/simgrid/sg_config.hpp"
11 #include "src/kernel/EngineImpl.hpp"
12 #include "src/kernel/resource/DiskImpl.hpp"
13 #include "src/surf/HostImpl.hpp"
14 #include "src/surf/cpu_interface.hpp"
15 #include "src/surf/network_interface.hpp"
16 #include "surf/surf.hpp"
17
18 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_route);
19
20 namespace simgrid {
21 namespace kernel {
22 namespace routing {
23
24 /* Pick the right models for CPU, net and host, and call their model_init_preparse */
25 static void surf_config_models_setup()
26 {
27   std::string host_model_name    = simgrid::config::get_value<std::string>("host/model");
28   std::string network_model_name = simgrid::config::get_value<std::string>("network/model");
29   std::string cpu_model_name     = simgrid::config::get_value<std::string>("cpu/model");
30   std::string disk_model_name    = simgrid::config::get_value<std::string>("disk/model");
31
32   /* The compound host model is needed when using non-default net/cpu models */
33   if ((not simgrid::config::is_default("network/model") || not simgrid::config::is_default("cpu/model")) &&
34       simgrid::config::is_default("host/model")) {
35     host_model_name = "compound";
36     simgrid::config::set_value("host/model", host_model_name);
37   }
38
39   XBT_DEBUG("host model: %s", host_model_name.c_str());
40   if (host_model_name == "compound") {
41     xbt_assert(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
42     xbt_assert(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
43
44     const auto* cpu_model = find_model_description(surf_cpu_model_description, cpu_model_name);
45     cpu_model->model_init_preparse();
46
47     const auto* network_model = find_model_description(surf_network_model_description, network_model_name);
48     network_model->model_init_preparse();
49   }
50
51   XBT_DEBUG("Call host_model_init");
52   const auto* host_model = find_model_description(surf_host_model_description, host_model_name);
53   host_model->model_init_preparse();
54
55   XBT_DEBUG("Call vm_model_init");
56   /* ideally we should get back the pointer to CpuModel from model_init_preparse(), but this
57    * requires changing the declaration of surf_cpu_model_description.
58    * To be reviewed in the future */
59   surf_vm_model_init_HL13(
60       simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get());
61
62   XBT_DEBUG("Call disk_model_init");
63   const auto* disk_model = find_model_description(surf_disk_model_description, disk_model_name);
64   disk_model->model_init_preparse();
65 }
66
67 NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
68 {
69   /* workaroud: first netzoneImpl will be the root netzone.
70    * Without globals and with current surf_*_model_description init functions, we need
71    * the root netzone to exist when creating the models.
72    * This was usually done at sg_platf.cpp, during XML parsing */
73   if (not s4u::Engine::get_instance()->get_netzone_root()) {
74     s4u::Engine::get_instance()->set_netzone_root(&piface_);
75     /* root netzone set, initialize models */
76     simgrid::s4u::Engine::on_platform_creation();
77
78     /* Initialize the surf models. That must be done after we got all config, and before we need the models.
79      * That is, after the last <config> tag, if any, and before the first of cluster|peer|zone|trace|trace_connect
80      *
81      * I'm not sure for <trace> and <trace_connect>, there may be a bug here
82      * (FIXME: check it out by creating a file beginning with one of these tags)
83      * but cluster and peer come down to zone creations, so putting this verification here is correct.
84      */
85     surf_config_models_setup();
86   }
87
88   xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(get_name()),
89              "Refusing to create a second NetZone called '%s'.", get_cname());
90   netpoint_ = new NetPoint(name_, NetPoint::Type::NetZone);
91   XBT_DEBUG("NetZone '%s' created with the id '%u'", get_cname(), netpoint_->id());
92   _sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
93                             * any further config now that we created some real content */
94   simgrid::s4u::NetZone::on_creation(piface_); // notify the signal
95 }
96
97 NetZoneImpl::~NetZoneImpl()
98 {
99   for (auto const& nz : children_)
100     delete nz;
101
102   for (auto const& kv : bypass_routes_)
103     delete kv.second;
104
105   s4u::Engine::get_instance()->netpoint_unregister(netpoint_);
106 }
107
108 void NetZoneImpl::add_child(NetZoneImpl* new_zone)
109 {
110   xbt_assert(not sealed_, "Cannot add a new child to the sealed zone %s", get_cname());
111   /* set the father behavior */
112   hierarchy_ = RoutingMode::recursive;
113   children_.push_back(new_zone);
114 }
115
116 /** @brief Returns the list of the hosts found in this NetZone (not recursively)
117  *
118  * Only the hosts that are directly contained in this NetZone are retrieved,
119  * not the ones contained in sub-netzones.
120  */
121 std::vector<s4u::Host*> NetZoneImpl::get_all_hosts() const
122 {
123   std::vector<s4u::Host*> res;
124   for (auto const& card : get_vertices()) {
125     s4u::Host* host = s4u::Host::by_name_or_null(card->get_name());
126     if (host != nullptr)
127       res.push_back(host);
128   }
129   return res;
130 }
131 int NetZoneImpl::get_host_count() const
132 {
133   int count = 0;
134   for (auto const& card : get_vertices()) {
135     const s4u::Host* host = s4u::Host::by_name_or_null(card->get_name());
136     if (host != nullptr)
137       count++;
138   }
139   return count;
140 }
141
142 s4u::Host* NetZoneImpl::create_host(const std::string& name, const std::vector<double>& speed_per_pstate)
143 {
144   xbt_assert(cpu_model_pm_,
145              "Impossible to create host: %s. Invalid CPU model: nullptr. Have you set the parent of this NetZone: %s?",
146              name.c_str(), get_cname());
147   auto* res = (new surf::HostImpl(name))->get_iface();
148   res->set_netpoint((new NetPoint(name, NetPoint::Type::Host))->set_englobing_zone(this));
149
150   cpu_model_pm_->create_cpu(res, speed_per_pstate);
151
152   return res;
153 }
154
155 s4u::Link* NetZoneImpl::create_link(const std::string& name, const std::vector<double>& bandwidths)
156 {
157   xbt_assert(
158       network_model_,
159       "Impossible to create link: %s. Invalid network model: nullptr. Have you set the parent of this NetZone: %s?",
160       name.c_str(), get_cname());
161   return network_model_->create_link(name, bandwidths)->get_iface();
162 }
163
164 s4u::Disk* NetZoneImpl::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
165 {
166   xbt_assert(disk_model_,
167              "Impossible to create disk: %s. Invalid disk model: nullptr. Have you set the parent of this NetZone: %s?",
168              name.c_str(), get_cname());
169   auto* l = disk_model_->create_disk(name, read_bandwidth, write_bandwidth);
170
171   return l->get_iface();
172 }
173
174 NetPoint* NetZoneImpl::create_router(const std::string& name)
175 {
176   xbt_assert(nullptr == s4u::Engine::get_instance()->netpoint_by_name_or_null(name),
177              "Refusing to create a router named '%s': this name already describes a node.", name.c_str());
178
179   return (new NetPoint(name, NetPoint::Type::Router))->set_englobing_zone(this);
180 }
181 int NetZoneImpl::add_component(NetPoint* elm)
182 {
183   vertices_.push_back(elm);
184   return vertices_.size() - 1; // The rank of the newly created object
185 }
186
187 void NetZoneImpl::add_route(NetPoint* /*src*/, NetPoint* /*dst*/, NetPoint* /*gw_src*/, NetPoint* /*gw_dst*/,
188                             const std::vector<resource::LinkImpl*>& /*link_list_*/, bool /*symmetrical*/)
189 {
190   xbt_die("NetZone '%s' does not accept new routes (wrong class).", get_cname());
191 }
192
193 void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
194                                    std::vector<resource::LinkImpl*>& link_list_, bool /* symmetrical */)
195 {
196   /* Argument validity checks */
197   if (gw_dst) {
198     XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->get_cname(), gw_src->get_cname(), dst->get_cname(),
199               gw_dst->get_cname());
200     xbt_assert(not link_list_.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
201                gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
202     xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
203                "The bypass route between %s@%s and %s@%s already exists.", src->get_cname(), gw_src->get_cname(),
204                dst->get_cname(), gw_dst->get_cname());
205   } else {
206     XBT_DEBUG("Load bypassRoute from %s to %s", src->get_cname(), dst->get_cname());
207     xbt_assert(not link_list_.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
208                dst->get_cname());
209     xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
210                "The bypass route between %s and %s already exists.", src->get_cname(), dst->get_cname());
211   }
212
213   /* Build a copy that will be stored in the dict */
214   auto* newRoute = new BypassRoute(gw_src, gw_dst);
215   for (auto const& link : link_list_)
216     newRoute->links.push_back(link);
217
218   /* Store it */
219   bypass_routes_.insert({{src, dst}, newRoute});
220 }
221
222 /** @brief Get the common ancestor and its first children in each line leading to src and dst
223  *
224  * In the recursive case, this sets common_ancestor, src_ancestor and dst_ancestor are set as follows.
225  * @verbatim
226  *         platform root
227  *               |
228  *              ...                <- possibly long path
229  *               |
230  *         common_ancestor
231  *           /        \
232  *          /          \
233  *         /            \          <- direct links
234  *        /              \
235  *       /                \
236  *  src_ancestor     dst_ancestor  <- must be different in the recursive case
237  *      |                   |
238  *     ...                 ...     <-- possibly long paths (one hop or more)
239  *      |                   |
240  *     src                 dst
241  *  @endverbatim
242  *
243  *  In the base case (when src and dst are in the same netzone), things are as follows:
244  *  @verbatim
245  *                  platform root
246  *                        |
247  *                       ...                      <-- possibly long path
248  *                        |
249  * common_ancestor==src_ancestor==dst_ancestor    <-- all the same value
250  *                   /        \
251  *                  /          \                  <-- direct links (exactly one hop)
252  *                 /            \
253  *              src              dst
254  *  @endverbatim
255  *
256  * A specific recursive case occurs when src is the ancestor of dst. In this case,
257  * the base case routing should be used so the common_ancestor is specifically set
258  * to src_ancestor==dst_ancestor.
259  * Naturally, things are completely symmetrical if dst is the ancestor of src.
260  * @verbatim
261  *            platform root
262  *                  |
263  *                 ...                <-- possibly long path
264  *                  |
265  *  src == src_ancestor==dst_ancestor==common_ancestor <-- same value
266  *                  |
267  *                 ...                <-- possibly long path (one hop or more)
268  *                  |
269  *                 dst
270  *  @endverbatim
271  */
272 static void find_common_ancestors(const NetPoint* src, const NetPoint* dst,
273                                   /* OUT */ NetZoneImpl** common_ancestor, NetZoneImpl** src_ancestor,
274                                   NetZoneImpl** dst_ancestor)
275 {
276   /* Deal with the easy base case */
277   if (src->get_englobing_zone() == dst->get_englobing_zone()) {
278     *common_ancestor = src->get_englobing_zone();
279     *src_ancestor    = *common_ancestor;
280     *dst_ancestor    = *common_ancestor;
281     return;
282   }
283
284   /* engage the full recursive search */
285
286   /* (1) find the path to root of src and dst*/
287   const NetZoneImpl* src_as = src->get_englobing_zone();
288   const NetZoneImpl* dst_as = dst->get_englobing_zone();
289
290   xbt_assert(src_as, "Host %s must be in a netzone", src->get_cname());
291   xbt_assert(dst_as, "Host %s must be in a netzone", dst->get_cname());
292
293   /* (2) find the path to the root routing component */
294   std::vector<NetZoneImpl*> path_src;
295   NetZoneImpl* current = src->get_englobing_zone();
296   while (current != nullptr) {
297     path_src.push_back(current);
298     current = current->get_parent();
299   }
300   std::vector<NetZoneImpl*> path_dst;
301   current = dst->get_englobing_zone();
302   while (current != nullptr) {
303     path_dst.push_back(current);
304     current = current->get_parent();
305   }
306
307   /* (3) find the common father.
308    * Before that, index_src and index_dst may be different, they both point to nullptr in path_src/path_dst
309    * So we move them down simultaneously as long as they point to the same content.
310    *
311    * This works because all SimGrid platform have a unique root element (that is the last element of both paths).
312    */
313   NetZoneImpl* father = nullptr; // the netzone we dropped on the previous loop iteration
314   while (path_src.size() > 1 && path_dst.size() > 1 && path_src.back() == path_dst.back()) {
315     father = path_src.back();
316     path_src.pop_back();
317     path_dst.pop_back();
318   }
319
320   /* (4) we found the difference at least. Finalize the returned values */
321   *src_ancestor = path_src.back();                  /* the first different father of src */
322   *dst_ancestor = path_dst.back();                  /* the first different father of dst */
323   if (*src_ancestor == *dst_ancestor) {             // src is the ancestor of dst, or the contrary
324     *common_ancestor = *src_ancestor;
325   } else {
326     xbt_assert(father != nullptr);
327     *common_ancestor = father;
328   }
329 }
330
331 /* PRECONDITION: this is the common ancestor of src and dst */
332 bool NetZoneImpl::get_bypass_route(const NetPoint* src, const NetPoint* dst,
333                                    /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency,
334                                    std::unordered_set<NetZoneImpl*>& netzones)
335 {
336   // If never set a bypass route return nullptr without any further computations
337   if (bypass_routes_.empty())
338     return false;
339
340   /* Base case, no recursion is needed */
341   if (dst->get_englobing_zone() == this && src->get_englobing_zone() == this) {
342     if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) {
343       const BypassRoute* bypassedRoute = bypass_routes_.at({src, dst});
344       for (resource::LinkImpl* const& link : bypassedRoute->links) {
345         links.push_back(link);
346         if (latency)
347           *latency += link->get_latency();
348       }
349       XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links", src->get_cname(), dst->get_cname(),
350                 bypassedRoute->links.size());
351       return true;
352     }
353     return false;
354   }
355
356   /* Engage recursive search */
357
358   /* (1) find the path to the root routing component */
359   std::vector<NetZoneImpl*> path_src;
360   NetZoneImpl* current = src->get_englobing_zone();
361   while (current != nullptr) {
362     path_src.push_back(current);
363     current = current->parent_;
364   }
365
366   std::vector<NetZoneImpl*> path_dst;
367   current = dst->get_englobing_zone();
368   while (current != nullptr) {
369     path_dst.push_back(current);
370     current = current->parent_;
371   }
372
373   /* (2) find the common father */
374   while (path_src.size() > 1 && path_dst.size() > 1 && path_src.back() == path_dst.back()) {
375     path_src.pop_back();
376     path_dst.pop_back();
377   }
378
379   /* (3) Search for a bypass making the path up to the ancestor useless */
380   const BypassRoute* bypassedRoute = nullptr;
381   std::pair<kernel::routing::NetPoint*, kernel::routing::NetPoint*> key;
382   // Search for a bypass with the given indices. Returns true if found. Initialize variables `bypassedRoute' and `key'.
383   auto lookup = [&bypassedRoute, &key, &path_src, &path_dst, this](unsigned src_index, unsigned dst_index) {
384     if (src_index < path_src.size() && dst_index < path_dst.size()) {
385       key      = {path_src[src_index]->netpoint_, path_dst[dst_index]->netpoint_};
386       auto bpr = bypass_routes_.find(key);
387       if (bpr != bypass_routes_.end()) {
388         bypassedRoute = bpr->second;
389         return true;
390       }
391     }
392     return false;
393   };
394
395   for (unsigned max = 0, max_index = std::max(path_src.size(), path_dst.size()); max < max_index; max++) {
396     for (unsigned i = 0; i < max; i++) {
397       if (lookup(i, max) || lookup(max, i))
398         break;
399     }
400     if (bypassedRoute || lookup(max, max))
401       break;
402   }
403
404   /* (4) If we have the bypass, use it. If not, caller will do the Right Thing. */
405   if (bypassedRoute) {
406     XBT_DEBUG("Found a bypass route from '%s' to '%s' with %zu links. We may have to complete it with recursive "
407               "calls to getRoute",
408               src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
409     if (src != key.first)
410       get_global_route_with_netzones(src, bypassedRoute->gw_src, links, latency, netzones);
411     for (resource::LinkImpl* const& link : bypassedRoute->links) {
412       links.push_back(link);
413       if (latency)
414         *latency += link->get_latency();
415     }
416     if (dst != key.second)
417       get_global_route_with_netzones(bypassedRoute->gw_dst, dst, links, latency, netzones);
418     return true;
419   }
420   XBT_DEBUG("No bypass route from '%s' to '%s'.", src->get_cname(), dst->get_cname());
421   return false;
422 }
423
424 void NetZoneImpl::get_global_route(const NetPoint* src, const NetPoint* dst,
425                                    /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency)
426 {
427   std::unordered_set<NetZoneImpl*> netzones;
428   get_global_route_with_netzones(src, dst, links, latency, netzones);
429 }
430
431 void NetZoneImpl::get_global_route_with_netzones(const NetPoint* src, const NetPoint* dst,
432                                                  /* OUT */ std::vector<resource::LinkImpl*>& links, double* latency,
433                                                  std::unordered_set<NetZoneImpl*>& netzones)
434 {
435   Route route;
436
437   XBT_DEBUG("Resolve route from '%s' to '%s'", src->get_cname(), dst->get_cname());
438
439   /* Find how src and dst are interconnected */
440   NetZoneImpl* common_ancestor;
441   NetZoneImpl* src_ancestor;
442   NetZoneImpl* dst_ancestor;
443   find_common_ancestors(src, dst, &common_ancestor, &src_ancestor, &dst_ancestor);
444   XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->get_cname(),
445             src_ancestor->get_cname(), dst_ancestor->get_cname());
446
447   netzones.insert(src->get_englobing_zone());
448   netzones.insert(dst->get_englobing_zone());
449   netzones.insert(common_ancestor);
450   /* Check whether a direct bypass is defined. If so, use it and bail out */
451   if (common_ancestor->get_bypass_route(src, dst, links, latency, netzones))
452     return;
453
454   /* If src and dst are in the same netzone, life is good */
455   if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */
456     route.link_list_ = std::move(links);
457     common_ancestor->get_local_route(src, dst, &route, latency);
458     links = std::move(route.link_list_);
459     return;
460   }
461
462   /* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */
463   common_ancestor->get_local_route(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
464   xbt_assert((route.gw_src_ != nullptr) && (route.gw_dst_ != nullptr), "Bad gateways for route from '%s' to '%s'.",
465              src->get_cname(), dst->get_cname());
466
467   /* If source gateway is not our source, we have to recursively find our way up to this point */
468   if (src != route.gw_src_)
469     get_global_route_with_netzones(src, route.gw_src_, links, latency, netzones);
470   links.insert(links.end(), begin(route.link_list_), end(route.link_list_));
471
472   /* If dest gateway is not our destination, we have to recursively find our way from this point */
473   if (route.gw_dst_ != dst)
474     get_global_route_with_netzones(route.gw_dst_, dst, links, latency, netzones);
475 }
476
477 void NetZoneImpl::seal()
478 {
479   /* already sealed netzone */
480   if (sealed_)
481     return;
482   do_seal(); // derived class' specific sealing procedure
483
484   /* seals sub-netzones and hosts */
485   for (auto* host : get_all_hosts()) {
486     host->seal();
487   }
488   for (auto* sub_net : get_children()) {
489     sub_net->seal();
490   }
491   sealed_ = true;
492   s4u::NetZone::on_seal(piface_);
493 }
494
495 void NetZoneImpl::set_parent(NetZoneImpl* parent)
496 {
497   xbt_assert(not sealed_, "Impossible to set parent to an already sealed NetZone(%s)", this->get_cname());
498   parent_ = parent;
499   netpoint_->set_englobing_zone(parent_);
500   if (parent) {
501     /* adding this class as child */
502     parent->add_child(this);
503     /* copying models from parent host, to be reviewed when we allow multi-models */
504     set_network_model(parent->get_network_model());
505     set_cpu_pm_model(parent->get_cpu_pm_model());
506     set_cpu_vm_model(parent->get_cpu_vm_model());
507     set_disk_model(parent->get_disk_model());
508     set_host_model(parent->get_host_model());
509   }
510 }
511
512 void NetZoneImpl::set_network_model(std::shared_ptr<resource::NetworkModel> netmodel)
513 {
514   xbt_assert(not sealed_, "Impossible to set network model to an already sealed NetZone(%s)", this->get_cname());
515   network_model_ = std::move(netmodel);
516 }
517
518 void NetZoneImpl::set_cpu_vm_model(std::shared_ptr<resource::CpuModel> cpu_model)
519 {
520   xbt_assert(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
521   cpu_model_vm_ = std::move(cpu_model);
522 }
523
524 void NetZoneImpl::set_cpu_pm_model(std::shared_ptr<resource::CpuModel> cpu_model)
525 {
526   xbt_assert(not sealed_, "Impossible to set CPU model to an already sealed NetZone(%s)", this->get_cname());
527   cpu_model_pm_ = std::move(cpu_model);
528 }
529
530 void NetZoneImpl::set_disk_model(std::shared_ptr<resource::DiskModel> disk_model)
531 {
532   xbt_assert(not sealed_, "Impossible to set disk model to an already sealed NetZone(%s)", this->get_cname());
533   disk_model_ = std::move(disk_model);
534 }
535
536 void NetZoneImpl::set_host_model(std::shared_ptr<surf::HostModel> host_model)
537 {
538   xbt_assert(not sealed_, "Impossible to set host model to an already sealed NetZone(%s)", this->get_cname());
539   host_model_ = std::move(host_model);
540 }
541
542 const NetZoneImpl* NetZoneImpl::get_netzone_recursive(const NetPoint* netpoint) const
543 {
544   xbt_assert(netpoint && netpoint->is_netzone(), "Netpoint %s must be of the type NetZone",
545              netpoint ? netpoint->get_cname() : "nullptr");
546
547   if (netpoint == netpoint_)
548     return this;
549
550   for (auto* children : children_) {
551     const NetZoneImpl* netzone = children->get_netzone_recursive(netpoint);
552     if (netzone)
553       return netzone;
554   }
555   return nullptr;
556 }
557
558 bool NetZoneImpl::is_component_recursive(const NetPoint* netpoint) const
559 {
560   /* check direct components */
561   for (const auto* elem : vertices_) {
562     if (elem == netpoint)
563       return true;
564   }
565   /* check childrens */
566   for (const auto* children : children_) {
567     if (children->is_component_recursive(netpoint))
568       return true;
569   }
570   return false;
571 }
572 } // namespace routing
573 } // namespace kernel
574 } // namespace simgrid