Fix report generation for remote runs.
@@ -2761,6 +2761,8 @@ class Chip:
# Generate results page by passing the Chip manifest into the Jinja2 template.
env = Environment(loader=FileSystemLoader(templ_dir))
results_page = os.path.join(web_dir, 'report.html')
+ results_gen = False
+ try:
with open(results_page, 'w') as wf:
wf.write(env.get_template('sc_report.j2').render(
manifest = self.cfg,
@@ -2769,9 +2771,12 @@ class Chip:
tasks = flow_tasks,
results_fn = results_gds
))
+ results_gen = True
+ except:
+ self.logger.warning("Report generation failed.")
# Try to open the results page in a browser, only if '-nodisplay' is not set.
- if not self.get('nodisplay'):
+ if results_gen and (not self.get('nodisplay')):
try:
webbrowser.get(results_page)
except webbrowser.Error:
@@ -3789,6 +3794,10 @@ class Chip:
# Store run in history
self.cfghistory[self.get('jobname')] = copy.deepcopy(self.cfg)
+ # Run 'summary()' after a remote run to generate a final report file.
+ if self.get('remote'):
+ self.summary()
+
###########################################################################
def show(self, filename=None, extra_options=[]):
'''
