From 9d4d25d5957e22ffc65b353ccf907a59332d3e28 Mon Sep 17 00:00:00 2001 From: Fred Suter Date: Tue, 18 Oct 2022 08:50:28 -0400 Subject: [PATCH] Have the disk model be part of the host models --- src/kernel/routing/NetZoneImpl.cpp | 12 ++++++------ src/surf/host_clm03.cpp | 1 + src/surf/ptask_L07.cpp | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index 18d00d930d..92b52b521f 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -33,8 +33,8 @@ static void surf_config_models_setup() std::string disk_model_name = simgrid::config::get_value("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")) { + if ((not simgrid::config::is_default("network/model") || not simgrid::config::is_default("cpu/model") || + not simgrid::config::is_default("disk/model")) && simgrid::config::is_default("host/model")) { host_model_name = "compound"; simgrid::config::set_value("host/model", host_model_name); } @@ -42,11 +42,15 @@ static void surf_config_models_setup() XBT_DEBUG("host model: %s", host_model_name.c_str()); if (host_model_name == "compound") { xbt_enforce(not cpu_model_name.empty(), "Set a cpu model to use with the 'compound' host model"); + xbt_enforce(not disk_model_name.empty(), "Set a disk model to use with the 'compound' host model"); xbt_enforce(not network_model_name.empty(), "Set a network model to use with the 'compound' host model"); const auto* cpu_model = find_model_description(surf_cpu_model_description, cpu_model_name); cpu_model->model_init_preparse(); + const auto* disk_model = find_model_description(surf_disk_model_description, disk_model_name); + disk_model->model_init_preparse(); + const auto* network_model = find_model_description(surf_network_model_description, network_model_name); network_model->model_init_preparse(); } @@ -61,10 +65,6 @@ static void surf_config_models_setup() * 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"); - const auto* disk_model = find_model_description(surf_disk_model_description, disk_model_name); - disk_model->model_init_preparse(); } xbt::signaladd_model(host_model); engine->get_netzone_root()->set_host_model(host_model); surf_cpu_model_init_Cas01(); + surf_disk_model_init_S19(); surf_network_model_init_LegrandVelho(); } diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 60dddcd8cb..bee5736d00 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -57,6 +57,8 @@ HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostMode auto cpu_model = std::make_shared("Cpu_Ptask", this, sys); engine->add_model(cpu_model); engine->get_netzone_root()->set_cpu_pm_model(cpu_model); + + surf_disk_model_init_S19(); } CpuL07Model::CpuL07Model(const std::string& name, HostL07Model* hmodel, lmm::System* sys) -- 2.20.1