Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / resource / VirtualMachineImpl.cpp
index 854aafc..8a3365a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2013-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. */
@@ -71,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();
   }
 }
@@ -86,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();
   }
 }