Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
delete Timer when shutting down EngineImpl
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 25 May 2021 13:17:58 +0000 (15:17 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Tue, 25 May 2021 13:17:58 +0000 (15:17 +0200)
src/kernel/EngineImpl.cpp
src/simix/smx_global.cpp

index 3cb1155..926bdb9 100644 (file)
@@ -6,6 +6,7 @@
 #include "src/kernel/EngineImpl.hpp"
 #include "mc/mc.h"
 #include "simgrid/Exception.hpp"
+#include "simgrid/kernel/Timer.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
 #include "simgrid/s4u/Host.hpp"
@@ -15,6 +16,7 @@
 #include "src/mc/mc_record.hpp"
 #include "src/mc/mc_replay.hpp"
 #include "src/simix/smx_private.hpp"
+#include "src/smpi/include/smpi_actor.hpp"
 #include "src/surf/network_interface.hpp"
 #include "src/surf/xml/platf.hpp" // FIXME: KILLME. There must be a better way than mimicking XML here
 
@@ -27,6 +29,12 @@ config::Flag<double> cfg_breakpoint{"debug/breakpoint",
                                     "When non-negative, raise a SIGTRAP after given (simulated) time", -1.0};
 EngineImpl::~EngineImpl()
 {
+
+  while (not timer::kernel_timers().empty()) {
+    delete timer::kernel_timers().top().second;
+    timer::kernel_timers().pop();
+  }
+
   /* Since hosts_ is a std::map, the hosts are destroyed in the lexicographic order, which ensures that the output is
    * reproducible.
    */
index d490945..5831192 100644 (file)
@@ -236,10 +236,6 @@ void SIMIX_clean()
   /* Exit the SIMIX network module */
   SIMIX_mailbox_exit();
 
-  while (not simgrid::kernel::timer::kernel_timers().empty()) {
-    delete simgrid::kernel::timer::kernel_timers().top().second;
-    simgrid::kernel::timer::kernel_timers().pop();
-  }
 
   /* Let's free maestro now */
   delete simix_global->maestro_;