From: Frederic Suter Date: Fri, 19 Aug 2016 07:41:40 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid X-Git-Tag: v3_14~523 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/184b805aa8767a3b01366fa5a0d2fe739538e4ca?hp=81797a62f739010dee1d70c9dc320a421f68494c Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid --- diff --git a/include/simgrid/s4u/As.hpp b/include/simgrid/s4u/As.hpp index 50c4854814..7de5a3642c 100644 --- a/include/simgrid/s4u/As.hpp +++ b/include/simgrid/s4u/As.hpp @@ -61,7 +61,7 @@ public: protected: char *name_ = nullptr; xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes - xbt_dynar_t vertices_ = xbt_dynar_new(sizeof(char*),nullptr); // our content, as known to our graph routing algorithm (maps vertexId -> vertex) + std::vector vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex) std::map, std::vector*> bypassRoutes_; // srcName x dstName -> route diff --git a/src/kernel/routing/AsCluster.cpp b/src/kernel/routing/AsCluster.cpp index e85becf24c..94e2f14afb 100644 --- a/src/kernel/routing/AsCluster.cpp +++ b/src/kernel/routing/AsCluster.cpp @@ -17,21 +17,18 @@ namespace routing { AsCluster::AsCluster(const char*name) : AsImpl(name) {} - AsCluster::~AsCluster() - { - xbt_dynar_free(&privateLinks_); - } + AsCluster::~AsCluster()=default; void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) { s_surf_parsing_link_up_down_t info; XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->name(), src->id(), dst->name(), dst->id()); - xbt_assert(!xbt_dynar_is_empty(privateLinks_), "Cluster routing : no links attached to the source node - did you use host_link tag?"); + xbt_assert(!privateLinks_.empty(), "Cluster routing : no links attached to the source node - did you use host_link tag?"); if (! src->isRouter()) { // No specific link for router if((src->id() == dst->id()) && hasLoopback_ ){ - info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(src->id() * linkCountPerNode_); route->link_list->push_back(info.linkUp); if (lat) *lat += info.linkUp->getLatency(); @@ -40,11 +37,11 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb if (hasLimiter_){ // limiter for sender - info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_ + (hasLoopback_?1:0), s_surf_parsing_link_up_down_t); + info = privateLinks_.at(src->id() * linkCountPerNode_ + (hasLoopback_?1:0)); route->link_list->push_back((Link*)info.linkUp); } - info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_ + (hasLoopback_?1:0) + (hasLimiter_?1:0), s_surf_parsing_link_up_down_t); + info = privateLinks_.at(src->id() * linkCountPerNode_ + (hasLoopback_?1:0) + (hasLimiter_?1:0)); if (info.linkUp) { // link up route->link_list->push_back(info.linkUp); if (lat) @@ -60,7 +57,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb } if (! dst->isRouter()) { // No specific link for router - info = xbt_dynar_get_as(privateLinks_, dst->id() * linkCountPerNode_ + hasLoopback_ + hasLimiter_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_ + hasLimiter_); if (info.linkDown) { // link down route->link_list->push_back(info.linkDown); @@ -68,7 +65,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb *lat += info.linkDown->getLatency(); } if (hasLimiter_){ // limiter for receiver - info = xbt_dynar_get_as(privateLinks_, dst->id() * linkCountPerNode_ + hasLoopback_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_); route->link_list->push_back(info.linkUp); } } @@ -76,10 +73,6 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) { - int isrc; - int table_size = xbt_dynar_length(vertices_); - - NetCard *src; xbt_node_t current, previous, backboneNode = nullptr, routerNode; s_surf_parsing_link_up_down_t info; @@ -96,18 +89,14 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) new_xbt_graph_edge(graph, routerNode, backboneNode, edges); } - for (isrc = 0; isrc < table_size; isrc++) { - src = xbt_dynar_get_as(vertices_, isrc, NetCard*); - + for (auto src: vertices_){ if (! src->isRouter()) { previous = new_xbt_graph_node(graph, src->name(), nodes); - info = xbt_dynar_get_as(privateLinks_, src->id(), s_surf_parsing_link_up_down_t); + info = privateLinks_.at(src->id()); if (info.linkUp) { // link up - - const char *link_name = static_cast( - info.linkUp)->getName(); + const char *link_name = static_cast(info.linkUp)->getName(); current = new_xbt_graph_node(graph, link_name, nodes); new_xbt_graph_edge(graph, previous, current, edges); @@ -116,7 +105,6 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) } else { new_xbt_graph_edge(graph, current, routerNode, edges); } - } if (info.linkDown) { // link down @@ -132,7 +120,6 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) } } } - } } @@ -159,7 +146,7 @@ void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, info.linkUp = Link::byName(link_id); info.linkDown = info.linkUp; } - xbt_dynar_set(privateLinks_, position, &info); + privateLinks_.insert(privateLinks_.begin()+position, info); xbt_free(link_id); } diff --git a/src/kernel/routing/AsCluster.hpp b/src/kernel/routing/AsCluster.hpp index 7a8d4e3bea..013ca08bc6 100644 --- a/src/kernel/routing/AsCluster.hpp +++ b/src/kernel/routing/AsCluster.hpp @@ -23,7 +23,7 @@ public: virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position); virtual void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) {} - xbt_dynar_t privateLinks_ = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),nullptr); + std::vector privateLinks_; Link* backbone_ = nullptr; void *loopback_ = nullptr; diff --git a/src/kernel/routing/AsClusterDragonfly.cpp b/src/kernel/routing/AsClusterDragonfly.cpp index cec68d8aac..cfdb63a4ef 100644 --- a/src/kernel/routing/AsClusterDragonfly.cpp +++ b/src/kernel/routing/AsClusterDragonfly.cpp @@ -245,7 +245,7 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla XBT_VERB("dragonfly_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->name(), src->id(), dst->name(), dst->id()); if ((src->id() == dst->id()) && hasLoopback_) { - s_surf_parsing_link_up_down_t info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_, s_surf_parsing_link_up_down_t); + s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_); route->link_list->push_back(info.linkUp); if (latency) @@ -270,7 +270,7 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla if (hasLimiter_) { // limiter for sender s_surf_parsing_link_up_down_t info; - info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_ + hasLoopback_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(src->id() * linkCountPerNode_ + hasLoopback_); route->link_list->push_back(info.linkUp); } @@ -327,7 +327,7 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla if (hasLimiter_) { // limiter for receiver s_surf_parsing_link_up_down_t info; - info = xbt_dynar_get_as(privateLinks_, dst->id() * linkCountPerNode_ + hasLoopback_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_); route->link_list->push_back(info.linkUp); } diff --git a/src/kernel/routing/AsClusterTorus.cpp b/src/kernel/routing/AsClusterTorus.cpp index 55a46067c6..b88ed42d4e 100644 --- a/src/kernel/routing/AsClusterTorus.cpp +++ b/src/kernel/routing/AsClusterTorus.cpp @@ -78,7 +78,7 @@ namespace simgrid { * note that position rankId*(xbt_dynar_length(dimensions)+has_loopack?+has_limiter?) * holds the link "rankId->rankId" */ - xbt_dynar_set(privateLinks_, position + j, &info); + privateLinks_.insert(privateLinks_.begin() + position + j, info); dim_product *= current_dimension; xbt_free(link_id); } @@ -118,7 +118,7 @@ namespace simgrid { return; if ((src->id() == dst->id()) && hasLoopback_) { - s_surf_parsing_link_up_down_t info = xbt_dynar_get_as(privateLinks_, src->id() * linkCountPerNode_, s_surf_parsing_link_up_down_t); + s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_); route->link_list->push_back(info.linkUp); if (lat) @@ -200,11 +200,11 @@ namespace simgrid { s_surf_parsing_link_up_down_t info; if (hasLimiter_) { // limiter for sender - info = xbt_dynar_get_as(privateLinks_, nodeOffset + hasLoopback_, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(nodeOffset + hasLoopback_); route->link_list->push_back(info.linkUp); } - info = xbt_dynar_get_as(privateLinks_, linkOffset, s_surf_parsing_link_up_down_t); + info = privateLinks_.at(linkOffset); if (use_lnk_up == false) { route->link_list->push_back(info.linkDown); diff --git a/src/kernel/routing/AsFloyd.cpp b/src/kernel/routing/AsFloyd.cpp index 77047752fb..78d60e1db9 100644 --- a/src/kernel/routing/AsFloyd.cpp +++ b/src/kernel/routing/AsFloyd.cpp @@ -27,7 +27,7 @@ AsFloyd::AsFloyd(const char*name) } AsFloyd::~AsFloyd(){ - int table_size = static_cast(xbt_dynar_length(vertices_)); + int table_size = static_cast(vertices_.size()); if (linkTable_ == nullptr) // Dealing with a parse error in the file? return; /* Delete link_table */ @@ -42,7 +42,7 @@ AsFloyd::~AsFloyd(){ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) { - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); getRouteCheckParams(src, dst); @@ -85,7 +85,7 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar void AsFloyd::addRoute(sg_platf_route_cbarg_t route) { /* set the size of table routing */ - int table_size = static_cast(xbt_dynar_length(vertices_)); + int table_size = static_cast(vertices_.size()); addRouteCheckParams(route); @@ -147,9 +147,8 @@ void AsFloyd::addRoute(sg_platf_route_cbarg_t route) } void AsFloyd::seal(){ - /* set the size of table routing */ - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); if(!linkTable_) { /* Create Cost, Predecessor and Link tables */ diff --git a/src/kernel/routing/AsFull.cpp b/src/kernel/routing/AsFull.cpp index e0b6cda7fe..0b5807e497 100644 --- a/src/kernel/routing/AsFull.cpp +++ b/src/kernel/routing/AsFull.cpp @@ -23,7 +23,7 @@ void AsFull::seal() { sg_platf_route_cbarg_t e_route; /* set utils vars */ - int table_size = (int)xbt_dynar_length(vertices_); + int table_size = static_cast(vertices_.size()); /* Create table if necessary */ if (!routingTable_) @@ -47,11 +47,10 @@ void AsFull::seal() { AsFull::~AsFull(){ if (routingTable_) { - int table_size = (int)xbt_dynar_length(vertices_); - int i, j; + int table_size = static_cast(vertices_.size()); /* Delete routing table */ - for (i = 0; i < table_size; i++) - for (j = 0; j < table_size; j++) { + for (int i = 0; i < table_size; i++) + for (int j = 0; j < table_size; j++) { if (TO_ROUTE_FULL(i,j)){ delete TO_ROUTE_FULL(i,j)->link_list; xbt_free(TO_ROUTE_FULL(i,j)); @@ -67,7 +66,7 @@ void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg src->name(), src->id(), dst->name(), dst->id()); /* set utils vars */ - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); sg_platf_route_cbarg_t e_route = nullptr; @@ -93,7 +92,7 @@ void AsFull::addRoute(sg_platf_route_cbarg_t route) addRouteCheckParams(route); - size_t table_size = xbt_dynar_length(vertices_); + size_t table_size = vertices_.size(); if (!routingTable_) routingTable_ = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size); diff --git a/src/kernel/routing/AsRoutedGraph.cpp b/src/kernel/routing/AsRoutedGraph.cpp index b256dd00a0..db43c0c237 100644 --- a/src/kernel/routing/AsRoutedGraph.cpp +++ b/src/kernel/routing/AsRoutedGraph.cpp @@ -31,10 +31,7 @@ AsRoutedGraph::AsRoutedGraph(const char*name) { } -AsRoutedGraph::~AsRoutedGraph() -{ -} - +AsRoutedGraph::~AsRoutedGraph()=default; }}} // namespace simgrid::kernel::routing @@ -66,7 +63,6 @@ xbt_edge_t new_xbt_graph_edge(xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt int len = strlen(sn) + strlen(dn) + 1; char *name = (char *) xbt_malloc(len * sizeof(char)); - snprintf(name, len, "%s%s", sn, dn); xbt_edge_t ret = (xbt_edge_t) xbt_dict_get_or_null(edges, name); if (ret == nullptr) { @@ -92,12 +88,12 @@ namespace routing { sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1); route->link_list = new std::vector(); - int table_size = (int)xbt_dynar_length(vertices_); + int table_size = static_cast(vertices_.size()); for(int src=0; src < table_size; src++) { for(int dst=0; dst< table_size; dst++) { route->link_list->clear(); - NetCard *src_elm = xbt_dynar_get_as(vertices_, src, NetCard*); - NetCard *dst_elm = xbt_dynar_get_as(vertices_, dst, NetCard*); + NetCard *src_elm = vertices_.at(src); + NetCard *dst_elm = vertices_.at(dst); this->getRouteAndLatency(src_elm, dst_elm,route, nullptr); if (route->link_list->size() == 1) { @@ -118,18 +114,10 @@ namespace routing { void AsRoutedGraph::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) { - int src, dst; - int table_size = xbt_dynar_length(vertices_); - - - for (src = 0; src < table_size; src++) { - NetCard *my_src = - xbt_dynar_get_as(vertices_, src, NetCard*); - for (dst = 0; dst < table_size; dst++) { - if (src == dst) + for (auto my_src: vertices_){ + for (auto my_dst: vertices_){ + if (my_src == my_dst) continue; - NetCard *my_dst = - xbt_dynar_get_as(vertices_, dst, NetCard*); sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1); route->link_list = new std::vector(); @@ -175,7 +163,6 @@ void AsRoutedGraph::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edg } } - /* ************************************************************************** */ /* ************************* GENERIC AUX FUNCTIONS ************************** */ /* change a route containing link names into a route containing link entities */ diff --git a/src/kernel/routing/AsVivaldi.cpp b/src/kernel/routing/AsVivaldi.cpp index c25b4e026f..c922633842 100644 --- a/src/kernel/routing/AsVivaldi.cpp +++ b/src/kernel/routing/AsVivaldi.cpp @@ -68,16 +68,16 @@ void AsVivaldi::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb } /* Retrieve the private links */ - if ((int)xbt_dynar_length(privateLinks_) > src->id()) { - s_surf_parsing_link_up_down_t info = xbt_dynar_get_as(privateLinks_, src->id(), s_surf_parsing_link_up_down_t); + if (static_cast(privateLinks_.size()) > src->id()) { + s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id()); if(info.linkUp) { route->link_list->push_back(info.linkUp); if (lat) *lat += info.linkUp->getLatency(); } } - if ((int)xbt_dynar_length(privateLinks_)>dst->id()) { - s_surf_parsing_link_up_down_t info = xbt_dynar_get_as(privateLinks_, dst->id(), s_surf_parsing_link_up_down_t); + if (static_cast(privateLinks_.size()) >dst->id()) { + s_surf_parsing_link_up_down_t info = privateLinks_.at(dst->id()); if(info.linkDown) { route->link_list->push_back(info.linkDown); if (lat) diff --git a/src/s4u/s4u_as.cpp b/src/s4u/s4u_as.cpp index 56864b5f47..32d5eca29a 100644 --- a/src/s4u/s4u_as.cpp +++ b/src/s4u/s4u_as.cpp @@ -36,7 +36,6 @@ namespace simgrid { xbt_dict_free(&children_); - xbt_dynar_free(&vertices_); for (auto &kv : bypassRoutes_) delete kv.second; xbt_free(name_); @@ -58,9 +57,8 @@ namespace simgrid { { xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr); - for (unsigned int index = 0; index < xbt_dynar_length(vertices_); index++) { - kernel::routing::NetCard *card = xbt_dynar_get_as(vertices_, index, kernel::routing::NetCard*); - s4u::Host *host = simgrid::s4u::Host::by_name_or_null(card->name()); + for (auto card : vertices_) { + s4u::Host *host = simgrid::s4u::Host::by_name_or_null(card->name()); if (host!=nullptr) xbt_dynar_push(res, &host); } @@ -68,8 +66,8 @@ namespace simgrid { } int As::addComponent(kernel::routing::NetCard *elm) { - xbt_dynar_push_as(vertices_, kernel::routing::NetCard*, elm); - return xbt_dynar_length(vertices_)-1; + vertices_.push_back(elm); + return vertices_.size()-1; //FIXME -1 ? } void As::addRoute(sg_platf_route_cbarg_t /*route*/){ diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 19d8243883..b69168e344 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -310,7 +310,8 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) XBT_DEBUG("", link_id, cluster->bw, cluster->lat); - s_surf_parsing_link_up_down_t info_lim, info_loop; + s_surf_parsing_link_up_down_t info_lim; + s_surf_parsing_link_up_down_t info_loop; // All links are saved in a matrix; // every row describes a single node; every node may have multiple links. // the first column may store a link from x to x if p_has_loopback is set @@ -328,10 +329,18 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) link.latency = cluster->loopback_lat; link.policy = SURF_LINK_FATPIPE; sg_platf_new_link(&link); - info_loop.linkUp = info_loop.linkDown = Link::byName(tmp_link); + info_loop.linkUp = Link::byName(tmp_link); + info_loop.linkDown = Link::byName(tmp_link); free(tmp_link); auto as_cluster = static_cast(current_as); - xbt_dynar_set(as_cluster->privateLinks_, rankId*as_cluster->linkCountPerNode_, &info_loop); + if (rankId*as_cluster->linkCountPerNode_ >= static_cast(as_cluster->privateLinks_.size())){ + s_surf_parsing_link_up_down_t dummy; + dummy.linkUp = nullptr; + dummy.linkDown = nullptr; + as_cluster->privateLinks_.resize(rankId*as_cluster->linkCountPerNode_,dummy); + } + as_cluster->privateLinks_.insert(as_cluster->privateLinks_.begin() + rankId*as_cluster->linkCountPerNode_, + info_loop); } //add a limiter link (shared link to account for maximal bandwidth of the node) @@ -347,7 +356,8 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster) sg_platf_new_link(&link); info_lim.linkUp = info_lim.linkDown = Link::byName(tmp_link); free(tmp_link); - xbt_dynar_set(current_as->privateLinks_, rankId * current_as->linkCountPerNode_ + current_as->hasLoopback_ , &info_lim); + current_as->privateLinks_.insert(current_as->privateLinks_.begin() + rankId * current_as->linkCountPerNode_ + + current_as->hasLoopback_ , info_lim); } //call the cluster function that adds the others links @@ -903,10 +913,15 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink) // If dynar is is greater than netcard id and if the host_link is already defined auto as_cluster = static_cast(current_routing); - if((int)xbt_dynar_length(as_cluster->privateLinks_) > netcard->id() && - xbt_dynar_get_as(as_cluster->privateLinks_, netcard->id(), void*)) - surf_parse_error("Host_link for '%s' is already defined!",hostlink->id); - + if(static_cast(as_cluster->privateLinks_.size()) > netcard->id()){ + if (as_cluster->privateLinks_.at(netcard->id()).linkUp != nullptr) + surf_parse_error("Host_link for '%s' is already defined!",hostlink->id); + } else { + s_surf_parsing_link_up_down_t dummy; + dummy.linkUp = nullptr; + dummy.linkDown = nullptr; + as_cluster->privateLinks_.resize(netcard->id(), dummy); + } XBT_DEBUG("Push Host_link for host '%s' to position %d", netcard->name(), netcard->id()); - xbt_dynar_set_as(as_cluster->privateLinks_, netcard->id(), s_surf_parsing_link_up_down_t, link_up_down); + as_cluster->privateLinks_.insert(as_cluster->privateLinks_.begin() + netcard->id(), link_up_down); } diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index dc6f7a8ca8..f575f71bbc 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -740,6 +740,7 @@ void ETag_surfxml_route(){ for (auto link_name: parsed_link_list) { simgrid::surf::Link *link = Link::byName(link_name); route.link_list->push_back(link); + xbt_free(link_name); } parsed_link_list.clear(); @@ -762,6 +763,7 @@ void ETag_surfxml_ASroute(){ for (auto link_name: parsed_link_list) { simgrid::surf::Link *link = Link::byName(link_name); ASroute.link_list->push_back(link); + xbt_free(link_name); } parsed_link_list.clear(); @@ -793,6 +795,7 @@ void ETag_surfxml_bypassRoute(){ for (auto link_name: parsed_link_list) { simgrid::surf::Link *link = Link::byName(link_name); route.link_list->push_back(link); + xbt_free(link_name); } parsed_link_list.clear(); @@ -809,6 +812,7 @@ void ETag_surfxml_bypassASroute(){ for (auto link_name: parsed_link_list) { simgrid::surf::Link *link = Link::byName(link_name); ASroute.link_list->push_back(link); + xbt_free(link_name); } parsed_link_list.clear();