Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Have the disk model be part of the host models
authorFred Suter <suterf@ornl.gov>
Tue, 18 Oct 2022 12:50:28 +0000 (08:50 -0400)
committerFred Suter <suterf@ornl.gov>
Fri, 28 Oct 2022 11:39:36 +0000 (07:39 -0400)
src/kernel/routing/NetZoneImpl.cpp
src/surf/host_clm03.cpp
src/surf/ptask_L07.cpp

index 18d00d9..92b52b5 100644 (file)
@@ -33,8 +33,8 @@ static void surf_config_models_setup()
   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")) {
+  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::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
index 0005ed4..03dd2a9 100644 (file)
@@ -22,6 +22,7 @@ void surf_host_model_init_current_default()
   engine->add_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();
 }
 
index 60dddcd..bee5736 100644 (file)
@@ -57,6 +57,8 @@ HostL07Model::HostL07Model(const std::string& name, lmm::System* sys) : HostMode
   auto cpu_model = std::make_shared<CpuL07Model>("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)