-void sg_platf_new_peer(const simgrid::kernel::routing::PeerCreationArgs* peer)
-{
- auto* zone = dynamic_cast<simgrid::kernel::routing::VivaldiZone*>(current_routing);
- xbt_assert(zone, "<peer> tag can only be used in Vivaldi netzones.");
-
- std::vector<double> speed_per_pstate;
- speed_per_pstate.push_back(peer->speed);
- simgrid::s4u::Host* host = zone->create_host(peer->id, speed_per_pstate, 1);
-
- zone->set_peer_link(host->get_netpoint(), peer->bw_in, peer->bw_out, peer->coord);
-
- /* Change from the defaults */
- if (peer->state_trace)
- host->set_state_profile(peer->state_trace);
- if (peer->speed_trace)
- host->set_speed_profile(peer->speed_trace);
- simgrid::s4u::Host::on_creation(*host); // notify the signal
-}
-
-/* Pick the right models for CPU, net and host, and call their model_init_preparse */
-static void surf_config_models_setup()
-{
- std::string host_model_name = simgrid::config::get_value<std::string>("host/model");
- std::string network_model_name = simgrid::config::get_value<std::string>("network/model");
- std::string cpu_model_name = simgrid::config::get_value<std::string>("cpu/model");
- std::string disk_model_name = simgrid::config::get_value<std::string>("disk/model");
-
- /* The compound host model is needed when using non-default net/cpu models */
- if ((not simgrid::config::is_default("network/model") || not simgrid::config::is_default("cpu/model")) &&
- simgrid::config::is_default("host/model")) {
- host_model_name = "compound";
- simgrid::config::set_value("host/model", host_model_name);
- }
-
- XBT_DEBUG("host model: %s", host_model_name.c_str());
- if (host_model_name == "compound") {
- xbt_assert(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model");
- xbt_assert(not network_model_name.empty(), "Set a network model to use with the 'compound' host model");
-
- int cpu_id = find_model_description(surf_cpu_model_description, cpu_model_name);
- surf_cpu_model_description[cpu_id].model_init_preparse();
-
- int network_id = find_model_description(surf_network_model_description, network_model_name);
- surf_network_model_description[network_id].model_init_preparse();
- }
-
- XBT_DEBUG("Call host_model_init");
- int host_id = find_model_description(surf_host_model_description, host_model_name);
- surf_host_model_description[host_id].model_init_preparse();
-
- XBT_DEBUG("Call vm_model_init");
- /* ideally we should get back the pointer to CpuModel from model_init_preparse(), but this
- * requires changing the declaration of surf_cpu_model_description.
- * To be reviewed in the future */
- surf_vm_model_init_HL13(
- simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get());
-
- XBT_DEBUG("Call disk_model_init");
- int disk_id = find_model_description(surf_disk_model_description, disk_model_name);
- surf_disk_model_description[disk_id].model_init_preparse();
-}
-