Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tools/benchcomp/benchcomp/cmd_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ def _get_args_dict():
"help":
"do not make a fresh copy of the benchmark "
"directories before running each variant",
}, {
"flags": ["--keep-temps"],
"action": "store_false",
"dest": "cleanup_directory",
"help":
"do not delete fresh copies of benchmark "
"directories after running each variant",
}],
},
"collate": {
Expand Down
8 changes: 7 additions & 1 deletion tools/benchcomp/benchcomp/entry/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class _SingleInvocation:
command_line: str
directory: pathlib.Path

cleanup_directory: bool
env: dict = dataclasses.field(default_factory=dict)
timeout: int = None
memout: int = None
Expand Down Expand Up @@ -85,6 +86,9 @@ def __call__(self):
encoding="utf-8") as handle:
yaml.dump(suite, handle, default_flow_style=False)

if self.cleanup_directory and self.copy_benchmarks_dir:
shutil.rmtree(self.working_copy)


@dataclasses.dataclass
class _Run:
Expand All @@ -95,6 +99,7 @@ class _Run:
out_dir: str
out_symlink: str
copy_benchmarks_dir: bool
cleanup_directory: bool
result: dict = None

def __call__(self):
Expand All @@ -110,6 +115,7 @@ def __call__(self):
suite_id, variant_id,
parse, suite_yaml_out_dir=out_path,
copy_benchmarks_dir=self.copy_benchmarks_dir,
cleanup_directory=self.cleanup_directory,
**config)
invoke()

Expand Down Expand Up @@ -137,6 +143,6 @@ def get_default_out_prefix():
def main(args):
run = _Run(
args.config, args.out_prefix, args.out_dir, args.out_symlink,
args.copy_benchmarks_dir)
args.copy_benchmarks_dir, args.cleanup_directory)
run()
return run