Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fixed typo in documentation of surf_routing.hpp
[simgrid.git] / src / surf / surf_routing_cluster_torus.cpp
index 972254c..52d0c35 100644 (file)
@@ -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<NetworkLinkPtr>(info.link_down)->getLatency();
+       }else{
            xbt_dynar_push_as(route->link_list,void*,info.link_up);
 
+       if (lat)
+         *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
+       }
        current_node = next_node;
        next_node = 0;
      }