Skip to content

Commit

Permalink
Added argparse to bp-compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
safl committed Apr 3, 2015
1 parent a7b3fca commit 07980c9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
16 changes: 15 additions & 1 deletion bin/bp-compile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
import subprocess
import argparse
import pprint
import os
from benchpress.version import get_paths, implementations
Expand Down Expand Up @@ -41,4 +42,17 @@ def compile(search_path=None, languages=['c','cpp']):
print(err)

if __name__ == "__main__":
compile()

parser = argparse.ArgumentParser(description="Compile benchmarks that require it")

parser.add_argument('--all', action='store_true', help="Compile all")
parser.add_argument('--lang', choices=['c', 'cpp'], help="Compile all of the provided language")

args = parser.parse_args() # Parse arguments

if args.all:
compile()
elif args.lang:
compile(languages=[args.lang])
else:
parser.print_usage()
3 changes: 3 additions & 0 deletions doc/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
Usage - Commands
================

Benchpress provides the following commands: ``bp-info``, ``bp-run``, ``bp-times``, ``bp-compile``, and ``bp-grapher``.
See below for details on invoking them and see section ?? for examples of using the commands.

bp-info
-------

Expand Down
5 changes: 3 additions & 2 deletions doc/source/usage_bp-run.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ usage: bp-run [-h] [--output RESULT_FILE] [--runs RUNS] [--with-perf]
[--with-time] [--save-data] [--pre-clean] [--restart]
[--publish-cmd COMMAND] [--slurm] [--no-slurm]
[--partition PARTITION] [--multi-jobs] [--wait]
bohrium_src suite_file
repos_root suite_file

Runs a benchmark suite and stores the results in a json-file.

positional arguments:
bohrium_src Path to the Bohrium source-code.
repos_root Path to git-repository, revision will be included in
result. Use "NOREPOS" if you do not want it.
suite_file Path to the benchmark suite file.

optional arguments:
Expand Down

0 comments on commit 07980c9

Please sign in to comment.