Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'wifi_clean' into 'master'
[simgrid.git] / src / surf / host_clm03.cpp
index 185b5d2b18491c0e68c28929b66c8fa0673ffb45..0005ed40b6110640e73c390f15c16fcd70b9eecd 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/resource/NetworkModel.hpp"
 #include "src/surf/host_clm03.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_host);
@@ -32,9 +33,7 @@ void surf_host_model_init_compound()
   engine->get_netzone_root()->set_host_model(host_model);
 }
 
-namespace simgrid {
-namespace kernel {
-namespace resource {
+namespace simgrid::kernel::resource {
 
 double HostCLM03Model::next_occurring_event(double /*now*/)
 {
@@ -94,6 +93,11 @@ Action* HostCLM03Model::execute_parallel(const std::vector<s4u::Host*>& host_lis
   return action;
 }
 
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+Action* HostCLM03Model::execute_thread(const s4u::Host* host, double flops_amount, int thread_count)
+{
+  auto cpu = host->get_cpu();
+  /* Create a single action whose cost is thread_count * flops_amount and that requests thread_count cores. */
+  return cpu->execution_start(thread_count * flops_amount, thread_count, -1);
+}
+
+} // namespace simgrid::kernel::resource