Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
In XBT_LOG_NEW_SUBCATEGORY_helper, protect function declaration with SG_{BEGIN,END...
[simgrid.git] / src / surf / surf_routing_cluster.cpp
index 6bc1553..ca6288f 100644 (file)
@@ -1,14 +1,12 @@
-/* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
+/* Copyright (c) 2009, 2010, 2011, 2013. 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.hpp"
-#include "surf_routing_private.h"
 
-extern "C" {
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
-}
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
  * Note that a router is created, easing the interconnexion with the rest of the world.
@@ -22,6 +20,9 @@ AS_t model_cluster_create(void)
 /* Creation routing model functions */
 AsCluster::AsCluster() : AsNone()
 {
+  p_backbone = 0;
+  p_loopback = 0;
+  p_router = 0;
 }
 
 /* Business methods */
@@ -37,7 +38,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if((src->m_id == dst->m_id) && info.loopback_link  ){
       xbt_dynar_push_as(route->link_list, void *, info.loopback_link);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.loopback_link))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.loopback_link))->getLatency();
       return;
     }
 
@@ -48,7 +49,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if (info.link_up) {         // link up
       xbt_dynar_push_as(route->link_list, void *, info.link_up);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.link_up))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.link_up))->getLatency();
     }
   }
 
@@ -64,7 +65,7 @@ void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_pl
     if (info.link_down) {       // link down
       xbt_dynar_push_as(route->link_list, void *, info.link_down);
       if (lat)
-        *lat += dynamic_cast<NetworkCm02LinkPtr>(static_cast<ResourcePtr>(info.link_down))->getLatency();
+        *lat += dynamic_cast<NetworkLinkPtr>(static_cast<ResourcePtr>(info.link_down))->getLatency();
     }
 
     if (info.limiter_link)          // limiter for receiver