return private_links_.find(position) != private_links_.end();
}
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
void get_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* nodes,
std::map<std::string, xbt_edge_t, std::less<>>* edges) override;
xbt_node_t route_graph_new_node(int id);
xbt_node_t node_map_search(int id);
- void new_edge(int src_id, int dst_id, RouteCreationArgs* e_route);
+ void new_edge(int src_id, int dst_id, Route* e_route);
void do_seal() override;
public:
* After this function returns, any node in the graph
* will have a loopback attached to it.
*/
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat) override;
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
};
};
explicit DragonflyZone(const std::string& name);
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
/**
* @brief Parse topology parameters from string format
*
public:
explicit EmptyZone(const std::string& name) : NetZoneImpl(name) {}
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override
{
/* There can't be route in an Empty zone */
}
FatTreeZone(const FatTreeZone&) = delete;
FatTreeZone& operator=(const FatTreeZone&) = delete;
~FatTreeZone() override;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
/**
* @brief Parse the topology parameters from string format
/* vars to compute the Floyd algorithm. */
std::vector<int> predecessor_table_;
std::vector<double> cost_table_;
- std::vector<RouteCreationArgs*> link_table_;
+ std::vector<Route*> link_table_;
void init_tables(unsigned int table_size);
void do_seal() override;
FloydZone& operator=(const FloydZone&) = delete;
~FloydZone() override;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
};
* computational requirements, but also the highest memory requirements (both in platform file and in memory).
*/
class XBT_PRIVATE FullZone : public RoutedZone {
+ std::vector<Route*> routing_table_;
+ void do_seal() override;
+
public:
using RoutedZone::RoutedZone;
FullZone(const FullZone&) = delete;
FullZone& operator=(const FullZone) = delete;
~FullZone() override;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
void add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
const std::vector<resource::LinkImpl*>& link_list, bool symmetrical) override;
-
-private:
- std::vector<RouteCreationArgs*> routing_table_;
- void do_seal() override;
};
} // namespace routing
} // namespace kernel
namespace kernel {
namespace routing {
+class Route {
+public:
+ Route() = default;
+ explicit Route(NetPoint* src, NetPoint* dst, NetPoint* gwSrc, NetPoint* gwDst)
+ : src_(src), dst_(dst), gw_src_(gwSrc), gw_dst_(gwDst)
+ {
+ }
+ NetPoint* src_ = nullptr;
+ NetPoint* dst_ = nullptr;
+ NetPoint* gw_src_ = nullptr;
+ NetPoint* gw_dst_ = nullptr;
+ std::vector<resource::LinkImpl*> link_list_;
+};
+
class BypassRoute {
public:
explicit BypassRoute(NetPoint* gwSrc, NetPoint* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
* @param into Container into which the traversed links and gateway information should be pushed
* @param latency Accumulator in which the latencies should be added (caller must set it to 0)
*/
- virtual void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) = 0;
+ virtual void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) = 0;
/** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
/* returns whether we found a bypass path */
bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
/** @ingroup ROUTING_API
* @brief NetZone with an explicit routing (abstract class)
*
- * This abstract class factorizes code between its subclasses: Full, Dijkstra and Floyd.
+ * This abstract class factors code between its subclasses: Full, Dijkstra and Floyd.
*
* <table>
* <caption>Comparison of the RoutedZone subclasses</caption>
std::map<std::string, xbt_edge_t, std::less<>>* edges) override;
protected:
- RouteCreationArgs* new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
- const std::vector<resource::LinkImpl*>& link_list, bool preserve_order);
- XBT_ATTRIB_DEPRECATED_v330("Please drop 2nd, 3rd and 7th parameters") virtual RouteCreationArgs* new_extended_route(
+ Route* new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
+ const std::vector<resource::LinkImpl*>& link_list, bool preserve_order);
+ XBT_ATTRIB_DEPRECATED_v330("Please drop 2nd, 3rd and 7th parameters") virtual Route* new_extended_route(
RoutingMode hierarchy, NetPoint* /* src */, NetPoint* /* dst */, NetPoint* gw_src, NetPoint* gw_dst,
std::vector<resource::LinkImpl*>& link_list, bool /* symmetrical */, bool preserve_order)
{
public:
explicit StarZone(const std::string& name);
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* latency) override;
void get_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* nodes,
std::map<std::string, xbt_edge_t, std::less<>>* edges) override;
bool has_links_down() const { return links_down_set; }
};
/** @brief Auxiliary method to add links to a route */
- void add_links_to_route(const std::vector<resource::LinkImpl*>& links, RouteCreationArgs* route, double* latency,
+ void add_links_to_route(const std::vector<resource::LinkImpl*>& links, Route* route, double* latency,
std::unordered_set<resource::LinkImpl*>& added_links) const;
/** @brief Auxiliary methods to check params received in add_route method */
void check_add_route_param(const NetPoint* src, const NetPoint* dst, const NetPoint* gw_src, const NetPoint* gw_dst,
public:
using ClusterZone::ClusterZone;
void create_links(int id, int rank, unsigned int position);
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
void set_topology(const std::vector<unsigned int>& dimensions);
/** @brief Convert topology parameters from string to vector of uint */
public:
using StarZone::StarZone;
void set_peer_link(NetPoint* netpoint, double bw_in, double bw_out);
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
};
namespace vivaldi {
WifiZone(const WifiZone&) = delete;
WifiZone& operator=(const WifiZone) = delete;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
s4u::Link* create_link(const std::string& name, const std::vector<double>& bandwidths) override;
NetPoint* get_access_point() const { return access_point_; }
};
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp" // FIXME: RouteCreationArgs and friends
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
private_links_.insert({position, link});
}
-void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void ClusterZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
{
XBT_VERB("cluster getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
xbt_assert(not private_links_.empty(),
XBT_WARN("Routing from a cluster private router to itself is meaningless");
} else {
std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos(src->id()));
- route->link_list.push_back(info.first);
+ route->link_list_.push_back(info.first);
if (lat)
*lat += info.first->get_latency();
}
if (not src->is_router()) { // No private link for the private router
if (has_limiter_) { // limiter for sender
std::pair<resource::LinkImpl*, resource::LinkImpl*> info = private_links_.at(node_pos_with_loopback(src->id()));
- route->link_list.push_back(info.first);
+ route->link_list_.push_back(info.first);
}
std::pair<resource::LinkImpl*, resource::LinkImpl*> info =
private_links_.at(node_pos_with_loopback_limiter(src->id()));
if (info.first) { // link up
- route->link_list.push_back(info.first);
+ route->link_list_.push_back(info.first);
if (lat)
*lat += info.first->get_latency();
}
}
if (backbone_) {
- route->link_list.push_back(backbone_);
+ route->link_list_.push_back(backbone_);
if (lat)
*lat += backbone_->get_latency();
}
private_links_.at(node_pos_with_loopback_limiter(dst->id()));
if (info.second) { // link down
- route->link_list.push_back(info.second);
+ route->link_list_.push_back(info.second);
if (lat)
*lat += info.second->get_latency();
}
if (has_limiter_) { // limiter for receiver
info = private_links_.at(node_pos_with_loopback(dst->id()));
- route->link_list.push_back(info.first);
+ route->link_list_.push_back(info.first);
}
}
}
#include "simgrid/kernel/routing/DijkstraZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
#include "xbt/string.hpp"
void DijkstraZone::route_graph_delete(xbt_graph_t g)
{
xbt_graph_free_graph(
- g, [](void* n) { delete static_cast<simgrid::kernel::routing::GraphNodeData*>(n); },
- [](void* e) { delete static_cast<simgrid::kernel::routing::RouteCreationArgs*>(e); }, nullptr);
+ g, [](void* n) { delete static_cast<GraphNodeData*>(n); }, [](void* e) { delete static_cast<Route*>(e); },
+ nullptr);
}
void DijkstraZone::do_seal()
}
if (not found) {
- auto* route = new simgrid::kernel::routing::RouteCreationArgs();
- route->link_list.push_back(get_network_model()->loopback_);
+ auto* route = new Route();
+ route->link_list_.push_back(get_network_model()->loopback_);
xbt_graph_new_edge(route_graph_.get(), node, node, route);
}
}
/* Parsing */
-void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void DijkstraZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
{
get_route_check_params(src, dst);
int src_id = src->id();
if (edge == nullptr)
throw std::invalid_argument(xbt::string_printf("No route from '%s' to '%s'", src->get_cname(), dst->get_cname()));
- const RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
+ const Route* e_route = static_cast<Route*>(xbt_graph_edge_get_data(edge));
- for (auto const& link : e_route->link_list) {
- route->link_list.insert(route->link_list.begin(), link);
+ for (auto const& link : e_route->link_list_) {
+ route->link_list_.insert(route->link_list_.begin(), link);
if (lat)
*lat += link->get_latency();
}
const s_xbt_node_t* u_node = xbt_graph_edge_get_target(edge);
const GraphNodeData* data = static_cast<GraphNodeData*>(xbt_graph_node_get_data(u_node));
int u_id = data->graph_id_;
- const RouteCreationArgs* tmp_e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
- int cost_v_u = tmp_e_route->link_list.size(); /* count of links, old model assume 1 */
+ const Route* tmp_e_route = static_cast<Route*>(xbt_graph_edge_get_data(edge));
+ int cost_v_u = tmp_e_route->link_list_.size(); /* count of links, old model assume 1 */
if (cost_v_u + cost_arr[v_id] < cost_arr[u_id]) {
pred_arr[u_id] = v_id;
if (edge == nullptr)
throw std::invalid_argument(xbt::string_printf("No route from '%s' to '%s'", src->get_cname(), dst->get_cname()));
- const RouteCreationArgs* e_route = static_cast<RouteCreationArgs*>(xbt_graph_edge_get_data(edge));
+ const Route* e_route = static_cast<Route*>(xbt_graph_edge_get_data(edge));
const NetPoint* prev_gw_src = gw_src;
- gw_src = e_route->gw_src;
- NetPoint* gw_dst = e_route->gw_dst;
+ gw_src = e_route->gw_src_;
+ NetPoint* gw_dst = e_route->gw_dst_;
if (v == dst_node_id)
first_gw = gw_dst;
NetPoint* gw_dst_net_elm = nullptr;
NetPoint* prev_gw_src_net_elm = nullptr;
get_global_route(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, nullptr);
- auto pos = route->link_list.begin();
+ auto pos = route->link_list_.begin();
for (auto const& link : e_route_as_to_as) {
- route->link_list.insert(pos, link);
+ route->link_list_.insert(pos, link);
if (lat)
*lat += link->get_latency();
pos++;
}
}
- for (auto const& link : e_route->link_list) {
- route->link_list.insert(route->link_list.begin(), link);
+ for (auto const& link : e_route->link_list_) {
+ route->link_list_.insert(route->link_list_.begin(), link);
if (lat)
*lat += link->get_latency();
}
}
if (get_hierarchy() == RoutingMode::recursive) {
- route->gw_src = gw_src;
- route->gw_dst = first_gw;
+ route->gw_src_ = gw_src;
+ route->gw_dst_ = first_gw;
}
if (not cached_)
}
void DijkstraZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+ const std::vector<resource::LinkImpl*>& link_list_, bool symmetrical)
{
- add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
+ add_route_check_params(src, dst, gw_src, gw_dst, link_list_, symmetrical);
- new_edge(src->id(), dst->id(), new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, true));
+ new_edge(src->id(), dst->id(), new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list_, true));
if (symmetrical)
- new_edge(dst->id(), src->id(), new_extended_route(get_hierarchy(), gw_dst, gw_src, link_list, false));
+ new_edge(dst->id(), src->id(), new_extended_route(get_hierarchy(), gw_dst, gw_src, link_list_, false));
}
-void DijkstraZone::new_edge(int src_id, int dst_id, RouteCreationArgs* route)
+void DijkstraZone::new_edge(int src_id, int dst_id, Route* route)
{
XBT_DEBUG("Create Route from '%d' to '%d'", src_id, dst_id);
// Make sure that this graph edge was not already added to the graph
if (xbt_graph_get_edge(route_graph_.get(), src, dst) != nullptr) {
- if (route->gw_dst == nullptr || route->gw_src == nullptr)
+ if (route->gw_dst_ == nullptr || route->gw_src_ == nullptr)
throw std::invalid_argument(
- xbt::string_printf("Route from %s to %s already exists", route->src->get_cname(), route->dst->get_cname()));
+ xbt::string_printf("Route from %s to %s already exists", route->src_->get_cname(), route->dst_->get_cname()));
else
throw std::invalid_argument(xbt::string_printf("Route from %s@%s to %s@%s already exists",
- route->src->get_cname(), route->gw_src->get_cname(),
- route->dst->get_cname(), route->gw_dst->get_cname()));
+ route->src_->get_cname(), route->gw_src_->get_cname(),
+ route->dst_->get_cname(), route->gw_dst_->get_cname()));
}
// Finally add it
#include "simgrid/kernel/routing/DragonflyZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
boost::split(parameters, topo_parameters, boost::is_any_of(";"));
if (parameters.size() != 4)
- surf_parse_error(
- "Dragonfly are defined by the number of groups, chassis per groups, blades per chassis, nodes per blade");
+ xbt_die("Dragonfly are defined by the number of groups, chassis per groups, blades per chassis, nodes per blade");
// Blue network : number of groups, number of links between each group
boost::split(tmp, parameters[0], boost::is_any_of(","));
if (tmp.size() != 2)
- surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
+ xbt_die("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
unsigned int n_groups;
try {
// Black network : number of chassis/group, number of links between each router on the black network
boost::split(tmp, parameters[1], boost::is_any_of(","));
if (tmp.size() != 2)
- surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
+ xbt_die("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
unsigned int n_chassis;
try {
// Green network : number of blades/chassis, number of links between each router on the green network
boost::split(tmp, parameters[2], boost::is_any_of(","));
if (tmp.size() != 2)
- surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
+ xbt_die("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
unsigned int n_routers;
try {
}
}
-void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency)
+void DragonflyZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* latency)
{
// Minimal routing version.
// TODO : non-minimal random one, and adaptive ?
if ((src->id() == dst->id()) && has_loopback()) {
resource::LinkImpl* uplink = get_uplink_from(node_pos(src->id()));
- route->link_list.push_back(uplink);
+ route->link_list_.push_back(uplink);
if (latency)
*latency += uplink->get_latency();
return;
DragonflyRouter* currentRouter = myRouter;
// node->router local link
- route->link_list.push_back(myRouter->my_nodes_[myCoords.node * num_links_per_link_]);
+ route->link_list_.push_back(myRouter->my_nodes_[myCoords.node * num_links_per_link_]);
if (latency)
*latency += myRouter->my_nodes_[myCoords.node * num_links_per_link_]->get_latency();
if (has_limiter()) { // limiter for sender
- route->link_list.push_back(get_uplink_from(node_pos_with_loopback(src->id())));
+ route->link_list_.push_back(get_uplink_from(node_pos_with_loopback(src->id())));
}
if (targetRouter != myRouter) {
// go to the router of our group connected to this one.
if (currentRouter->blade_ != targetCoords.group) {
// go to the nth router in our chassis
- route->link_list.push_back(currentRouter->green_links_[targetCoords.group]);
+ route->link_list_.push_back(currentRouter->green_links_[targetCoords.group]);
if (latency)
*latency += currentRouter->green_links_[targetCoords.group]->get_latency();
currentRouter = &routers_[myCoords.group * (num_chassis_per_group_ * num_blades_per_chassis_) +
if (currentRouter->chassis_ != 0) {
// go to the first chassis of our group
- route->link_list.push_back(currentRouter->black_links_[0]);
+ route->link_list_.push_back(currentRouter->black_links_[0]);
if (latency)
*latency += currentRouter->black_links_[0]->get_latency();
currentRouter =
}
// go to destination group - the only optical hop
- route->link_list.push_back(currentRouter->blue_link_);
+ route->link_list_.push_back(currentRouter->blue_link_);
if (latency)
*latency += currentRouter->blue_link_->get_latency();
currentRouter =
// same group, but same blade ?
if (targetRouter->blade_ != currentRouter->blade_) {
- route->link_list.push_back(currentRouter->green_links_[targetCoords.blade]);
+ route->link_list_.push_back(currentRouter->green_links_[targetCoords.blade]);
if (latency)
*latency += currentRouter->green_links_[targetCoords.blade]->get_latency();
currentRouter =
// same blade, but same chassis ?
if (targetRouter->chassis_ != currentRouter->chassis_) {
- route->link_list.push_back(currentRouter->black_links_[targetCoords.chassis]);
+ route->link_list_.push_back(currentRouter->black_links_[targetCoords.chassis]);
if (latency)
*latency += currentRouter->black_links_[targetCoords.chassis]->get_latency();
}
}
if (has_limiter()) { // limiter for receiver
- route->link_list.push_back(get_downlink_to(node_pos_with_loopback(dst->id())));
+ route->link_list_.push_back(get_downlink_to(node_pos_with_loopback(dst->id())));
}
// router->node local link
- route->link_list.push_back(
+ route->link_list_.push_back(
targetRouter->my_nodes_[targetCoords.node * num_links_per_link_ + num_links_per_link_ - 1]);
if (latency)
*latency +=
targetRouter->my_nodes_[targetCoords.node * num_links_per_link_ + num_links_per_link_ - 1]->get_latency();
// set gateways (if any)
- route->gw_src = get_gateway(src->id());
- route->gw_dst = get_gateway(dst->id());
+ route->gw_src_ = get_gateway(src->id());
+ route->gw_dst_ = get_gateway(dst->id());
}
} // namespace routing
} // namespace kernel
return true;
}
-void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency)
+void FatTreeZone::get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency)
{
if (dst->is_router() || src->is_router())
return;
/* In case destination is the source, and there is a loopback, let's use it instead of going up to a switch */
if (source->id == destination->id && has_loopback()) {
- into->link_list.push_back(source->loopback_);
+ into->link_list_.push_back(source->loopback_);
if (latency)
*latency += source->loopback_->get_latency();
return;
int k = this->num_parents_per_node_[currentNode->level];
d = d % k;
- into->link_list.push_back(currentNode->parents[d]->up_link_);
+ into->link_list_.push_back(currentNode->parents[d]->up_link_);
if (latency)
*latency += currentNode->parents[d]->up_link_->get_latency();
if (currentNode->limiter_link_)
- into->link_list.push_back(currentNode->limiter_link_);
+ into->link_list_.push_back(currentNode->limiter_link_);
currentNode = currentNode->parents[d]->up_node_;
}
while (currentNode != destination) {
for (unsigned int i = 0; i < currentNode->children.size(); i++) {
if (i % this->num_children_per_node_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
- into->link_list.push_back(currentNode->children[i]->down_link_);
+ into->link_list_.push_back(currentNode->children[i]->down_link_);
if (latency)
*latency += currentNode->children[i]->down_link_->get_latency();
currentNode = currentNode->children[i]->down_node_;
if (currentNode->limiter_link_)
- into->link_list.push_back(currentNode->limiter_link_);
+ into->link_list_.push_back(currentNode->limiter_link_);
XBT_DEBUG("%d(%u,%u) is accessible through %d(%u,%u)", destination->id, destination->level,
destination->position, currentNode->id, currentNode->level, currentNode->position);
}
}
}
// set gateways (if any)
- into->gw_src = get_gateway(src->id());
- into->gw_dst = get_gateway(dst->id());
+ into->gw_src_ = get_gateway(src->id());
+ into->gw_dst_ = get_gateway(dst->id());
}
/* This function makes the assumption that parse_specific_arguments() and
#include "simgrid/kernel/routing/FloydZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
#include "xbt/string.hpp"
}
}
-void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void FloydZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
{
unsigned int table_size = get_table_size();
get_route_check_params(src, dst);
/* create a result route */
- std::vector<RouteCreationArgs*> route_stack;
+ std::vector<Route*> route_stack;
unsigned int cur = dst->id();
do {
int pred = TO_FLOYD_PRED(src->id(), cur);
} while (cur != src->id());
if (get_hierarchy() == RoutingMode::recursive) {
- route->gw_src = route_stack.back()->gw_src;
- route->gw_dst = route_stack.front()->gw_dst;
+ route->gw_src_ = route_stack.back()->gw_src_;
+ route->gw_dst_ = route_stack.front()->gw_dst_;
}
NetPoint* prev_dst_gw = nullptr;
while (not route_stack.empty()) {
- const RouteCreationArgs* e_route = route_stack.back();
+ const Route* e_route = route_stack.back();
route_stack.pop_back();
if (get_hierarchy() == RoutingMode::recursive && prev_dst_gw != nullptr &&
- prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) {
- get_global_route(prev_dst_gw, e_route->gw_src, route->link_list, lat);
+ prev_dst_gw->get_cname() != e_route->gw_src_->get_cname()) {
+ get_global_route(prev_dst_gw, e_route->gw_src_, route->link_list_, lat);
}
- for (auto const& link : e_route->link_list) {
- route->link_list.push_back(link);
+ for (auto const& link : e_route->link_list_) {
+ route->link_list_.push_back(link);
if (lat)
*lat += link->get_latency();
}
- prev_dst_gw = e_route->gw_dst;
+ prev_dst_gw = e_route->gw_dst_;
}
}
void FloydZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- const std::vector<resource::LinkImpl*>& link_list, bool symmetrical)
+ const std::vector<resource::LinkImpl*>& link_list_, bool symmetrical)
{
/* set the size of table routing */
unsigned int table_size = get_table_size();
init_tables(table_size);
- add_route_check_params(src, dst, gw_src, gw_dst, link_list, symmetrical);
+ add_route_check_params(src, dst, gw_src, gw_dst, link_list_, symmetrical);
/* Check that the route does not already exist */
if (gw_dst && gw_src) // netzone route (to adapt the error message, if any)
"The route between %s and %s already exists (Rq: routes are symmetrical by default).", src->get_cname(),
dst->get_cname());
- TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, true);
+ TO_FLOYD_LINK(src->id(), dst->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list_, true);
TO_FLOYD_PRED(src->id(), dst->id()) = src->id();
- TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list.size();
+ TO_FLOYD_COST(src->id(), dst->id()) = (TO_FLOYD_LINK(src->id(), dst->id()))->link_list_.size();
if (symmetrical) {
if (gw_dst && gw_src) // netzone route (to adapt the error message, if any)
XBT_DEBUG("Load NetzoneRoute from \"%s(%s)\" to \"%s(%s)\"", dst->get_cname(), gw_src->get_cname(),
src->get_cname(), gw_dst->get_cname());
- TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list, false);
+ TO_FLOYD_LINK(dst->id(), src->id()) = new_extended_route(get_hierarchy(), gw_src, gw_dst, link_list_, false);
TO_FLOYD_PRED(dst->id(), src->id()) = dst->id();
TO_FLOYD_COST(dst->id(), src->id()) =
- (TO_FLOYD_LINK(dst->id(), src->id()))->link_list.size(); /* count of links, old model assume 1 */
+ (TO_FLOYD_LINK(dst->id(), src->id()))->link_list_.size(); /* count of links, old model assume 1 */
}
}
/* Add the loopback if needed */
if (get_network_model()->loopback_ && get_hierarchy() == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
- RouteCreationArgs* route = TO_FLOYD_LINK(i, i);
+ Route* route = TO_FLOYD_LINK(i, i);
if (not route) {
- route = new RouteCreationArgs();
- route->link_list.push_back(get_network_model()->loopback_);
+ route = new Route();
+ 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;
#include "simgrid/kernel/routing/FullZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
/* Add the loopback if needed */
if (get_network_model()->loopback_ && get_hierarchy() == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
- RouteCreationArgs* route = TO_ROUTE_FULL(i, i);
+ Route* route = TO_ROUTE_FULL(i, i);
if (not route) {
- route = new RouteCreationArgs();
- route->link_list.push_back(get_network_model()->loopback_);
+ route = new Route();
+ route->link_list_.push_back(get_network_model()->loopback_);
TO_ROUTE_FULL(i, i) = route;
}
}
delete route;
}
-void FullZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat)
+void FullZone::get_local_route(NetPoint* src, NetPoint* dst, Route* res, double* lat)
{
XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
unsigned int table_size = get_table_size();
- const RouteCreationArgs* e_route = TO_ROUTE_FULL(src->id(), dst->id());
+ const Route* e_route = TO_ROUTE_FULL(src->id(), dst->id());
if (e_route != nullptr) {
- res->gw_src = e_route->gw_src;
- res->gw_dst = e_route->gw_dst;
- for (auto const& link : e_route->link_list) {
- res->link_list.push_back(link);
+ res->gw_src_ = e_route->gw_src_;
+ res->gw_dst_ = e_route->gw_dst_;
+ for (auto const& link : e_route->link_list_) {
+ res->link_list_.push_back(link);
if (lat)
*lat += link->get_latency();
}
#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_route);
}
void NetZoneImpl::add_route(NetPoint* /*src*/, NetPoint* /*dst*/, NetPoint* /*gw_src*/, NetPoint* /*gw_dst*/,
- const std::vector<resource::LinkImpl*>& /*link_list*/, bool /*symmetrical*/)
+ const std::vector<resource::LinkImpl*>& /*link_list_*/, bool /*symmetrical*/)
{
xbt_die("NetZone '%s' does not accept new routes (wrong class).", get_cname());
}
void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<resource::LinkImpl*>& link_list, bool /* symmetrical */)
+ std::vector<resource::LinkImpl*>& link_list_, bool /* symmetrical */)
{
/* Argument validity checks */
if (gw_dst) {
XBT_DEBUG("Load bypassNetzoneRoute from %s@%s to %s@%s", src->get_cname(), gw_src->get_cname(), dst->get_cname(),
gw_dst->get_cname());
- xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
+ xbt_assert(not link_list_.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->get_cname(),
gw_src->get_cname(), dst->get_cname(), gw_dst->get_cname());
xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
"The bypass route between %s@%s and %s@%s already exists.", src->get_cname(), gw_src->get_cname(),
dst->get_cname(), gw_dst->get_cname());
} else {
XBT_DEBUG("Load bypassRoute from %s to %s", src->get_cname(), dst->get_cname());
- xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
+ xbt_assert(not link_list_.empty(), "Bypass route between %s and %s cannot be empty.", src->get_cname(),
dst->get_cname());
xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(),
"The bypass route between %s and %s already exists.", src->get_cname(), dst->get_cname());
/* Build a copy that will be stored in the dict */
auto* newRoute = new BypassRoute(gw_src, gw_dst);
- for (auto const& link : link_list)
+ for (auto const& link : link_list_)
newRoute->links.push_back(link);
/* Store it */
void NetZoneImpl::get_global_route(NetPoint* src, NetPoint* dst,
/* OUT */ std::vector<resource::LinkImpl*>& links, double* latency)
{
- RouteCreationArgs route;
+ Route route;
XBT_DEBUG("Resolve route from '%s' to '%s'", src->get_cname(), dst->get_cname());
/* If src and dst are in the same netzone, life is good */
if (src_ancestor == dst_ancestor) { /* SURF_ROUTING_BASE */
- route.link_list = std::move(links);
+ route.link_list_ = std::move(links);
common_ancestor->get_local_route(src, dst, &route, latency);
- links = std::move(route.link_list);
+ links = std::move(route.link_list_);
return;
}
/* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */
common_ancestor->get_local_route(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
- xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "Bad gateways for route from '%s' to '%s'.",
+ xbt_assert((route.gw_src_ != nullptr) && (route.gw_dst_ != nullptr), "Bad gateways for route from '%s' to '%s'.",
src->get_cname(), dst->get_cname());
/* If source gateway is not our source, we have to recursively find our way up to this point */
- if (src != route.gw_src)
- get_global_route(src, route.gw_src, links, latency);
- links.insert(links.end(), begin(route.link_list), end(route.link_list));
+ if (src != route.gw_src_)
+ get_global_route(src, route.gw_src_, links, latency);
+ links.insert(links.end(), begin(route.link_list_), end(route.link_list_));
/* If dest gateway is not our destination, we have to recursively find our way from this point */
- if (route.gw_dst != dst)
- get_global_route(route.gw_dst, dst, links, latency);
+ if (route.gw_dst_ != dst)
+ get_global_route(route.gw_dst_, dst, links, latency);
}
void NetZoneImpl::seal()
#include "simgrid/kernel/routing/RoutedZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "xbt/dict.h"
#include "xbt/graph.h"
#include "xbt/log.h"
if (my_src == my_dst)
continue;
- RouteCreationArgs route;
+ Route route;
get_local_route(my_src, my_dst, &route, nullptr);
const char* previous_name;
const char* current_name;
- if (route.gw_src) {
- previous = new_xbt_graph_node(graph, route.gw_src->get_cname(), nodes);
- previous_name = route.gw_src->get_cname();
+ if (route.gw_src_) {
+ previous = new_xbt_graph_node(graph, route.gw_src_->get_cname(), nodes);
+ previous_name = route.gw_src_->get_cname();
} else {
previous = new_xbt_graph_node(graph, my_src->get_cname(), nodes);
previous_name = my_src->get_cname();
}
- for (auto const& link : route.link_list) {
+ for (auto const& link : route.link_list_) {
const char* link_name = link->get_cname();
current = new_xbt_graph_node(graph, link_name, nodes);
current_name = link_name;
previous_name = current_name;
}
- if (route.gw_dst) {
- current = new_xbt_graph_node(graph, route.gw_dst->get_cname(), nodes);
- current_name = route.gw_dst->get_cname();
+ if (route.gw_dst_) {
+ current = new_xbt_graph_node(graph, route.gw_dst_->get_cname(), nodes);
+ current_name = route.gw_dst_->get_cname();
} else {
current = new_xbt_graph_node(graph, my_dst->get_cname(), nodes);
current_name = my_dst->get_cname();
/* ************************************************************************** */
/* ************************* GENERIC AUX FUNCTIONS ************************** */
/* change a route containing link names into a route containing link entities */
-RouteCreationArgs* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
- const std::vector<resource::LinkImpl*>& link_list,
- bool preserve_order)
+Route* RoutedZone::new_extended_route(RoutingMode hierarchy, NetPoint* gw_src, NetPoint* gw_dst,
+ const std::vector<resource::LinkImpl*>& link_list, bool preserve_order)
{
- auto* result = new RouteCreationArgs();
+ auto* result = new Route();
if (hierarchy == RoutingMode::recursive) {
xbt_assert(gw_src && gw_dst, "nullptr is obviously a deficient gateway");
- result->gw_src = gw_src;
- result->gw_dst = gw_dst;
+ result->gw_src_ = gw_src;
+ result->gw_dst_ = gw_dst;
}
if (preserve_order)
- result->link_list = link_list;
+ result->link_list_ = link_list;
else
- result->link_list.assign(link_list.rbegin(), link_list.rend()); // reversed
- result->link_list.shrink_to_fit();
+ result->link_list_.assign(link_list.rbegin(), link_list.rend()); // reversed
+ result->link_list_.shrink_to_fit();
return result;
}
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp" // RouteCreationArgs and friends
#include "xbt/string.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_star, surf, "Routing part of surf");
namespace routing {
StarZone::StarZone(const std::string& name) : NetZoneImpl(name) {}
-void StarZone::add_links_to_route(const std::vector<resource::LinkImpl*>& links, RouteCreationArgs* route,
- double* latency, std::unordered_set<resource::LinkImpl*>& added_links) const
+void StarZone::add_links_to_route(const std::vector<resource::LinkImpl*>& links, Route* route, double* latency,
+ std::unordered_set<resource::LinkImpl*>& added_links) const
{
for (auto* link : links) {
- /* do not add duplicated links in route->link_list */
+ /* do not add duplicated links in route->link_list_ */
if (not added_links.insert(link).second)
continue;
if (latency)
*latency += link->get_latency();
- route->link_list.push_back(link);
+ route->link_list_.push_back(link);
}
}
-void StarZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* latency)
+void StarZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* latency)
{
XBT_VERB("StarZone getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(),
dst->id());
/* going DOWN */
add_links_to_route(dst_route.links_down, route, latency, added_links);
/* gateways */
- route->gw_src = src_route.gateway;
- route->gw_dst = dst_route.gateway;
+ route->gw_src_ = src_route.gateway;
+ route->gw_dst_ = dst_route.gateway;
}
void StarZone::get_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* nodes,
}
void StarZone::add_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- const std::vector<kernel::resource::LinkImpl*>& link_list, bool symmetrical)
+ const std::vector<kernel::resource::LinkImpl*>& link_list_, bool symmetrical)
{
check_add_route_param(src, dst, gw_src, gw_dst, symmetrical);
- s4u::NetZone::on_route_creation(symmetrical, gw_src, gw_dst, gw_src, gw_dst, link_list);
+ s4u::NetZone::on_route_creation(symmetrical, gw_src, gw_dst, gw_src, gw_dst, link_list_);
/* loopback */
if (src == dst) {
- routes_[src->id()].loopback = link_list;
+ routes_[src->id()].loopback = link_list_;
} else {
/* src to everyone */
if (src) {
auto& route = routes_[src->id()];
- route.links_up = link_list;
+ route.links_up = link_list_;
route.gateway = gw_src;
route.links_up_set = true;
if (symmetrical) {
/* reverse it for down/symmetrical links */
- route.links_down.assign(link_list.rbegin(), link_list.rend());
+ route.links_down.assign(link_list_.rbegin(), link_list_.rend());
route.links_down_set = true;
}
}
/* dst to everyone */
if (dst) {
auto& route = routes_[dst->id()];
- route.links_down = link_list;
+ route.links_down = link_list_;
route.gateway = gw_dst;
route.links_down_set = true;
}
#include "simgrid/s4u/Host.hpp"
#include "simgrid/s4u/NetZone.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp" // RouteCreationArgs and friends
namespace {
class EngineWrapper {
zone->add_route(host1->get_netpoint(), nullptr, nullptr, nullptr, links, true);
zone->add_route(nullptr, host2->get_netpoint(), nullptr, nullptr, links2, false);
double lat;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(host2->get_netpoint(), host1->get_netpoint(), &route, &lat);
}
zone->add_route(host1->get_netpoint(), nullptr, nullptr, nullptr, links, false);
zone->add_route(host2->get_netpoint(), nullptr, nullptr, nullptr, links2, true);
double lat;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(host2->get_netpoint(), host1->get_netpoint(), &route, &lat);
}
}
zone->seal();
double lat = 0.0;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(host1->get_netpoint(), host2->get_netpoint(), &route, &lat);
REQUIRE(lat == 30);
- REQUIRE(route.gw_src == nullptr);
- REQUIRE(route.gw_dst == nullptr);
- REQUIRE(route.link_list.size() == 2);
- REQUIRE(route.link_list[0]->get_name() == "link1");
- REQUIRE(route.link_list[1]->get_name() == "link2");
+ REQUIRE(route.gw_src_ == nullptr);
+ REQUIRE(route.gw_dst_ == nullptr);
+ REQUIRE(route.link_list_.size() == 2);
+ REQUIRE(route.link_list_[0]->get_name() == "link1");
+ REQUIRE(route.link_list_[1]->get_name() == "link2");
}
SECTION("Get route: shared link(backbone)")
zone->seal();
double lat = 0.0;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(host1->get_netpoint(), host2->get_netpoint(), &route, &lat);
REQUIRE(lat == 130);
- REQUIRE(route.link_list.size() == 3);
- REQUIRE(route.link_list[0]->get_name() == "link1");
- REQUIRE(route.link_list[1]->get_name() == "backbone");
- REQUIRE(route.link_list[2]->get_name() == "link2");
+ REQUIRE(route.link_list_.size() == 3);
+ REQUIRE(route.link_list_[0]->get_name() == "link1");
+ REQUIRE(route.link_list_[1]->get_name() == "backbone");
+ REQUIRE(route.link_list_[2]->get_name() == "link2");
}
SECTION("Get route: loopback")
zone->seal();
double lat = 0.0;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(host1->get_netpoint(), host1->get_netpoint(), &route, &lat);
REQUIRE(lat == 110);
- REQUIRE(route.link_list.size() == 2);
- REQUIRE(route.link_list[0]->get_name() == "link1");
- REQUIRE(route.link_list[1]->get_name() == "backbone");
+ REQUIRE(route.link_list_.size() == 2);
+ REQUIRE(route.link_list_[0]->get_name() == "link1");
+ REQUIRE(route.link_list_[1]->get_name() == "backbone");
}
}
zone->seal();
double lat = 0.0;
- simgrid::kernel::routing::RouteCreationArgs route;
+ simgrid::kernel::routing::Route route;
zone->get_local_route(subzone1, subzone2, &route, &lat);
REQUIRE(lat == 30);
- REQUIRE(route.gw_src == router1);
- REQUIRE(route.gw_dst == router2);
- REQUIRE(route.link_list.size() == 2);
- REQUIRE(route.link_list[0]->get_name() == "link1");
- REQUIRE(route.link_list[1]->get_name() == "link2");
+ REQUIRE(route.gw_src_ == router1);
+ REQUIRE(route.gw_dst_ == router2);
+ REQUIRE(route.link_list_.size() == 2);
+ REQUIRE(route.link_list_[0]->get_name() == "link1");
+ REQUIRE(route.link_list_[1]->get_name() == "link2");
}
}
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
* Parse attribute dimensions="dim1,dim2,dim3,...,dimN" and save them into a vector.
* Additionally, we need to know how many ranks we have in total
*/
- std::transform(begin(dimensions_str), end(dimensions_str), std::back_inserter(dimensions), surf_parse_get_int);
+ std::transform(begin(dimensions_str), end(dimensions_str), std::back_inserter(dimensions),
+ [](const std::string& s) { return std::stoi(s); });
}
return dimensions;
}
set_num_links_per_node(dimensions_.size());
}
-void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
{
XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (src->id() == dst->id() && has_loopback()) {
resource::LinkImpl* uplink = get_uplink_from(node_pos(src->id()));
- route->link_list.push_back(uplink);
+ route->link_list_.push_back(uplink);
if (lat)
*lat += uplink->get_latency();
return;
}
if (has_limiter()) { // limiter for sender
- route->link_list.push_back(get_uplink_from(node_pos_with_loopback(current_node)));
+ route->link_list_.push_back(get_uplink_from(node_pos_with_loopback(current_node)));
}
resource::LinkImpl* lnk;
else
lnk = get_downlink_to(linkOffset);
- route->link_list.push_back(lnk);
+ route->link_list_.push_back(lnk);
if (lat)
*lat += lnk->get_latency();
current_node = next_node;
}
// set gateways (if any)
- route->gw_src = get_gateway(src->id());
- route->gw_dst = get_gateway(dst->id());
+ route->gw_src_ = get_gateway(src->id());
+ route->gw_dst_ = get_gateway(dst->id());
}
} // namespace routing
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
#include <boost/algorithm/string.hpp>
add_route(nullptr, netpoint, nullptr, nullptr, {linkDown->get_impl()}, false);
}
-void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, Route* route, double* lat)
{
XBT_DEBUG("vivaldi getLocalRoute from '%s'[%u] '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (src->is_netzone()) {
std::string srcName = "router_" + src->get_name();
std::string dstName = "router_" + dst->get_name();
- route->gw_src = s4u::Engine::get_instance()->netpoint_by_name_or_null(srcName);
- route->gw_dst = s4u::Engine::get_instance()->netpoint_by_name_or_null(dstName);
+ route->gw_src_ = s4u::Engine::get_instance()->netpoint_by_name_or_null(srcName);
+ route->gw_dst_ = s4u::Engine::get_instance()->netpoint_by_name_or_null(dstName);
}
StarZone::get_local_route(src, dst, route, lat);
#include "simgrid/kernel/routing/WifiZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/surf/xml/platf_private.hpp"
#include "surf/surf.hpp"
#include <unordered_set>
}
}
-void WifiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* res, double* lat)
+void WifiZone::get_local_route(NetPoint* src, NetPoint* dst, Route* res, double* lat)
{
XBT_DEBUG("full getLocalRoute from %s[%u] to %s[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (src != access_point_) {
XBT_DEBUG("src %s is not our gateway", src->get_cname());
- res->link_list.push_back(wifi_link_);
+ res->link_list_.push_back(wifi_link_);
if (lat)
*lat += wifi_link_->get_latency();
}
if (dst != access_point_) {
XBT_DEBUG("dst %s is not our gateway", dst->get_cname());
- res->link_list.push_back(wifi_link_);
+ res->link_list_.push_back(wifi_link_);
if (lat)
*lat += wifi_link_->get_latency();
}