Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Objectifies the CPU model
[simgrid.git] / src / surf / cpu_cas01.cpp
index 62e8aef..83aa5f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2009-2023. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -40,8 +40,7 @@ static simgrid::config::Flag<std::string> cfg_cpu_solver("cpu/solver", "Set line
 /*********
  * Model *
  *********/
-void surf_cpu_model_init_Cas01()
-{
+SIMGRID_REGISTER_CPU_MODEL(Cas01, "Simplistic CPU model (time=size/speed)", []() {
   if (cpu_optim_opt == "TI") {
     simgrid::kernel::resource::CpuTiModel::create_pm_models();
     return;
@@ -51,7 +50,7 @@ void surf_cpu_model_init_Cas01()
   auto* engine      = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(cpu_model_pm);
   engine->get_netzone_root()->set_cpu_pm_model(cpu_model_pm);
-}
+});
 
 namespace simgrid::kernel::resource {