From 0e1e51d1ee7392d22336e9bf0067a895741e8866 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 9 Sep 2022 18:47:02 +0200 Subject: Improve debug --- esds/simulator.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'esds/simulator.py') diff --git a/esds/simulator.py b/esds/simulator.py index fb52fec..adb2011 100644 --- a/esds/simulator.py +++ b/esds/simulator.py @@ -375,9 +375,6 @@ class Simulator: # Synchronize blocking api calls for node in self.nodes: self.sync_node_blocking(node) - # Generate debug logs - if debug: - self.debug.debug() # Simulation end if len(self.events) <= 0 or len(self.events) == 1 and self.events[0,0] == 3: # Notify nodes that wait for the end of the simulation @@ -390,7 +387,9 @@ class Simulator: else: node.rqueue.put(("sim_end",RCode.SUCCESS)) break # End the event processing loop - + # Generate debug logs + if debug: + self.debug.debug() # Update simulation time self.time=self.events[0,1] self.time_truncated=format(self.time,self.precision) # refresh truncated time @@ -458,3 +457,7 @@ class Simulator: ##### Simulation ends self.log("Simulation ends") + + ##### Final debug call + if debug: + self.debug.debug() -- cgit v1.2.3