+ const simgrid::s4u::Disk* new_disk = routing_get_current()
+ ->create_disk(disk->id, disk->read_bw, disk->write_bw)
+ ->set_host(current_host)
+ ->set_properties(disk->properties)
+ ->seal();
+
+ current_host->add_disk(new_disk);
+}
+
+/** @brief Auxiliary function to create hosts */
+static std::pair<simgrid::kernel::routing::NetPoint*, simgrid::kernel::routing::NetPoint*>
+sg_platf_cluster_create_host(const simgrid::kernel::routing::ClusterCreationArgs* cluster, simgrid::s4u::NetZone* zone,
+ const std::vector<unsigned int>& /*coord*/, int id)
+{
+ xbt_assert(static_cast<unsigned long>(id) < cluster->radicals.size(),
+ "Zone(%s): error when creating host number %d in the zone. Insufficient number of radicals available "
+ "(total = %zu). Check the 'radical' parameter in XML",
+ cluster->id.c_str(), id, cluster->radicals.size());
+
+ std::string host_id = std::string(cluster->prefix) + std::to_string(cluster->radicals[id]) + cluster->suffix;
+ XBT_DEBUG("Cluster: creating host=%s speed=%f", host_id.c_str(), cluster->speeds.front());
+ const simgrid::s4u::Host* host = zone->create_host(host_id, cluster->speeds)
+ ->set_core_count(cluster->core_amount)
+ ->set_properties(cluster->properties)
+ ->seal();
+ return std::make_pair(host->get_netpoint(), nullptr);
+}
+
+/** @brief Auxiliary function to create loopback links */
+static simgrid::s4u::Link*
+sg_platf_cluster_create_loopback(const simgrid::kernel::routing::ClusterCreationArgs* cluster,
+ simgrid::s4u::NetZone* zone, const std::vector<unsigned int>& /*coord*/, int id)
+{
+ xbt_assert(static_cast<unsigned long>(id) < cluster->radicals.size(),
+ "Zone(%s): error when creating loopback for host number %d in the zone. Insufficient number of radicals "
+ "available "
+ "(total = %zu). Check the 'radical' parameter in XML",
+ cluster->id.c_str(), id, cluster->radicals.size());
+
+ std::string link_id = std::string(cluster->id) + "_link_" + std::to_string(cluster->radicals[id]) + "_loopback";
+ XBT_DEBUG("Cluster: creating loopback link=%s bw=%f", link_id.c_str(), cluster->loopback_bw);
+
+ simgrid::s4u::Link* loopback = zone->create_link(link_id, cluster->loopback_bw)
+ ->set_sharing_policy(simgrid::s4u::Link::SharingPolicy::FATPIPE)
+ ->set_latency(cluster->loopback_lat)
+ ->seal();
+ return loopback;
+}
+
+/** @brief Auxiliary function to create limiter links */
+static simgrid::s4u::Link* sg_platf_cluster_create_limiter(const simgrid::kernel::routing::ClusterCreationArgs* cluster,
+ simgrid::s4u::NetZone* zone,
+ const std::vector<unsigned int>& /*coord*/, int id)
+{
+ std::string link_id = std::string(cluster->id) + "_link_" + std::to_string(id) + "_limiter";
+ XBT_DEBUG("Cluster: creating limiter link=%s bw=%f", link_id.c_str(), cluster->limiter_link);
+
+ simgrid::s4u::Link* limiter = zone->create_link(link_id, cluster->limiter_link)->seal();
+ return limiter;
+}
+
+/** @brief Create Torus, Fat-Tree and Dragonfly clusters */
+static void sg_platf_new_cluster_hierarchical(const simgrid::kernel::routing::ClusterCreationArgs* cluster)
+{
+ using namespace std::placeholders;