X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/83eed53fd4d95fd1fa0532da3c071f66000f1a6b..118d3f4ca3b1f74eb632dec688ca5c7dfab7f1ba:/src/kernel/routing/AsClusterDragonfly.cpp diff --git a/src/kernel/routing/AsClusterDragonfly.cpp b/src/kernel/routing/AsClusterDragonfly.cpp index 70fa371044..abe03acbc9 100644 --- a/src/kernel/routing/AsClusterDragonfly.cpp +++ b/src/kernel/routing/AsClusterDragonfly.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/kernel/routing/AsClusterDragonfly.hpp" +#include "src/kernel/routing/NetCard.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area @@ -236,15 +237,16 @@ void AsClusterDragonfly::generateLinks() { } } -void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_platf_route_cbarg_t route, double *latency) { +void AsClusterDragonfly::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* latency) +{ //Minimal routing version. // TODO : non-minimal random one, and adaptive ? if (dst->isRouter() || src->isRouter()) return; - XBT_VERB("dragonfly_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), - dst->name().c_str(), dst->id()); + XBT_VERB("dragonfly getLocalRout from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(), + dst->id()); if ((src->id() == dst->id()) && hasLoopback_) { s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_); @@ -266,9 +268,8 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla //node->router local link route->link_list->push_back(myRouter->myNodes_[myCoords[3]*numLinksperLink_]); - if(latency) { + if (latency) *latency += myRouter->myNodes_[myCoords[3] * numLinksperLink_]->latency(); - } if (hasLimiter_) { // limiter for sender s_surf_parsing_link_up_down_t info = privateLinks_.at(src->id() * linkCountPerNode_ + hasLoopback_); @@ -283,26 +284,23 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla if(currentRouter->blade_!=targetCoords[0]){ //go to the nth router in our chassis route->link_list->push_back(currentRouter->greenLinks_[targetCoords[0]]); - if(latency) { + if (latency) *latency += currentRouter->greenLinks_[targetCoords[0]]->latency(); - } currentRouter=routers_[myCoords[0]*(numChassisPerGroup_*numBladesPerChassis_)+myCoords[1] * numBladesPerChassis_+targetCoords[0]]; } if(currentRouter->chassis_!=0){ //go to the first chassis of our group route->link_list->push_back(currentRouter->blackLinks_[0]); - if(latency) { + if (latency) *latency += currentRouter->blackLinks_[0]->latency(); - } currentRouter=routers_[myCoords[0]*(numChassisPerGroup_*numBladesPerChassis_)+targetCoords[0]]; } //go to destination group - the only optical hop route->link_list->push_back(currentRouter->blueLinks_[0]); - if(latency) { + if (latency) *latency += currentRouter->blueLinks_[0]->latency(); - } currentRouter=routers_[targetCoords[0]*(numChassisPerGroup_*numBladesPerChassis_)+myCoords[0]]; } @@ -310,18 +308,16 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla //same group, but same blade ? if(targetRouter->blade_ != currentRouter->blade_){ route->link_list->push_back(currentRouter->greenLinks_[targetCoords[2]]); - if(latency) { + if (latency) *latency += currentRouter->greenLinks_[targetCoords[2]]->latency(); - } currentRouter=routers_[targetCoords[0]*(numChassisPerGroup_*numBladesPerChassis_)+targetCoords[2]]; } //same blade, but same chassis ? if(targetRouter->chassis_ != currentRouter->chassis_){ route->link_list->push_back(currentRouter->blackLinks_[targetCoords[1]]); - if(latency) { + if (latency) *latency += currentRouter->blackLinks_[targetCoords[1]]->latency(); - } currentRouter=routers_[targetCoords[0]*(numChassisPerGroup_*numBladesPerChassis_)+targetCoords[1]*numBladesPerChassis_+targetCoords[2]]; } } @@ -333,9 +329,8 @@ void AsClusterDragonfly::getRouteAndLatency(NetCard * src, NetCard * dst, sg_pla //router->node local link route->link_list->push_back(targetRouter->myNodes_[targetCoords[3]*numLinksperLink_+numLinksperLink_-1]); - if(latency) { + if (latency) *latency += targetRouter->myNodes_[targetCoords[3] * numLinksperLink_ + numLinksperLink_ - 1]->latency(); - } xbt_free(myCoords); xbt_free(targetCoords);