-/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2014-2021. 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. */
int FatTreeZone::connect_node_to_parents(FatTreeNode* node)
{
- std::vector<FatTreeNode*>::iterator currentParentNode = this->nodes_.begin();
+ auto 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);
int k = 0;
for (unsigned int i = 0; i < this->levels_; i++) {
for (unsigned int j = 0; j < this->nodes_by_level_[i + 1]; j++) {
- FatTreeNode* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j);
+ auto* newNode = new FatTreeNode(this->cluster_, --k, i + 1, j);
XBT_DEBUG("We create the switch %d(%u,%u)", newNode->id, newNode->level, newNode->position);
newNode->children.resize(this->num_children_per_node_[i] * this->num_port_lower_level_[i]);
if (i != this->levels_ - 1) {
: id(id), level(level), position(position)
{
LinkCreationArgs linkTemplate;
- if (cluster->limiter_link) {
+ if (cluster->limiter_link != 0.0) {
linkTemplate.bandwidths.push_back(cluster->limiter_link);
linkTemplate.latency = 0;
linkTemplate.policy = s4u::Link::SharingPolicy::SHARED;
sg_platf_new_link(&linkTemplate);
this->limiter_link_ = s4u::Link::by_name(linkTemplate.id)->get_impl();
}
- if (cluster->loopback_bw || cluster->loopback_lat) {
+ if (cluster->loopback_bw != 0.0 || cluster->loopback_lat != 0.0) {
linkTemplate.bandwidths.push_back(cluster->loopback_bw);
linkTemplate.latency = cluster->loopback_lat;
linkTemplate.policy = s4u::Link::SharingPolicy::FATPIPE;