X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/829b0c9f55b2cda57fb9371026214dd3c646e9c1..eca09d65271990fdae84e1d7da71916740a9c50b:/src/surf/surf_routing_cluster_torus.cpp diff --git a/src/surf/surf_routing_cluster_torus.cpp b/src/surf/surf_routing_cluster_torus.cpp index 972254cf10..52d0c35960 100644 --- a/src/surf/surf_routing_cluster_torus.cpp +++ b/src/surf/surf_routing_cluster_torus.cpp @@ -1,3 +1,9 @@ +/* Copyright (c) 2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include "surf_routing_cluster_torus.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf"); @@ -212,11 +218,17 @@ void AsClusterTorus::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, info = xbt_dynar_get_as(p_linkUpDownList,linkOffset, s_surf_parsing_link_up_down_t); - if (use_lnk_up == false) + if (use_lnk_up == false){ xbt_dynar_push_as(route->link_list,void*,info.link_down); - else + + if (lat) + *lat += static_cast(info.link_down)->getLatency(); + }else{ xbt_dynar_push_as(route->link_list,void*,info.link_up); + if (lat) + *lat += static_cast(info.link_up)->getLatency(); + } current_node = next_node; next_node = 0; }