def run(self, app, tracelog): settings = exportri.run_assistant(app, tracelog) if settings is None: return ri = ExportRunInstance(tracelog, *settings) tracelog.execute_all_events(ri) return extensions.Source("Tracelog Table", datatypes.t_table, ri.get_table())
def _preprocess(self): # Set time offsets starttime = min([ trace.get_init_time() for trace in self.traces ]) for trace in self.traces: trace.time_offset = trace.get_init_time() - starttime trace_times = [ trace.get_next_event_time() for trace in self.traces ] if self.export_data: place_counters = [place_counter_name(p) for p in self.project.nets[0].places() if p.trace_tokens] ri = ExportRunInstance( self, [ t for t in self.project.nets[0].transitions() if t.trace_fire ], [ (p, i) for p in self.project.nets[0].places() for i, tracing in enumerate(p.trace_tokens_functions) if tracing.return_numpy_type != 'O' ], ExportRunInstance.basic_header + place_counters) else: ri = RunInstance( self.project, self.process_count) index = 0 timeline = Table([("process", "<i4"), ("pointer", "<i4")], 100) full_timeline = Table([("process", "<i4"), ("pointer", "<i4")], 100) while True: # Searching for trace with minimal event time minimal_time_index = utils.index_of_minimal_value(trace_times) if minimal_time_index is None: break trace = self.traces[minimal_time_index] full_timeline.add_row((minimal_time_index, trace.pointer)) # Timeline update if trace.is_next_event_visible(): timeline.add_row(full_timeline[index]) trace.process_event(ri) trace_times[minimal_time_index] = trace.get_next_event_time() index += 1 self.data = Table([], 0) if self.export_data: self.data = ri.get_table() timeline.trim() full_timeline.trim() self.timeline, self.full_timeline = timeline, full_timeline self.missed_receives = ri.missed_receives
def run(self, app, tracelog): settings = exportri.run_assistant(app, tracelog); if settings is None: return ri = ExportRunInstance(tracelog, *settings) tracelog.execute_all_events(ri) return extensions.Source("Tracelog Table", datatypes.t_table, ri.get_table())