- this->routers_[i]->myNodes_ = static_cast<surf::LinkImpl**>(
- xbt_malloc0(numLinksperLink_ * this->numNodesPerBlade_ * sizeof(surf::LinkImpl*)));
- this->routers_[i]->greenLinks_ =
- static_cast<surf::LinkImpl**>(xbt_malloc0(this->numBladesPerChassis_ * sizeof(surf::LinkImpl*)));
- this->routers_[i]->blackLinks_ =
- static_cast<surf::LinkImpl**>(xbt_malloc0(this->numChassisPerGroup_ * sizeof(surf::LinkImpl*)));
-
- for (unsigned int j = 0; j < numLinksperLink_ * this->numNodesPerBlade_; j += numLinksperLink_) {
- std::string id = "local_link_from_router_"+ std::to_string(i) + "_to_node_" +
- std::to_string(j / numLinksperLink_) + "_" + std::to_string(uniqueId);
- this->createLink(id, 1, &linkup, &linkdown);
-
- if (this->cluster_->sharing_policy == SURF_LINK_FULLDUPLEX) {
- this->routers_[i]->myNodes_[j] = linkup;
- this->routers_[i]->myNodes_[j + 1] = linkdown;
- } else {
- this->routers_[i]->myNodes_[j] = linkup;
- }
+ this->routers_[i]->my_nodes_ = new resource::LinkImpl*[num_links_per_link_ * this->num_nodes_per_blade_];
+ this->routers_[i]->green_links_ = new resource::LinkImpl*[this->num_blades_per_chassis_];
+ this->routers_[i]->black_links_ = new resource::LinkImpl*[this->num_chassis_per_group_];
+
+ for (unsigned int j = 0; j < num_links_per_link_ * this->num_nodes_per_blade_; j += num_links_per_link_) {
+ std::string id = "local_link_from_router_" + std::to_string(i) + "_to_node_" +
+ std::to_string(j / num_links_per_link_) + "_" + std::to_string(uniqueId);
+ this->create_link(id, 1, &linkup, &linkdown);
+
+ this->routers_[i]->my_nodes_[j] = linkup;
+ if (this->sharing_policy_ == s4u::Link::SharingPolicy::SPLITDUPLEX)
+ this->routers_[i]->my_nodes_[j + 1] = linkdown;
+