-FatTreeZone::FatTreeZone(NetZone* father, std::string name) : ClusterZone(father, name)
+FatTreeZone::FatTreeZone(NetZoneImpl* father, std::string name, resource::NetworkModel* netmodel)
+ : ClusterZone(father, name, netmodel)
{
XBT_DEBUG("Is %d(%u,%u) in the sub tree of %d(%u,%u) ?", node->id, node->level, node->position, root->id, root->level,
root->position);
{
XBT_DEBUG("Is %d(%u,%u) in the sub tree of %d(%u,%u) ?", node->id, node->level, node->position, root->id, root->level,
root->position);
if (source->id == destination->id && this->has_loopback_) {
into->link_list.push_back(source->loopback);
if (latency)
if (source->id == destination->id && this->has_loopback_) {
into->link_list.push_back(source->loopback);
if (latency)
int d = destination->position; // as in d-mod-k
for (unsigned int i = 0; i < currentNode->level; i++)
int d = destination->position; // as in d-mod-k
for (unsigned int i = 0; i < currentNode->level; i++)
if (i % this->num_children_per_node_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
into->link_list.push_back(currentNode->children[i]->down_link_);
if (latency)
if (i % this->num_children_per_node_[currentNode->level - 1] == destination->label[currentNode->level - 1]) {
into->link_list.push_back(currentNode->children[i]->down_link_);
if (latency)
currentNode = currentNode->children[i]->down_node_;
if (this->has_limiter_)
into->link_list.push_back(currentNode->limiter_link_);
currentNode = currentNode->children[i]->down_node_;
if (this->has_limiter_)
into->link_list.push_back(currentNode->limiter_link_);
if (XBT_LOG_ISENABLED(surf_route_fat_tree, xbt_log_priority_debug)) {
std::stringstream msgBuffer;
if (XBT_LOG_ISENABLED(surf_route_fat_tree, xbt_log_priority_debug)) {
std::stringstream msgBuffer;
unsigned int k = 0;
// Nodes are totally ordered, by level and then by position, in this->nodes
for (unsigned int i = 0; i < this->levels_; i++) {
for (unsigned int j = 0; j < this->nodes_by_level_[i]; j++) {
unsigned int k = 0;
// Nodes are totally ordered, by level and then by position, in this->nodes
for (unsigned int i = 0; i < this->levels_; i++) {
for (unsigned int j = 0; j < this->nodes_by_level_[i]; j++) {
{
std::vector<FatTreeNode*>::iterator currentParentNode = this->nodes_.begin();
int connectionsNumber = 0;
const int level = node->level;
XBT_DEBUG("We are connecting node %d(%u,%u) to his parents.", node->id, node->level, node->position);
{
std::vector<FatTreeNode*>::iterator currentParentNode = this->nodes_.begin();
int connectionsNumber = 0;
const int level = node->level;
XBT_DEBUG("We are connecting node %d(%u,%u) to his parents.", node->id, node->level, node->position);
XBT_DEBUG("%d(%u,%u) and %d(%u,%u) are related,"
" with %u links between them.",
node->id, node->level, node->position, (*currentParentNode)->id, (*currentParentNode)->level,
XBT_DEBUG("%d(%u,%u) and %d(%u,%u) are related,"
" with %u links between them.",
node->id, node->level, node->position, (*currentParentNode)->id, (*currentParentNode)->level,
{
XBT_DEBUG("Generating switches.");
this->nodes_by_level_.resize(this->levels_ + 1, 0);
{
XBT_DEBUG("Generating switches.");
this->nodes_by_level_.resize(this->levels_ + 1, 0);
if (cluster->limiter_link) {
linkTemplate.bandwidth = cluster->limiter_link;
linkTemplate.latency = 0;
if (cluster->limiter_link) {
linkTemplate.bandwidth = cluster->limiter_link;
linkTemplate.latency = 0;
}
if (cluster->loopback_bw || cluster->loopback_lat) {
linkTemplate.bandwidth = cluster->loopback_bw;
linkTemplate.latency = cluster->loopback_lat;
}
if (cluster->loopback_bw || cluster->loopback_lat) {
linkTemplate.bandwidth = cluster->loopback_bw;
linkTemplate.latency = cluster->loopback_lat;
"link_from_" + std::to_string(downNode->id) + "_" + std::to_string(upNode->id) + "_" + std::to_string(uniqueId);
sg_platf_new_link(&linkTemplate);
"link_from_" + std::to_string(downNode->id) + "_" + std::to_string(upNode->id) + "_" + std::to_string(uniqueId);
sg_platf_new_link(&linkTemplate);
- if (cluster->sharing_policy == SURF_LINK_SPLITDUPLEX) {
- std::string tmpID = std::string(linkTemplate.id) + "_UP";
- this->up_link_ = surf::LinkImpl::byName(tmpID); // check link?
- tmpID = std::string(linkTemplate.id) + "_DOWN";
- this->down_link_ = surf::LinkImpl::byName(tmpID); // check link ?
+ if (cluster->sharing_policy == s4u::Link::SharingPolicy::SPLITDUPLEX) {
+ this->up_link_ = s4u::Link::by_name(linkTemplate.id + "_UP")->get_impl(); // check link?
+ this->down_link_ = s4u::Link::by_name(linkTemplate.id + "_DOWN")->get_impl(); // check link ?