-/* 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.
/* Creation routing model functions */
AsCluster::AsCluster() : AsNone()
{
+ p_backbone = 0;
+ p_loopback = 0;
+ p_router = 0;
}
/* Business methods */
if((src->m_id == dst->m_id) && info.loopback_link ){
xbt_dynar_push_as(route->link_list, void *, info.loopback_link);
if (lat)
- *lat += static_cast<NetworkCm02LinkPtr>(info.loopback_link)->getLatency();
+ *lat += static_cast<NetworkLinkPtr>(info.loopback_link)->getLatency();
return;
}
if (info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
- *lat += static_cast<NetworkCm02LinkPtr>(info.link_up)->getLatency();
+ *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
}
}
if (p_backbone) {
- xbt_dynar_push_as(route->link_list, void *, p_backbone);
+ xbt_dynar_push_as(route->link_list, void *, static_cast<ResourcePtr>(p_backbone));
if (lat)
- *lat += static_cast<NetworkCm02LinkPtr>(p_backbone)->getLatency();
+ *lat += p_backbone->getLatency();
}
if (dst->p_rcType != SURF_NETWORK_ELEMENT_ROUTER) { // No specific link for router
if (info.link_down) { // link down
xbt_dynar_push_as(route->link_list, void *, info.link_down);
if (lat)
- *lat += static_cast<NetworkCm02LinkPtr>(info.link_down)->getLatency();
+ *lat += static_cast<NetworkLinkPtr>(info.link_down)->getLatency();
}
if (info.limiter_link) // limiter for receiver
routerNode = new_xbt_graph_node(graph, link_name, nodes);
if(p_backbone) {
- const char *link_nameR = p_backbone->m_name;
+ const char *link_nameR = p_backbone->getName();
backboneNode = new_xbt_graph_node(graph, link_nameR, nodes);
new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
if (info.link_up) { // link up
- const char *link_name = ((ResourcePtr) info.link_up)->m_name;
+ const char *link_name = static_cast<ResourcePtr>(info.link_up)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);
}
if (info.link_down) { // link down
- const char *link_name = ((ResourcePtr) info.link_down)->m_name;
+ const char *link_name = static_cast<ResourcePtr>(info.link_down)->getName();
current = new_xbt_graph_node(graph, link_name, nodes);
new_xbt_graph_edge(graph, previous, current, edges);