@@ -1138,6 +1138,7 @@ def __handle_task_cancellation(self, event: Event) -> None:
1138
1138
f"{ event .task .timestamp } ,{ event .task .id } ,{ event .task .task_graph } ,"
1139
1139
f"{ event .task .slowest_execution_strategy .runtime .time } "
1140
1140
)
1141
+ self .log_stats (event .time )
1141
1142
1142
1143
# If the task already had a placement, we remove the placement from our queue.
1143
1144
if event .task .id in self ._future_placement_events :
@@ -1255,8 +1256,12 @@ def __handle_task_finished(self, event: Event) -> None:
1255
1256
f"{ task_graph .deadline .to (EventTime .Unit .US ).time } ,"
1256
1257
f"{ tardiness .to (EventTime .Unit .US ).time } "
1257
1258
)
1259
+
1258
1260
if task_graph .deadline < event .time :
1259
1261
self ._missed_task_graph_deadlines += 1
1262
+
1263
+ self .log_stats (event .time )
1264
+
1260
1265
self ._logger .info (
1261
1266
"[%s] Finished the TaskGraph %s with a deadline %s at the "
1262
1267
"completion of the task %s with a tardiness of %s." ,
@@ -1764,8 +1769,7 @@ def __handle_event(self, event: Event) -> bool:
1764
1769
self .__handle_scheduler_finish (event )
1765
1770
elif event .event_type == EventType .SIMULATOR_END :
1766
1771
# End of the simulator loop.
1767
- assert event .time == self ._simulator_time
1768
- self .log_stats ()
1772
+ self .log_stats (event .time )
1769
1773
self ._csv_logger .debug (
1770
1774
f"{ event .time .time } ,SIMULATOR_END" ,
1771
1775
)
@@ -1787,7 +1791,9 @@ def __step(self, step_size: EventTime = EventTime(1, EventTime.Unit.US)) -> None
1787
1791
the clock (in us).
1788
1792
"""
1789
1793
if step_size < EventTime .zero ():
1790
- raise ValueError (f"Simulator cannot step backwards { step_size } " )
1794
+ raise ValueError (
1795
+ f"[{ self ._simulator_time } ] Simulator cannot step backwards { step_size } "
1796
+ )
1791
1797
1792
1798
# Step the simulator for the required steps and construct TASK_FINISHED events
1793
1799
# for any tasks that were able to complete their execution.
@@ -2156,9 +2162,9 @@ def __log_utilization(self, sim_time: EventTime):
2156
2162
f"{ worker_pool_resources .get_available_quantity (resource )} "
2157
2163
)
2158
2164
2159
- def log_stats (self ):
2165
+ def log_stats (self , sim_time : EventTime ):
2160
2166
self ._csv_logger .debug (
2161
- f"{ self . _simulator_time .time } ,LOG_STATS,{ self ._finished_tasks } ,"
2167
+ f"{ sim_time .time } ,LOG_STATS,{ self ._finished_tasks } ,"
2162
2168
f"{ self ._cancelled_tasks } ,{ self ._missed_task_deadlines } ,"
2163
2169
f"{ self ._finished_task_graphs } ,"
2164
2170
f"{ len (self ._workload .get_cancelled_task_graphs ())} ,"
0 commit comments