* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/ClusterZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
+#include "src/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
{
}
-void ClusterZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
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_) {
+ xbt_assert(!src->isRouter(), "Routing from a cluster private router to itself is meaningless");
- if ((src->id() == dst->id()) && hasLoopback_) {
- std::pair<Link*, Link*> info = privateLinks_.at(src->id() * linkCountPerNode_);
- route->link_list->push_back(info.first);
- if (lat)
- *lat += info.first->latency();
- return;
- }
+ std::pair<Link*, Link*> info = privateLinks_.at(src->id() * linkCountPerNode_);
+ route->link_list->push_back(info.first);
+ if (lat)
+ *lat += info.first->latency();
+ return;
+ }
+ if (!src->isRouter()) { // No private link for the private router
if (hasLimiter_) { // limiter for sender
std::pair<Link*, Link*> info = privateLinks_.at(src->id() * linkCountPerNode_ + (hasLoopback_ ? 1 : 0));
route->link_list->push_back(info.first);
}
if (!dst->isRouter()) { // No specific link for router
- std::pair<Link*, Link*> info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_ + hasLimiter_);
+ std::pair<Link*, Link*> info = privateLinks_.at(dst->id() * linkCountPerNode_ + hasLoopback_ + hasLimiter_);
if (info.second) { // link down
route->link_list->push_back(info.second);
if (lat)
}
}
-void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int, int position)
+void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int /*rank*/, int position)
{
char* link_id = bprintf("%s_link_%d", cluster->id, id);