Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Completely revise the way to deal with Streamed I/Os
[simgrid.git] / src / kernel / resource / VirtualMachineImpl.cpp
index e698ccb..cda3fdb 100644 (file)
@@ -39,8 +39,7 @@ void surf_vm_model_init_HL13(simgrid::kernel::resource::CpuModel* cpu_pm_model)
 namespace simgrid {
 template class xbt::Extendable<kernel::resource::VirtualMachineImpl>;
 
-namespace kernel {
-namespace resource {
+namespace kernel::resource {
 
 /*********
  * Model *
@@ -72,7 +71,8 @@ static void add_active_exec(s4u::Exec const& task)
   const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(task.get_host());
   if (vm != nullptr) {
     VirtualMachineImpl* vm_impl = vm->get_vm_impl();
-    vm_impl->add_active_exec();
+    for (int i = 1; i <= task.get_thread_count(); i++)
+      vm_impl->add_active_exec();
     vm_impl->update_action_weight();
   }
 }
@@ -87,7 +87,8 @@ static void remove_active_exec(s4u::Activity const& task)
   const s4u::VirtualMachine* vm = dynamic_cast<s4u::VirtualMachine*>(exec->get_host());
   if (vm != nullptr) {
     VirtualMachineImpl* vm_impl = vm->get_vm_impl();
-    vm_impl->remove_active_exec();
+    for (int i = 1; i <= exec->get_thread_count(); i++)
+      vm_impl->remove_active_exec();
     vm_impl->update_action_weight();
   }
 }
@@ -411,9 +412,8 @@ void VirtualMachineImpl::end_migration()
 void VirtualMachineImpl::seal()
 {
   HostImpl::seal();
-  s4u::VirtualMachine::on_creation(*get_iface());
+  s4u::VirtualMachine::on_vm_creation(*get_iface());
 }
 
-} // namespace resource
-} // namespace kernel
+} // namespace kernel::resource
 } // namespace simgrid