#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>
std::string link_up = "link_" + netpoint->get_name() + "_UP";
std::string link_down = "link_" + netpoint->get_name() + "_DOWN";
- surf::LinkImpl* linkUp = surf_network_model->createLink(link_up, bw_out, 0, SURF_LINK_SHARED);
- surf::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, SURF_LINK_SHARED);
+ resource::LinkImpl* linkUp = surf_network_model->createLink(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
+ resource::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
private_links_.insert({netpoint->id(), {linkUp, linkDown}});
}
-void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void VivaldiZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* 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 = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(srcName.c_str());
- route->gw_dst = simgrid::s4u::Engine::getInstance()->getNetpointByNameOrNull(dstName.c_str());
+ route->gw_src = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(srcName.c_str());
+ route->gw_dst = simgrid::s4u::Engine::get_instance()->netpoint_by_name_or_null(dstName.c_str());
}
/* Retrieve the private links */
auto src_link = private_links_.find(src->id());
if (src_link != private_links_.end()) {
- std::pair<surf::LinkImpl*, surf::LinkImpl*> info = src_link->second;
+ std::pair<resource::LinkImpl*, resource::LinkImpl*> info = src_link->second;
if (info.first) {
route->link_list.push_back(info.first);
if (lat)
- *lat += info.first->latency();
+ *lat += info.first->get_latency();
}
} else {
XBT_DEBUG("Source of private link (%u) doesn't exist", src->id());
auto dst_link = private_links_.find(dst->id());
if (dst_link != private_links_.end()) {
- std::pair<surf::LinkImpl*, surf::LinkImpl*> info = dst_link->second;
+ std::pair<resource::LinkImpl*, resource::LinkImpl*> info = dst_link->second;
if (info.second) {
route->link_list.push_back(info.second);
if (lat)
- *lat += info.second->latency();
+ *lat += info.second->get_latency();
}
} else {
XBT_DEBUG("Destination of private link (%u) doesn't exist", dst->id());