+ XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id.c_str(), cluster->speeds.front());
+
+ s_sg_platf_host_cbarg_t host;
+ host.id = host_id.c_str();
+ if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
+ host.properties = new std::map<std::string, std::string>;
+
+ for (auto const& elm : *cluster->properties)
+ host.properties->insert({elm.first, elm.second});
+ }
+
+ host.speed_per_pstate = cluster->speeds;
+ host.pstate = 0;
+ host.core_amount = cluster->core_amount;
+ host.coord = "";
+ sg_platf_new_host(&host);
+ XBT_DEBUG("</host>");
+
+ XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id.c_str(), cluster->bw, cluster->lat);
+
+ // All links are saved in a matrix;
+ // every row describes a single node; every node may have multiple links.
+ // the first column may store a link from x to x if p_has_loopback is set
+ // the second column may store a limiter link if p_has_limiter is set
+ // other columns are to store one or more link for the node
+
+ //add a loopback link
+ simgrid::surf::LinkImpl* linkUp = nullptr;
+ simgrid::surf::LinkImpl* linkDown = nullptr;
+ if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){
+ std::string tmp_link = link_id + "_loopback";
+ XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
+
+ LinkCreationArgs link;
+ link.id = tmp_link;
+ link.bandwidth = cluster->loopback_bw;
+ link.latency = cluster->loopback_lat;
+ link.policy = SURF_LINK_FATPIPE;
+ sg_platf_new_link(&link);
+ linkUp = simgrid::surf::LinkImpl::byName(tmp_link);
+ linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
+
+ auto as_cluster = static_cast<ClusterZone*>(current_as);
+ as_cluster->privateLinks_.insert({as_cluster->nodePosition(rankId), {linkUp, linkDown}});
+ }
+
+ //add a limiter link (shared link to account for maximal bandwidth of the node)
+ linkUp = nullptr;
+ linkDown = nullptr;
+ if(cluster->limiter_link > 0){
+ std::string tmp_link = std::string(link_id) + "_limiter";
+ XBT_DEBUG("<limiter\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->limiter_link);
+
+ LinkCreationArgs link;
+ link.id = tmp_link;
+ link.bandwidth = cluster->limiter_link;
+ link.latency = 0;
+ link.policy = SURF_LINK_SHARED;
+ sg_platf_new_link(&link);
+ linkDown = simgrid::surf::LinkImpl::byName(tmp_link);
+ linkUp = linkDown;
+ current_as->privateLinks_.insert({current_as->nodePositionWithLoopback(rankId), {linkUp, linkDown}});
+ }
+
+ //call the cluster function that adds the others links
+ if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
+ static_cast<FatTreeZone*>(current_as)->addProcessingNode(i);
+ } else {
+ current_as->create_links_for_node(cluster, i, rankId, current_as->nodePositionWithLimiter(rankId));
+ }
+ rankId++;
+ }
+ delete cluster->properties;
+
+ // Add a router.
+ XBT_DEBUG(" ");
+ XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id.c_str());
+ if (cluster->router_id.empty()) {
+ std::string newid = std::string(cluster->prefix) + cluster->id + "_router" + cluster->suffix;
+ current_as->router_ = sg_platf_new_router(newid, NULL);
+ } else {
+ current_as->router_ = sg_platf_new_router(cluster->router_id, NULL);