// TODO : we have to check for zeros and negative numbers, or it might crash
if (parameters.size() != 4){
// TODO : we have to check for zeros and negative numbers, or it might crash
if (parameters.size() != 4){
- surf_parse_error("Dragonfly are defined by the number of groups, chassiss per groups, blades per chassis, nodes per blade");
+ surf_parse_error(
+ "Dragonfly are defined by the number of groups, chassis per groups, blades per chassis, nodes per blade");
this->numGroups_=xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
this->numLinksBlue_=xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links for the blue level: %s");
this->numGroups_=xbt_str_parse_int(tmp[0].c_str(), "Invalid number of groups: %s");
this->numLinksBlue_=xbt_str_parse_int(tmp[1].c_str(), "Invalid number of links for the blue level: %s");
boost::split(tmp, parameters[1], boost::is_any_of(","));
if(tmp.size() != 2) {
surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
boost::split(tmp, parameters[1], boost::is_any_of(","));
if(tmp.size() != 2) {
surf_parse_error("Dragonfly topologies are defined by 3 levels with 2 elements each, and one with one element");
XBT_VERB("dragonfly_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->name(), src->id(), dst->name(), dst->id());
if ((src->id() == dst->id()) && hasLoopback_) {
XBT_VERB("dragonfly_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->name(), src->id(), dst->name(), dst->id());
if ((src->id() == dst->id()) && hasLoopback_) {
//node->router local link
route->link_list->push_back(myRouter->myNodes_[myCoords[3]*numLinksperLink_]);
if(latency) {
//node->router local link
route->link_list->push_back(myRouter->myNodes_[myCoords[3]*numLinksperLink_]);
if(latency) {
//go to the nth router in our chassis
route->link_list->push_back(currentRouter->greenLinks_[targetCoords[0]]);
if(latency) {
//go to the nth router in our chassis
route->link_list->push_back(currentRouter->greenLinks_[targetCoords[0]]);
if(latency) {
//go to destination group - the only optical hop
route->link_list->push_back(currentRouter->blueLinks_[0]);
if(latency) {
//go to destination group - the only optical hop
route->link_list->push_back(currentRouter->blueLinks_[0]);
if(latency) {
if(targetRouter->blade_ != currentRouter->blade_){
route->link_list->push_back(currentRouter->greenLinks_[targetCoords[2]]);
if(latency) {
if(targetRouter->blade_ != currentRouter->blade_){
route->link_list->push_back(currentRouter->greenLinks_[targetCoords[2]]);
if(latency) {
if(targetRouter->chassis_ != currentRouter->chassis_){
route->link_list->push_back(currentRouter->blackLinks_[targetCoords[1]]);
if(latency) {
if(targetRouter->chassis_ != currentRouter->chassis_){
route->link_list->push_back(currentRouter->blackLinks_[targetCoords[1]]);
if(latency) {
route->link_list->push_back(info.linkUp);
}
//router->node local link
route->link_list->push_back(targetRouter->myNodes_[targetCoords[3]*numLinksperLink_+numLinksperLink_-1]);
if(latency) {
route->link_list->push_back(info.linkUp);
}
//router->node local link
route->link_list->push_back(targetRouter->myNodes_[targetCoords[3]*numLinksperLink_+numLinksperLink_-1]);
if(latency) {