A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
snake_case routing
[simgrid.git]
/
src
/
kernel
/
routing
/
TorusZone.cpp
diff --git
a/src/kernel/routing/TorusZone.cpp
b/src/kernel/routing/TorusZone.cpp
index 1d01cc9bcc95f645afc29531329ebe504dcb9d96..e2041cd6650eddb5a54e504526ff8e340deeaea0 100644
(file)
--- a/
src/kernel/routing/TorusZone.cpp
+++ b/
src/kernel/routing/TorusZone.cpp
@@
-1,11
+1,13
@@
-/* Copyright (c) 2014-201
7
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2014-201
8
. 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. */
/* 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 "s
rc
/kernel/routing/TorusZone.hpp"
-#include "s
rc
/kernel/routing/NetPoint.hpp"
+#include "s
imgrid
/kernel/routing/TorusZone.hpp"
+#include "s
imgrid
/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
+
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <string>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <string>
@@
-68,7
+70,7
@@
void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int
* Note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?)
* holds the link "rankId->rankId"
*/
* Note that position rankId*(xbt_dynar_length(dimensions)+has_loopback?+has_limiter?)
* holds the link "rankId->rankId"
*/
- private
L
inks_.insert({position + j, {linkUp, linkDown}});
+ private
_l
inks_.insert({position + j, {linkUp, linkDown}});
dim_product *= current_dimension;
}
rank++;
dim_product *= current_dimension;
}
rank++;
@@
-87,20
+89,20
@@
void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
for (auto const& group : dimensions)
dimensions_.push_back(surf_parse_get_int(group));
for (auto const& group : dimensions)
dimensions_.push_back(surf_parse_get_int(group));
-
linkCountPerN
ode_ = dimensions_.size();
+
num_links_per_n
ode_ = dimensions_.size();
}
}
}
}
-void TorusZone::get
LocalR
oute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
+void TorusZone::get
_local_r
oute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
{
- XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get
Cname(), src->id(), dst->getC
name(), dst->id());
+ XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get
_cname(), src->id(), dst->get_c
name(), dst->id());
- if (dst->is
Router() || src->isR
outer())
+ if (dst->is
_router() || src->is_r
outer())
return;
return;
- if (src->id() == dst->id() && has
L
oopback_) {
- std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private
Links_.at(src->id() * linkCountPerN
ode_);
+ if (src->id() == dst->id() && has
_l
oopback_) {
+ std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private
_links_.at(src->id() * num_links_per_n
ode_);
route->link_list.push_back(info.first);
if (lat)
route->link_list.push_back(info.first);
if (lat)
@@
-149,8
+151,8
@@
void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* r
next_node = (current_node + dim_product);
// HERE: We use *CURRENT* node for calculation (as opposed to next_node)
next_node = (current_node + dim_product);
// HERE: We use *CURRENT* node for calculation (as opposed to next_node)
- nodeOffset = current_node * (
linkCountPerN
ode_);
- linkOffset = nodeOffset + (has
Loopback_ ? 1 : 0) + (hasL
imiter_ ? 1 : 0) + j;
+ nodeOffset = current_node * (
num_links_per_n
ode_);
+ linkOffset = nodeOffset + (has
_loopback_ ? 1 : 0) + (has_l
imiter_ ? 1 : 0) + j;
use_lnk_up = true;
assert(linkOffset >= 0);
} else { // Route to the left
use_lnk_up = true;
assert(linkOffset >= 0);
} else { // Route to the left
@@
-160,8
+162,8
@@
void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* r
next_node = (current_node - dim_product);
// HERE: We use *next* node for calculation (as opposed to current_node!)
next_node = (current_node - dim_product);
// HERE: We use *next* node for calculation (as opposed to current_node!)
- nodeOffset = next_node * (
linkCountPerN
ode_);
- linkOffset = nodeOffset + j + (has
Loopback_ ? 1 : 0) + (hasL
imiter_ ? 1 : 0);
+ nodeOffset = next_node * (
num_links_per_n
ode_);
+ linkOffset = nodeOffset + j + (has
_loopback_ ? 1 : 0) + (has_l
imiter_ ? 1 : 0);
use_lnk_up = false;
assert(linkOffset >= 0);
use_lnk_up = false;
assert(linkOffset >= 0);
@@
-177,12
+179,12
@@
void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* r
std::pair<surf::LinkImpl*, surf::LinkImpl*> info;
std::pair<surf::LinkImpl*, surf::LinkImpl*> info;
- if (has
L
imiter_) { // limiter for sender
- info = private
Links_.at(nodeOffset + (hasL
oopback_ ? 1 : 0));
+ if (has
_l
imiter_) { // limiter for sender
+ info = private
_links_.at(nodeOffset + (has_l
oopback_ ? 1 : 0));
route->link_list.push_back(info.first);
}
route->link_list.push_back(info.first);
}
- info = private
L
inks_.at(linkOffset);
+ info = private
_l
inks_.at(linkOffset);
if (use_lnk_up == false) {
route->link_list.push_back(info.second);
if (use_lnk_up == false) {
route->link_list.push_back(info.second);