From bf41d7b09bccdac18be3631c03256f2a34bdb202 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 24 Mar 2018 21:11:13 +0100 Subject: [PATCH] more snake_casing of private fields --- .../simgrid/kernel/routing/FatTreeZone.hpp | 14 ++--- include/simgrid/kernel/routing/FloydZone.hpp | 6 +- include/simgrid/kernel/routing/FullZone.hpp | 3 +- include/simgrid/kernel/routing/NetPoint.hpp | 8 +-- .../simgrid/kernel/routing/NetZoneImpl.hpp | 2 +- include/simgrid/s4u/Activity.hpp | 6 +- src/kernel/routing/FatTreeZone.cpp | 62 +++++++++---------- src/kernel/routing/FloydZone.cpp | 36 +++++------ src/kernel/routing/FullZone.cpp | 14 ++--- src/kernel/routing/NetPoint.cpp | 2 +- src/kernel/routing/NetZoneImpl.cpp | 26 ++++---- src/s4u/s4u_comm.cpp | 15 ++--- src/surf/sg_platf.cpp | 2 +- 13 files changed, 97 insertions(+), 99 deletions(-) diff --git a/include/simgrid/kernel/routing/FatTreeZone.hpp b/include/simgrid/kernel/routing/FatTreeZone.hpp index 6d19220e60..251cb3d177 100644 --- a/include/simgrid/kernel/routing/FatTreeZone.hpp +++ b/include/simgrid/kernel/routing/FatTreeZone.hpp @@ -114,24 +114,24 @@ public: * It will also store the cluster for future use. */ void parse_specific_arguments(ClusterCreationArgs* cluster) override; - void addProcessingNode(int id); - void generateDotFile(const std::string& filename = "fatTree.dot") const; + void add_processing_node(int id); + void generate_dot_file(const std::string& filename = "fatTree.dot") const; private: // description of a PGFT (TODO : better doc) unsigned long levels_ = 0; - std::vector lowerLevelNodesNumber_; // number of children by node - std::vector upperLevelNodesNumber_; // number of parents by node - std::vector lowerLevelPortsNumber_; // ports between each level l and l-1 + std::vector num_children_per_node_; // number of children by node + std::vector num_parents_per_node_; // number of parents by node + std::vector num_port_lower_level_; // ports between each level l and l-1 std::map compute_nodes_; std::vector nodes_; std::vector links_; - std::vector nodesByLevel_; + std::vector nodes_by_level_; ClusterCreationArgs* cluster_ = nullptr; - void addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort); + void addLink(FatTreeNode* parent, unsigned int parent_port, FatTreeNode* child, unsigned int child_port); int getLevelPosition(const unsigned int level); void generateLabels(); void generateSwitches(); diff --git a/include/simgrid/kernel/routing/FloydZone.hpp b/include/simgrid/kernel/routing/FloydZone.hpp index 8f67c09721..7046ec9b89 100644 --- a/include/simgrid/kernel/routing/FloydZone.hpp +++ b/include/simgrid/kernel/routing/FloydZone.hpp @@ -34,9 +34,9 @@ public: private: /* vars to compute the Floyd algorithm. */ - int* predecessorTable_; - double* costTable_; - RouteCreationArgs** linkTable_; + int* predecessor_table_; + double* cost_table_; + RouteCreationArgs** link_table_; }; } // namespace routing } // namespace kernel diff --git a/include/simgrid/kernel/routing/FullZone.hpp b/include/simgrid/kernel/routing/FullZone.hpp index a969f3b22b..4890a24df9 100644 --- a/include/simgrid/kernel/routing/FullZone.hpp +++ b/include/simgrid/kernel/routing/FullZone.hpp @@ -29,7 +29,8 @@ public: kernel::routing::NetPoint* gw_dst, std::vector& link_list, bool symmetrical) override; - RouteCreationArgs** routingTable_ = nullptr; +private: + RouteCreationArgs** routing_table_ = nullptr; }; } // namespace routing } // namespace kernel diff --git a/include/simgrid/kernel/routing/NetPoint.hpp b/include/simgrid/kernel/routing/NetPoint.hpp index 847c4e49a6..fd2694753e 100644 --- a/include/simgrid/kernel/routing/NetPoint.hpp +++ b/include/simgrid/kernel/routing/NetPoint.hpp @@ -36,9 +36,9 @@ public: /** @brief the NetZone in which this NetPoint is included */ NetZoneImpl* netzone() { return netzone_; } - bool isNetZone() { return componentType_ == Type::NetZone; } - bool isHost() { return componentType_ == Type::Host; } - bool isRouter() { return componentType_ == Type::Router; } + bool isNetZone() { return component_type_ == Type::NetZone; } + bool isHost() { return component_type_ == Type::Host; } + bool isRouter() { return component_type_ == Type::Router; } static simgrid::xbt::signal onCreation; @@ -47,7 +47,7 @@ public: private: unsigned int id_; std::string name_; - NetPoint::Type componentType_; + NetPoint::Type component_type_; NetZoneImpl* netzone_; }; } // namespace routing diff --git a/include/simgrid/kernel/routing/NetZoneImpl.hpp b/include/simgrid/kernel/routing/NetZoneImpl.hpp index f1b55e6217..dbcde250a3 100644 --- a/include/simgrid/kernel/routing/NetZoneImpl.hpp +++ b/include/simgrid/kernel/routing/NetZoneImpl.hpp @@ -98,7 +98,7 @@ public: RoutingMode hierarchy_ = RoutingMode::unset; private: - std::map, BypassRoute*> bypassRoutes_; // src x dst -> route + std::map, BypassRoute*> bypass_routes_; // src x dst -> route routing::NetPoint* netpoint_ = nullptr; // Our representative in the father NetZone }; } // namespace routing diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index b5ef0b4cd7..c508d9df71 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -61,17 +61,17 @@ public: /** Put some user data onto the Activity */ Activity* setUserData(void* data) { - userData_ = data; + user_data_ = data; return this; } /** Retrieve the user data of the Activity */ - void *getUserData() { return userData_; } + void* getUserData() { return user_data_; } private: simgrid::kernel::activity::ActivityImplPtr pimpl_ = nullptr; e_s4u_activity_state_t state_ = inited; double remains_ = 0; - void *userData_ = nullptr; + void* user_data_ = nullptr; }; // class }}; // Namespace simgrid::s4u diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 8012a39ba3..2c59ed92b6 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -93,9 +93,9 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* int d = destination->position; // as in d-mod-k for (unsigned int i = 0; i < currentNode->level; i++) - d /= this->upperLevelNodesNumber_[i]; + d /= this->num_parents_per_node_[i]; - int k = this->upperLevelNodesNumber_[currentNode->level]; + int k = this->num_parents_per_node_[currentNode->level]; d = d % k; into->link_list.push_back(currentNode->parents[d]->up_link_); @@ -113,7 +113,7 @@ void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* // Down part while (currentNode != destination) { for (unsigned int i = 0; i < currentNode->children.size(); i++) { - if (i % this->lowerLevelNodesNumber_[currentNode->level - 1] == destination->label[currentNode->level - 1]) { + 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) *latency += currentNode->children[i]->down_link_->latency(); @@ -141,9 +141,9 @@ void FatTreeZone::seal() std::stringstream msgBuffer; msgBuffer << "We are creating a fat tree of " << this->levels_ << " levels " - << "with " << this->nodesByLevel_[0] << " processing nodes"; + << "with " << this->nodes_by_level_[0] << " processing nodes"; for (unsigned int i = 1; i <= this->levels_; i++) { - msgBuffer << ", " << this->nodesByLevel_[i] << " switches at level " << i; + msgBuffer << ", " << this->nodes_by_level_[i] << " switches at level " << i; } XBT_DEBUG("%s", msgBuffer.str().c_str()); msgBuffer.str(""); @@ -160,7 +160,7 @@ void FatTreeZone::seal() 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->nodesByLevel_[i]; j++) { + for (unsigned int j = 0; j < this->nodes_by_level_[i]; j++) { this->connectNodeToParents(this->nodes_[k]); k++; } @@ -183,15 +183,15 @@ int FatTreeZone::connectNodeToParents(FatTreeNode* node) const int level = node->level; XBT_DEBUG("We are connecting node %d(%u,%u) to his parents.", node->id, node->level, node->position); currentParentNode += this->getLevelPosition(level + 1); - for (unsigned int i = 0; i < this->nodesByLevel_[level + 1]; i++) { + for (unsigned int i = 0; i < this->nodes_by_level_[level + 1]; i++) { if (this->areRelated(*currentParentNode, node)) { 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, - (*currentParentNode)->position, this->lowerLevelPortsNumber_[level]); - for (unsigned int j = 0; j < this->lowerLevelPortsNumber_[level]; j++) { - this->addLink(*currentParentNode, node->label[level] + j * this->lowerLevelNodesNumber_[level], node, - (*currentParentNode)->label[level] + j * this->upperLevelNodesNumber_[level]); + (*currentParentNode)->position, this->num_port_lower_level_[level]); + for (unsigned int j = 0; j < this->num_port_lower_level_[level]; j++) { + this->addLink(*currentParentNode, node->label[level] + j * this->num_children_per_node_[level], node, + (*currentParentNode)->label[level] + j * this->num_parents_per_node_[level]); } connectionsNumber++; } @@ -235,16 +235,16 @@ bool FatTreeZone::areRelated(FatTreeNode* parent, FatTreeNode* child) void FatTreeZone::generateSwitches() { XBT_DEBUG("Generating switches."); - this->nodesByLevel_.resize(this->levels_ + 1, 0); + this->nodes_by_level_.resize(this->levels_ + 1, 0); // Take care of the number of nodes by level - this->nodesByLevel_[0] = 1; + this->nodes_by_level_[0] = 1; for (unsigned int i = 0; i < this->levels_; i++) - this->nodesByLevel_[0] *= this->lowerLevelNodesNumber_[i]; + this->nodes_by_level_[0] *= this->num_children_per_node_[i]; - if (this->nodesByLevel_[0] != this->nodes_.size()) { + if (this->nodes_by_level_[0] != this->nodes_.size()) { surf_parse_error(std::string("The number of provided nodes does not fit with the wanted topology.") + - " Please check your platform description (We need " + std::to_string(this->nodesByLevel_[0]) + + " Please check your platform description (We need " + std::to_string(this->nodes_by_level_[0]) + "nodes, we got " + std::to_string(this->nodes_.size())); return; } @@ -253,23 +253,23 @@ void FatTreeZone::generateSwitches() int nodesInThisLevel = 1; for (unsigned int j = 0; j <= i; j++) - nodesInThisLevel *= this->upperLevelNodesNumber_[j]; + nodesInThisLevel *= this->num_parents_per_node_[j]; for (unsigned int j = i + 1; j < this->levels_; j++) - nodesInThisLevel *= this->lowerLevelNodesNumber_[j]; + nodesInThisLevel *= this->num_children_per_node_[j]; - this->nodesByLevel_[i + 1] = nodesInThisLevel; + this->nodes_by_level_[i + 1] = nodesInThisLevel; } // Create the switches int k = 0; for (unsigned int i = 0; i < this->levels_; i++) { - for (unsigned int j = 0; j < this->nodesByLevel_[i + 1]; j++) { + for (unsigned int j = 0; j < this->nodes_by_level_[i + 1]; j++) { FatTreeNode* 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->lowerLevelNodesNumber_[i] * this->lowerLevelPortsNumber_[i]); + newNode->children.resize(this->num_children_per_node_[i] * this->num_port_lower_level_[i]); if (i != this->levels_ - 1) { - newNode->parents.resize(this->upperLevelNodesNumber_[i + 1] * this->lowerLevelPortsNumber_[i + 1]); + newNode->parents.resize(this->num_parents_per_node_[i + 1] * this->num_port_lower_level_[i + 1]); } newNode->label.resize(this->levels_); this->nodes_.push_back(newNode); @@ -287,10 +287,10 @@ void FatTreeZone::generateLabels() for (unsigned int i = 0; i <= this->levels_; i++) { currentLabel.assign(this->levels_, 0); for (unsigned int j = 0; j < this->levels_; j++) { - maxLabel[j] = j + 1 > i ? this->lowerLevelNodesNumber_[j] : this->upperLevelNodesNumber_[j]; + maxLabel[j] = j + 1 > i ? this->num_children_per_node_[j] : this->num_parents_per_node_[j]; } - for (unsigned int j = 0; j < this->nodesByLevel_[i]; j++) { + for (unsigned int j = 0; j < this->nodes_by_level_[i]; j++) { if (XBT_LOG_ISENABLED(surf_route_fat_tree, xbt_log_priority_debug)) { std::stringstream msgBuffer; @@ -329,18 +329,18 @@ int FatTreeZone::getLevelPosition(const unsigned int level) int tempPosition = 0; for (unsigned int i = 0; i < level; i++) - tempPosition += this->nodesByLevel_[i]; + tempPosition += this->nodes_by_level_[i]; return tempPosition; } -void FatTreeZone::addProcessingNode(int id) +void FatTreeZone::add_processing_node(int id) { using std::make_pair; static int position = 0; FatTreeNode* newNode; newNode = new FatTreeNode(this->cluster_, id, 0, position++); - newNode->parents.resize(this->upperLevelNodesNumber_[0] * this->lowerLevelPortsNumber_[0]); + newNode->parents.resize(this->num_parents_per_node_[0] * this->num_port_lower_level_[0]); newNode->label.resize(this->levels_); this->compute_nodes_.insert(make_pair(id, newNode)); this->nodes_.push_back(newNode); @@ -384,7 +384,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster) } for (size_t i = 0; i < tmp.size(); i++) { try { - this->lowerLevelNodesNumber_.push_back(std::stoi(tmp[i])); + this->num_children_per_node_.push_back(std::stoi(tmp[i])); } catch (std::invalid_argument& ia) { throw std::invalid_argument(std::string("Invalid lower level node number:") + tmp[i]); } @@ -397,7 +397,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster) } for (size_t i = 0; i < tmp.size(); i++) { try { - this->upperLevelNodesNumber_.push_back(std::stoi(tmp[i])); + this->num_parents_per_node_.push_back(std::stoi(tmp[i])); } catch (std::invalid_argument& ia) { throw std::invalid_argument(std::string("Invalid upper level node number:") + tmp[i]); } @@ -410,7 +410,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster) } for (size_t i = 0; i < tmp.size(); i++) { try { - this->lowerLevelPortsNumber_.push_back(std::stoi(tmp[i])); + this->num_port_lower_level_.push_back(std::stoi(tmp[i])); } catch (std::invalid_argument& ia) { throw std::invalid_argument(std::string("Invalid lower level port number:") + tmp[i]); } @@ -418,7 +418,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster) this->cluster_ = cluster; } -void FatTreeZone::generateDotFile(const std::string& filename) const +void FatTreeZone::generate_dot_file(const std::string& filename) const { std::ofstream file; file.open(filename, std::ios::out | std::ios::trunc); diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index b3aa1105b2..20c340db13 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -14,9 +14,9 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf"); -#define TO_FLOYD_COST(i, j) (costTable_)[(i) + (j)*table_size] -#define TO_FLOYD_PRED(i, j) (predecessorTable_)[(i) + (j)*table_size] -#define TO_FLOYD_LINK(i, j) (linkTable_)[(i) + (j)*table_size] +#define TO_FLOYD_COST(i, j) (cost_table_)[(i) + (j)*table_size] +#define TO_FLOYD_PRED(i, j) (predecessor_table_)[(i) + (j)*table_size] +#define TO_FLOYD_LINK(i, j) (link_table_)[(i) + (j)*table_size] namespace simgrid { namespace kernel { @@ -24,24 +24,24 @@ namespace routing { FloydZone::FloydZone(NetZone* father, std::string name) : RoutedZone(father, name) { - predecessorTable_ = nullptr; - costTable_ = nullptr; - linkTable_ = nullptr; + predecessor_table_ = nullptr; + cost_table_ = nullptr; + link_table_ = nullptr; } FloydZone::~FloydZone() { - if (linkTable_ == nullptr) // Dealing with a parse error in the file? + if (link_table_ == nullptr) // Dealing with a parse error in the file? return; unsigned int table_size = getTableSize(); /* Delete link_table */ for (unsigned int i = 0; i < table_size; i++) for (unsigned int j = 0; j < table_size; j++) delete TO_FLOYD_LINK(i, j); - delete[] linkTable_; + delete[] link_table_; - delete[] predecessorTable_; - delete[] costTable_; + delete[] predecessor_table_; + delete[] cost_table_; } void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat) @@ -94,11 +94,11 @@ void FloydZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::NetPoi addRouteCheckParams(src, dst, gw_src, gw_dst, link_list, symmetrical); - if (not linkTable_) { + if (not link_table_) { /* Create Cost, Predecessor and Link tables */ - costTable_ = new double[table_size * table_size]; /* link cost from host to host */ - predecessorTable_ = new int[table_size * table_size]; /* predecessor host numbers */ - linkTable_ = new RouteCreationArgs*[table_size * table_size]; /* actual link between src and dst */ + cost_table_ = new double[table_size * table_size]; /* link cost from host to host */ + predecessor_table_ = new int[table_size * table_size]; /* predecessor host numbers */ + link_table_ = new RouteCreationArgs*[table_size * table_size]; /* actual link between src and dst */ /* Initialize costs and predecessors */ for (unsigned int i = 0; i < table_size; i++) @@ -160,11 +160,11 @@ void FloydZone::seal() /* set the size of table routing */ unsigned int table_size = getTableSize(); - if (not linkTable_) { + if (not link_table_) { /* Create Cost, Predecessor and Link tables */ - costTable_ = new double[table_size * table_size]; /* link cost from host to host */ - predecessorTable_ = new int[table_size * table_size]; /* predecessor host numbers */ - linkTable_ = new RouteCreationArgs*[table_size * table_size]; /* actual link between src and dst */ + cost_table_ = new double[table_size * table_size]; /* link cost from host to host */ + predecessor_table_ = new int[table_size * table_size]; /* predecessor host numbers */ + link_table_ = new RouteCreationArgs*[table_size * table_size]; /* actual link between src and dst */ /* Initialize costs and predecessors */ for (unsigned int i = 0; i < table_size; i++) diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index a0af248b3d..5f4b90c0db 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); -#define TO_ROUTE_FULL(i, j) routingTable_[(i) + (j)*table_size] +#define TO_ROUTE_FULL(i, j) routing_table_[(i) + (j)*table_size] namespace simgrid { namespace kernel { @@ -24,8 +24,8 @@ void FullZone::seal() unsigned int table_size = getTableSize(); /* Create table if needed */ - if (not routingTable_) - routingTable_ = new RouteCreationArgs*[table_size * table_size](); + if (not routing_table_) + routing_table_ = new RouteCreationArgs*[table_size * table_size](); /* Add the loopback if needed */ if (surf_network_model->loopback_ && hierarchy_ == RoutingMode::base) { @@ -42,13 +42,13 @@ void FullZone::seal() FullZone::~FullZone() { - if (routingTable_) { + if (routing_table_) { unsigned int table_size = getTableSize(); /* Delete routing table */ for (unsigned int i = 0; i < table_size; i++) for (unsigned int j = 0; j < table_size; j++) delete TO_ROUTE_FULL(i, j); - delete[] routingTable_; + delete[] routing_table_; } } @@ -78,8 +78,8 @@ void FullZone::addRoute(kernel::routing::NetPoint* src, kernel::routing::NetPoin unsigned int table_size = getTableSize(); - if (not routingTable_) - routingTable_ = new RouteCreationArgs*[table_size * table_size](); + if (not routing_table_) + routing_table_ = new RouteCreationArgs*[table_size * table_size](); /* Check that the route does not already exist */ if (gw_dst) // inter-zone route (to adapt the error message, if any) diff --git a/src/kernel/routing/NetPoint.cpp b/src/kernel/routing/NetPoint.cpp index bc904a0aab..c15f13aa47 100644 --- a/src/kernel/routing/NetPoint.cpp +++ b/src/kernel/routing/NetPoint.cpp @@ -16,7 +16,7 @@ namespace routing { simgrid::xbt::signal NetPoint::onCreation; NetPoint::NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p) - : name_(name), componentType_(componentType), netzone_(netzone_p) + : name_(name), component_type_(componentType), netzone_(netzone_p) { if (netzone_p != nullptr) id_ = netzone_p->addComponent(this); diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 3597560dab..f980bba4c8 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -37,7 +37,7 @@ NetZoneImpl::NetZoneImpl(NetZone* father, std::string name) : NetZone(father, na NetZoneImpl::~NetZoneImpl() { - for (auto const& kv : bypassRoutes_) + for (auto const& kv : bypass_routes_) delete kv.second; simgrid::s4u::Engine::getInstance()->netpointUnregister(netpoint_); @@ -73,14 +73,14 @@ void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, gw_dst->getCname()); xbt_assert(not link_list.empty(), "Bypass route between %s@%s and %s@%s cannot be empty.", src->getCname(), gw_src->getCname(), dst->getCname(), gw_dst->getCname()); - xbt_assert(bypassRoutes_.find({src, dst}) == bypassRoutes_.end(), + xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(), "The bypass route between %s@%s and %s@%s already exists.", src->getCname(), gw_src->getCname(), dst->getCname(), gw_dst->getCname()); } else { XBT_DEBUG("Load bypassRoute from %s to %s", src->getCname(), dst->getCname()); xbt_assert(not link_list.empty(), "Bypass route between %s and %s cannot be empty.", src->getCname(), dst->getCname()); - xbt_assert(bypassRoutes_.find({src, dst}) == bypassRoutes_.end(), + xbt_assert(bypass_routes_.find({src, dst}) == bypass_routes_.end(), "The bypass route between %s and %s already exists.", src->getCname(), dst->getCname()); } @@ -90,7 +90,7 @@ void NetZoneImpl::addBypassRoute(NetPoint* src, NetPoint* dst, NetPoint* gw_src, newRoute->links.push_back(link); /* Store it */ - bypassRoutes_.insert({{src, dst}, newRoute}); + bypass_routes_.insert({{src, dst}, newRoute}); } /** @brief Get the common ancestor and its first children in each line leading to src and dst @@ -207,13 +207,13 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, /* OUT */ std::vector& links, double* latency) { // If never set a bypass route return nullptr without any further computations - if (bypassRoutes_.empty()) + if (bypass_routes_.empty()) return false; /* Base case, no recursion is needed */ if (dst->netzone() == this && src->netzone() == this) { - if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) { - BypassRoute* bypassedRoute = bypassRoutes_.at({src, dst}); + if (bypass_routes_.find({src, dst}) != bypass_routes_.end()) { + BypassRoute* bypassedRoute = bypass_routes_.at({src, dst}); for (surf::LinkImpl* const& link : bypassedRoute->links) { links.push_back(link); if (latency) @@ -262,16 +262,16 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, for (int i = 0; i < max; i++) { if (i <= max_index_src && max <= max_index_dst) { key = {path_src.at(i)->netpoint_, path_dst.at(max)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } } if (max <= max_index_src && i <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(i)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } @@ -283,8 +283,8 @@ bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst, if (max <= max_index_src && max <= max_index_dst) { key = {path_src.at(max)->netpoint_, path_dst.at(max)->netpoint_}; - auto bpr = bypassRoutes_.find(key); - if (bpr != bypassRoutes_.end()) { + auto bpr = bypass_routes_.find(key); + if (bpr != bypass_routes_.end()) { bypassedRoute = bpr->second; break; } diff --git a/src/s4u/s4u_comm.cpp b/src/s4u/s4u_comm.cpp index be0db14e17..f2ab1fd795 100644 --- a/src/s4u/s4u_comm.cpp +++ b/src/s4u/s4u_comm.cpp @@ -80,15 +80,12 @@ Activity* Comm::start() xbt_assert(state_ == inited); if (srcBuff_ != nullptr) { // Sender side - pimpl_ = simcall_comm_isend(sender_, mailbox_->getImpl(), remains_, rate_, - srcBuff_, srcBuffSize_, - matchFunction_, cleanFunction_, copyDataFunction_, - userData_, detached_); + pimpl_ = simcall_comm_isend(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_, + cleanFunction_, copyDataFunction_, user_data_, detached_); } else if (dstBuff_ != nullptr) { // Receiver side xbt_assert(not detached_, "Receive cannot be detached"); - pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, - matchFunction_, copyDataFunction_, - userData_, rate_); + pimpl_ = simcall_comm_irecv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, + copyDataFunction_, user_data_, rate_); } else { xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver"); @@ -118,10 +115,10 @@ Activity* Comm::wait(double timeout) case inited: // It's not started yet. Do it in one simcall if (srcBuff_ != nullptr) { simcall_comm_send(sender_, mailbox_->getImpl(), remains_, rate_, srcBuff_, srcBuffSize_, matchFunction_, - copyDataFunction_, userData_, timeout); + copyDataFunction_, user_data_, timeout); } else { // Receiver simcall_comm_recv(receiver_, mailbox_->getImpl(), dstBuff_, &dstBuffSize_, matchFunction_, copyDataFunction_, - userData_, timeout, rate_); + user_data_, timeout, rate_); } state_ = finished; return this; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index d6401ba723..80ce1a6c37 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -250,7 +250,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster //call the cluster function that adds the others links if (cluster->topology == simgrid::kernel::routing::ClusterTopology::FAT_TREE) { - static_cast(current_as)->addProcessingNode(i); + static_cast(current_as)->add_processing_node(i); } else { current_as->create_links_for_node(cluster, i, rankId, current_as->nodePositionWithLimiter(rankId)); } -- 2.20.1