Skip to content

Commit

Permalink
Moved output printing outside of try block
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 30, 2024
1 parent 57b3c4b commit 61baa52
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contrib/slurm/arrayexecutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import tempfile
import time
import zipfile
from csv import excel

from benchexec import tooladapter
from benchexec.tablegenerator import parse_results_file, handle_union_tag
Expand Down Expand Up @@ -426,6 +427,7 @@ def execute_batch(
missing_runs = []
for bin in bins:
for i, run in bins[bin]:
success = False
try:
run.set_result(
get_run_result(
Expand All @@ -435,7 +437,7 @@ def execute_batch(
+ ["*witness*"], # e.g., deagle uses mismatched naming
)
)
output_handler.output_after_run(run)
success = True
except Exception as e:
logging.warning("could not set result due to error: %s", e)
if counter < benchmark.config.retry or benchmark.config.retry < 0:
Expand All @@ -454,6 +456,12 @@ def execute_batch(
os.path.basename(file) + ".error",
),
)
if success:
try:
output_handler.output_after_run(run)
except Exception as e:
logging.warning("could not print result due to error: %s", e)

if len(missing_runs) > 0 and not STOPPED_BY_INTERRUPT:
logging.info(
f"Retrying {len(missing_runs)} runs due to errors. Current retry count for this batch: {counter}"
Expand Down

0 comments on commit 61baa52

Please sign in to comment.