graphNodeMap_ = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
/* Add the loopback if needed */
- if (routing_platf->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
xbt_dynar_foreach(xbt_graph_get_nodes(routeGraph_), cursor, node) {
xbt_edge_t edge = nullptr;
if (!found) {
sg_platf_route_cbarg_t e_route = xbt_new0(s_sg_platf_route_cbarg_t, 1);
e_route->link_list = new std::vector<Link*>();
- e_route->link_list->push_back(routing_platf->loopback_);
+ e_route->link_list->push_back(surf_network_model->loopback_);
xbt_graph_new_edge(routeGraph_, node, node, e_route);
}
}
}
/* Add the loopback if needed */
- if (routing_platf->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
for (unsigned int i = 0; i < table_size; i++) {
sg_platf_route_cbarg_t e_route = TO_FLOYD_LINK(i, i);
if (!e_route) {
e_route->gw_src = nullptr;
e_route->gw_dst = nullptr;
e_route->link_list = new std::vector<Link*>();
- e_route->link_list->push_back(routing_platf->loopback_);
+ e_route->link_list->push_back(surf_network_model->loopback_);
TO_FLOYD_LINK(i, i) = e_route;
TO_FLOYD_PRED(i, i) = i;
TO_FLOYD_COST(i, i) = 1;
routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);
/* Add the loopback if needed */
- if (routing_platf->loopback_ && hierarchy_ == RoutingMode::base) {
+ if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) {
for (i = 0; i < table_size; i++) {
e_route = TO_ROUTE_FULL(i, i);
if (!e_route) {
e_route->gw_src = nullptr;
e_route->gw_dst = nullptr;
e_route->link_list = new std::vector<Link*>();
- e_route->link_list->push_back(routing_platf->loopback_);
+ e_route->link_list->push_back(surf_network_model->loopback_);
TO_ROUTE_FULL(i, i) = e_route;
}
}
}
maxminSystem_ = lmm_system_new(selectiveUpdate_);
+ loopback_ = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
- routing_model_create(createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE));
+ routing_model_create();
if (updateMechanism_ == UM_LAZY) {
actionHeap_ = xbt_heap_new(8, nullptr);
surf_network_model = new simgrid::surf::NetworkConstantModel();
all_existing_models->push_back(surf_network_model);
- routing_model_create(nullptr);
+ routing_model_create();
}
namespace simgrid {
*/
virtual double bandwidthConstraint(double rate, double bound, double size);
double nextOccuringEventFull(double now) override;
+
+ Link* loopback_ = nullptr;
};
/************
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
ns3_initialize(ns3_tcp_model.get().c_str());
- routing_model_create(nullptr);
+ routing_model_create();
simgrid::s4u::Host::onCreation.connect(ns3_add_host);
simgrid::kernel::routing::netcardCreatedCallbacks.connect(ns3_add_netcard);
simgrid::surf::on_cluster.connect (&parse_ns3_add_cluster);
surf_network_model = new NetworkL07Model(this,maxminSystem_);
surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
- routing_model_create(surf_network_model->createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE));
+ routing_model_create();
}
HostL07Model::~HostL07Model() = default;
, hostModel_(hmodel)
{
maxminSystem_ = sys;
+ loopback_ = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
}
NetworkL07Model::~NetworkL07Model()
{
}}}
/** @brief create the root AS */
-void routing_model_create(Link *loopback)
+void routing_model_create()
{
- routing_platf = new simgrid::kernel::routing::RoutingPlatf(loopback);
+ routing_platf = new simgrid::kernel::routing::RoutingPlatf();
}
/* ************************************************************************** */
delete routing_platf;
}
-simgrid::kernel::routing::RoutingPlatf::RoutingPlatf(simgrid::surf::Link *loopback)
-: loopback_(loopback)
-{
-}
+simgrid::kernel::routing::RoutingPlatf::RoutingPlatf() = default;
simgrid::kernel::routing::RoutingPlatf::~RoutingPlatf()
{
delete root_;
#include <vector>
SG_BEGIN_DECL()
-XBT_PUBLIC(void) routing_model_create(Link *loopback);
+XBT_PUBLIC(void) routing_model_create();
XBT_PRIVATE xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
XBT_PRIVATE xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
SG_END_DECL()
*/
XBT_PUBLIC_CLASS RoutingPlatf {
public:
- explicit RoutingPlatf(Link *loopback);
+ explicit RoutingPlatf();
~RoutingPlatf();
AsImpl *root_ = nullptr;
- Link *loopback_;
xbt_dynar_t getOneLinkRoutes();
void getRouteAndLatency(NetCard *src, NetCard *dst, std::vector<Link*> * links, double *latency);
};