]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/ptask_L07.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
System: fix modified_set_ when selective_update is active
[simgrid.git] / src / surf / ptask_L07.cpp
index 9039cff2055547c7b272da9a3da55cf986ccb171..a8deb27fffc20b7dcb3bdae054cb377fa26a18ee 100644 (file)
@@ -7,8 +7,11 @@
 #include <simgrid/s4u/Engine.hpp>
 #include <xbt/config.hpp>
 
+#include "simgrid/config.h"
 #include "src/kernel/EngineImpl.hpp"
+#if SIMGRID_HAVE_EIGEN3
 #include "src/kernel/lmm/bmf.hpp"
+#endif
 #include "src/kernel/resource/profile/Event.hpp"
 #include "src/surf/ptask_L07.hpp"
 
@@ -24,7 +27,7 @@ void surf_host_model_init_ptask_L07()
 {
   XBT_CINFO(xbt_cfg, "Switching to the L07 model to handle parallel tasks.");
 
-  auto* system    = new simgrid::kernel::lmm::FairBottleneck(true /* selective update */);
+  auto* system    = simgrid::kernel::lmm::System::build("fairbottleneck", true /* selective update */);
   auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(host_model);
@@ -33,14 +36,18 @@ void surf_host_model_init_ptask_L07()
 
 void surf_host_model_init_ptask_BMF()
 {
+#if SIMGRID_HAVE_EIGEN3
   XBT_CINFO(xbt_cfg, "Switching to the BMF model to handle parallel tasks.");
 
   bool select     = simgrid::config::get_value<bool>("bmf/selective-update");
-  auto* system    = new simgrid::kernel::lmm::BmfSystem(select);
+  auto* system    = simgrid::kernel::lmm::System::build("bmf", select);
   auto host_model = std::make_shared<simgrid::kernel::resource::HostL07Model>("Host_Ptask", system);
   auto* engine    = simgrid::kernel::EngineImpl::get_instance();
   engine->add_model(host_model);
   engine->get_netzone_root()->set_host_model(host_model);
+#else
+  xbt_die("Cannot use the BMF ptask model without installing Eigen3.");
+#endif
 }
 
 namespace simgrid {