Skip to content

Commit

Permalink
Increase the timeout value passed to AVR
Browse files Browse the repository at this point in the history
  • Loading branch information
Po-Chun-Chien committed Dec 5, 2024
1 parent 93d9d5d commit ebaf036
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion benchexec/tools/avr.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ def project_url(self):

def cmdline(self, executable, options, task, rlimits):
if rlimits.cputime and "--timeout" not in options:
options += ["--timeout", str(rlimits.cputime)]
# The `--timeout` parameter must be passed to the tool
# to prevent it from using its default value,
# which could be shorter than the limit set by BenchExec
# and cause early termination.
# Moreover, in practice the tool sometimes terminates itself prematurely
# even when the exact time limit is passed.
# To prevent this and ensure the tool utilizes the full time limit,
# a factor of 2 is applied to the timeout value.
options += ["--timeout", str(rlimits.cputime * 2)]
if rlimits.memory and "--memout" not in options:
options += ["--memout", str(ceil(rlimits.memory / 1000000.0))]
return [executable] + options + [task.single_input_file]
Expand Down

0 comments on commit ebaf036

Please sign in to comment.