std::map<std::pair<NetPoint*, NetPoint*>, BypassRoute*> bypass_routes_; // src x dst -> route
routing::NetPoint* netpoint_ = nullptr; // Our representative in the father NetZone
+ resource::NetworkModel* network_model_;
protected:
explicit NetZoneImpl(NetZoneImpl* father, const std::string& name, resource::NetworkModel* network_model);
/* FIXME: protect the following fields once the construction madness is sorted out */
RoutingMode hierarchy_ = RoutingMode::unset;
- resource::NetworkModel* network_model_;
-
resource::NetworkModel* get_network_model() const { return network_model_; }
const s4u::NetZone* get_iface() const { return &piface_; }
s4u::NetZone* get_iface() { return &piface_; }
xbt_node_t node = nullptr;
/* Add the loopback if needed */
- if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) {
xbt_dynar_foreach (xbt_graph_get_nodes(route_graph_.get()), cursor, node) {
bool found = false;
xbt_edge_t edge = nullptr;
if (not found) {
auto* route = new simgrid::kernel::routing::RouteCreationArgs();
- route->link_list.push_back(network_model_->loopback_);
+ route->link_list.push_back(get_network_model()->loopback_);
xbt_graph_new_edge(route_graph_.get(), node, node, route);
}
}
init_tables(table_size);
/* Add the loopback if needed */
- if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
RouteCreationArgs* route = TO_FLOYD_LINK(i, i);
if (not route) {
route = new RouteCreationArgs();
- route->link_list.push_back(network_model_->loopback_);
+ route->link_list.push_back(get_network_model()->loopback_);
TO_FLOYD_LINK(i, i) = route;
TO_FLOYD_PRED(i, i) = i;
TO_FLOYD_COST(i, i) = 1;
routing_table_.resize(table_size * table_size, nullptr);
/* Add the loopback if needed */
- if (network_model_->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (get_network_model()->loopback_ && hierarchy_ == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
RouteCreationArgs* route = TO_ROUTE_FULL(i, i);
if (not route) {
route = new RouteCreationArgs();
- route->link_list.push_back(network_model_->loopback_);
+ route->link_list.push_back(get_network_model()->loopback_);
TO_ROUTE_FULL(i, i) = route;
}
}
std::string link_up = "link_" + netpoint->get_name() + "_UP";
std::string link_down = "link_" + netpoint->get_name() + "_DOWN";
resource::LinkImpl* linkUp =
- network_model_->create_link(link_up, std::vector<double>(1, bw_out), s4u::Link::SharingPolicy::SHARED);
+ get_network_model()->create_link(link_up, std::vector<double>(1, bw_out), s4u::Link::SharingPolicy::SHARED);
linkUp->seal();
resource::LinkImpl* linkDown =
- network_model_->create_link(link_down, std::vector<double>(1, bw_in), s4u::Link::SharingPolicy::SHARED);
+ get_network_model()->create_link(link_down, std::vector<double>(1, bw_in), s4u::Link::SharingPolicy::SHARED);
linkDown->seal();
private_links_.insert({netpoint->id(), {linkUp, linkDown}});
}
simgrid::kernel::resource::NetworkModel* netmodel =
current_routing == nullptr ? static_cast<simgrid::kernel::resource::NetworkModel*>(
models_by_type[simgrid::kernel::resource::Model::Type::NETWORK][0])
- : current_routing->network_model_;
+ : current_routing->get_network_model();
if (strcasecmp(zone->routing.c_str(), "Cluster") == 0) {
new_zone = new simgrid::kernel::routing::ClusterZone(current_routing, zone->id, netmodel);