From 715adc13ffdbb73050ea2abd174ea556bbdf6531 Mon Sep 17 00:00:00 2001 From: Ganesh Gore Date: Tue, 27 Aug 2019 21:25:38 -0600 Subject: [PATCH] Failed result do not throw error --- openfpga_flow/scripts/run_fpga_task.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/openfpga_flow/scripts/run_fpga_task.py b/openfpga_flow/scripts/run_fpga_task.py index 4a13184a0..5466e5b7e 100644 --- a/openfpga_flow/scripts/run_fpga_task.py +++ b/openfpga_flow/scripts/run_fpga_task.py @@ -343,7 +343,7 @@ def run_single_script(s, eachJob): output.write(line) process.wait() if process.returncode: - raise subprocess.CalledProcessError(0, []) + raise subprocess.CalledProcessError(0, command) eachJob["status"] = True except: logger.exception("Failed to execute openfpga flow - " + @@ -390,10 +390,13 @@ def collect_results(job_run_list): result["TotalRunTime"] = int(run["endtime"]-run["starttime"]) result.update(vpr_res["RESULTS"]) task_result.append(result) - + colnames = [] + for eachLbl in task_result: + colnames.extend(eachLbl.keys()) if len(task_result): with open("task_result.csv", 'w', newline='') as csvfile: - writer = csv.DictWriter(csvfile, fieldnames=task_result[0].keys()) + writer = csv.DictWriter( + csvfile, extrasaction='ignore', fieldnames=list(set(colnames))) writer.writeheader() for eachResult in task_result: writer.writerow(eachResult)