explicit ClusterZone(NetZone* father, std::string name);
void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
- void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges) override;
+ void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges) override;
virtual void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position);
virtual void parse_specific_arguments(ClusterCreationArgs* cluster)
/* There can't be route in an Empty zone */
}
- void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* /*nodes*/,
- std::map<std::string, xbt_edge_t>* /*edges*/) override;
+ void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* /*nodes*/,
+ std::map<std::string, xbt_edge_t>* /*edges*/) override;
};
} // namespace routing
} // namespace kernel
public:
/** @brief Make an host within that NetZone */
- simgrid::s4u::Host* createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
- std::map<std::string, std::string>* props);
+ simgrid::s4u::Host* create_host(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
+ std::map<std::string, std::string>* props);
/** @brief Creates a new route in this NetZone */
- void addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
+ void add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+ std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) override;
protected:
/**
virtual void getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* 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 getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
+ bool get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
+ /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
public:
/* @brief get the route between two nodes in the full platform
* @param links Accumulator in which all traversed links should be pushed (caller must empty it)
* @param latency Accumulator in which the latencies should be added (caller must set it to 0)
*/
- static void getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
+ static void get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
+ /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency);
- virtual void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges) = 0;
+ virtual void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges) = 0;
enum class RoutingMode {
unset = 0, /**< Undefined type */
base, /**< Base case: use simple link lists for routing */
public:
explicit RoutedZone(NetZone* father, std::string name);
- void getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges) override;
+ void get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges) override;
virtual RouteCreationArgs* newExtendedRoute(RoutingMode hierarchy, NetPoint* src, NetPoint* dst, NetPoint* gw_src,
NetPoint* gw_dst, std::vector<simgrid::surf::LinkImpl*>& link_list,
bool symmetrical, bool change_order);
virtual void addRoute(kernel::routing::NetPoint * src, kernel::routing::NetPoint * dst,
kernel::routing::NetPoint * gw_src, kernel::routing::NetPoint * gw_dst,
std::vector<simgrid::surf::LinkImpl*> & link_list, bool symmetrical);
- virtual void addBypassRoute(kernel::routing::NetPoint * src, kernel::routing::NetPoint * dst,
- kernel::routing::NetPoint * gw_src, kernel::routing::NetPoint * gw_dst,
- std::vector<simgrid::surf::LinkImpl*> & link_list, bool symmetrical) = 0;
+ virtual void add_bypass_route(kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
+ kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
+ std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical) = 0;
/*** Called on each newly created regular route (not on bypass routes) */
static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
xbt_die("Element '%s' not found!",dst);
std::vector<simgrid::surf::LinkImpl*> route;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, route, nullptr);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(src_elm, dst_elm, route, nullptr);
for (auto const& link : route)
instr_user_variable(time, link->get_cname(), variable, father_type, value, what, nullptr, &user_link_variables);
}
}
}
-void ClusterZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges)
+void ClusterZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges)
{
xbt_assert(router_,
"Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
NetPoint* gw_dst_net_elm = nullptr;
NetPoint* prev_gw_src_net_elm = nullptr;
- getGlobalRoute(gw_dst_net_elm, prev_gw_src_net_elm, e_route_as_to_as, 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();
for (auto const& link : e_route_as_to_as) {
route->link_list.insert(pos, link);
EmptyZone::~EmptyZone() = default;
-void EmptyZone::getGraph(xbt_graph_t /*graph*/, std::map<std::string, xbt_node_t>* /*nodes*/,
- std::map<std::string, xbt_edge_t>* /*edges*/)
+void EmptyZone::get_graph(xbt_graph_t /*graph*/, std::map<std::string, xbt_node_t>* /*nodes*/,
+ std::map<std::string, xbt_edge_t>* /*edges*/)
{
XBT_ERROR("No routing no graph");
}
route_stack.pop_back();
if (hierarchy_ == RoutingMode::recursive && prev_dst_gw != nullptr &&
prev_dst_gw->get_cname() != e_route->gw_src->get_cname()) {
- getGlobalRoute(prev_dst_gw, e_route->gw_src, route->link_list, lat);
+ get_global_route(prev_dst_gw, e_route->gw_src, route->link_list, lat);
}
for (auto const& link : e_route->link_list) {
simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_);
}
-simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
- std::map<std::string, std::string>* props)
+simgrid::s4u::Host* NetZoneImpl::create_host(const char* name, std::vector<double>* speedPerPstate, int coreAmount,
+ std::map<std::string, std::string>* props)
{
simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
return res;
}
-void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
- std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
+void NetZoneImpl::add_bypass_route(NetPoint* src, NetPoint* dst, NetPoint* gw_src, NetPoint* gw_dst,
+ std::vector<simgrid::surf::LinkImpl*>& link_list, bool symmetrical)
{
/* Argument validity checks */
if (gw_dst) {
}
/* PRECONDITION: this is the common ancestor of src and dst */
-bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
+bool NetZoneImpl::get_bypass_route(routing::NetPoint* src, routing::NetPoint* dst,
+ /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
{
// If never set a bypass route return nullptr without any further computations
if (bypass_routes_.empty())
"calls to getRoute",
src->get_cname(), dst->get_cname(), bypassedRoute->links.size());
if (src != key.first)
- getGlobalRoute(src, bypassedRoute->gw_src, links, latency);
+ get_global_route(src, bypassedRoute->gw_src, links, latency);
for (surf::LinkImpl* const& link : bypassedRoute->links) {
links.push_back(link);
if (latency)
*latency += link->latency();
}
if (dst != key.second)
- getGlobalRoute(bypassedRoute->gw_dst, dst, links, latency);
+ get_global_route(bypassedRoute->gw_dst, dst, links, latency);
return true;
}
XBT_DEBUG("No bypass route from '%s' to '%s'.", src->get_cname(), dst->get_cname());
return false;
}
-void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
+void NetZoneImpl::get_global_route(routing::NetPoint* src, routing::NetPoint* dst,
+ /* OUT */ std::vector<surf::LinkImpl*>& links, double* latency)
{
RouteCreationArgs route;
src_ancestor->get_cname(), dst_ancestor->get_cname());
/* Check whether a direct bypass is defined. If so, use it and bail out */
- if (common_ancestor->getBypassRoute(src, dst, links, latency))
+ if (common_ancestor->get_bypass_route(src, dst, links, latency))
return;
/* If src and dst are in the same netzone, life is good */
/* If source gateway is not our source, we have to recursively find our way up to this point */
if (src != route.gw_src)
- getGlobalRoute(src, route.gw_src, links, latency);
+ get_global_route(src, route.gw_src, links, latency);
for (auto const& link : route.link_list)
links.push_back(link);
/* If dest gateway is not our destination, we have to recursively find our way from this point */
if (route.gw_dst != dst)
- getGlobalRoute(route.gw_dst, dst, links, latency);
+ get_global_route(route.gw_dst, dst, links, latency);
}
}
}
{
}
-void RoutedZone::getGraph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
- std::map<std::string, xbt_edge_t>* edges)
+void RoutedZone::get_graph(xbt_graph_t graph, std::map<std::string, xbt_node_t>* nodes,
+ std::map<std::string, xbt_edge_t>* edges)
{
std::vector<kernel::routing::NetPoint*> vertices = getVertices();
/** @brief Just like Host::routeTo, but filling an array of link implementations */
void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>& links, double* latency)
{
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", get_cname(), dest->get_cname(),
(latency == nullptr ? -1 : *latency));
std::map<std::string, xbt_node_t>* nodes = new std::map<std::string, xbt_node_t>;
std::map<std::string, xbt_edge_t>* edges = new std::map<std::string, xbt_edge_t>;
- static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+ static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
for (auto elm : *edges) {
xbt_edge_t edge = elm.second;
linkContainers(simgrid::instr::Container::byName(static_cast<const char*>(edge->src->data)),
}
}
- static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
+ static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->get_graph(graph, nodes, edges);
}
xbt_graph_t instr_routing_platform_graph ()
}
simgrid::s4u::Host* host =
- routing_get_current()->createHost(args->id, &args->speed_per_pstate, args->core_amount, &props);
+ routing_get_current()->create_host(args->id, &args->speed_per_pstate, args->core_amount, &props);
host->pimpl_->storage_ = mount_list;
mount_list.clear();
void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassRoute)
{
- routing_get_current()->addBypassRoute(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst,
- bypassRoute->link_list, bypassRoute->symmetrical);
+ routing_get_current()->add_bypass_route(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst,
+ bypassRoute->link_list, bypassRoute->symmetrical);
}
void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
std::vector<double> speedPerPstate;
speedPerPstate.push_back(peer->speed);
- simgrid::s4u::Host* host = as->createHost(peer->id.c_str(), &speedPerPstate, 1, nullptr);
+ simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), &speedPerPstate, 1, nullptr);
as->setPeerLink(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);
simgrid::s4u::Host* host2 = hosts[it_dst];
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
if (not route.empty()) {
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->get_cname(), host2->get_cname());
for (auto const& link : route)
if (netcardDst->is_router()) {
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->get_cname(), netcardDst->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, route, nullptr);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(netcardSrc, netcardDst, route, nullptr);
for (auto const& link : route)
std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
if (value2->is_router()) {
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->get_cname(), value2->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, value2, route, nullptr);
for (auto const& link : route)
std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->get_cname(), host2->get_cname());
std::vector<simgrid::surf::LinkImpl*> route;
simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, route, nullptr);
+ simgrid::kernel::routing::NetZoneImpl::get_global_route(value1, netcardDst, route, nullptr);
for (auto const& link : route)
std::printf("<link_ctn id=\"%s\"/>", link->get_cname());
std::printf("\n </route>\n");