Skip to content
Open
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
11 changes: 4 additions & 7 deletions bin/benchpark
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ import subprocess
import sys


def main():
if sys.version_info[0] < 3 or sys.version_info[1] < 8:
raise Exception("\n\nERR: Must be using Python 3.8 or later!\n")
basedir = pathlib.Path(__file__).resolve().parents[1]
main_py = basedir / "lib" / "main.py"
subprocess.run([sys.executable, main_py] + sys.argv[1:], check=True)
basedir = pathlib.Path(__file__).resolve().parents[1]
sys.path.insert(0, str(basedir) + "/lib")

from main import main

if __name__ == "__main__":
main()
sys.exit(main())
8 changes: 3 additions & 5 deletions lib/benchpark/cmd/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ def experiment_init(args):


def setup_parser(root_parser):
system_subparser = root_parser.add_subparsers(dest="experiment_subcommand")
system_subparser = root_parser.add_subparsers(
dest="experiment_subcommand", required=True
)

init_parser = system_subparser.add_parser("init")
init_parser.add_argument("--dest", help="Place all system files here directly")
Expand All @@ -56,7 +58,3 @@ def command(args):
}
if args.experiment_subcommand in actions:
actions[args.experiment_subcommand](args)
else:
raise ValueError(
f"Unknown subcommand for 'experiment': {args.experiment_subcommand}"
)
4 changes: 1 addition & 3 deletions lib/benchpark/cmd/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _info_ramble_name(experiment_class):


def setup_parser(root_parser):
info_subparser = root_parser.add_subparsers(dest="info_subcommand")
info_subparser = root_parser.add_subparsers(dest="info_subcommand", required=True)

system_parser = info_subparser.add_parser("system")
system_parser.add_argument(
Expand Down Expand Up @@ -227,5 +227,3 @@ def command(args):
}
if args.info_subcommand in actions:
actions[args.info_subcommand](args)
else:
raise ValueError(f"Unknown subcommand for 'info': {args.info_subcommand}")
3 changes: 1 addition & 2 deletions lib/benchpark/cmd/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def setup_parser(root_parser):
list_subparser = root_parser.add_subparsers(
dest="list_subcommand",
help="List available experiments, systems, and modifiers",
required=True,
)

# Add subcommands
Expand Down Expand Up @@ -131,5 +132,3 @@ def command(args):
}
if args.list_subcommand in actions:
actions[args.list_subcommand](args)
else:
raise ValueError(f"Unknown subcommand for 'list': {args.list_subcommand}")
6 changes: 3 additions & 3 deletions lib/benchpark/cmd/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ def _ignore(path, dir_list):


def setup_parser(root_parser):
mirror_subparser = root_parser.add_subparsers(dest="system_subcommand")
mirror_subparser = root_parser.add_subparsers(
dest="system_subcommand", required=True
)

create_parser = mirror_subparser.add_parser("create")
create_parser.add_argument(
Expand All @@ -242,5 +244,3 @@ def command(args):
}
if args.system_subcommand in actions:
actions[args.system_subcommand](args)
else:
raise ValueError(f"Unknown subcommand for 'system': {args.system_subcommand}")
8 changes: 3 additions & 5 deletions lib/benchpark/cmd/show_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ def show_build_dump(args):


def setup_parser(root_parser):
show_build_subparser = root_parser.add_subparsers(dest="show_build_subcommand")
show_build_subparser = root_parser.add_subparsers(
dest="show_build_subcommand", required=True
)

dump_parser = show_build_subparser.add_parser("dump")
dump_parser.add_argument(
Expand All @@ -81,7 +83,3 @@ def command(args):
}
if args.show_build_subcommand in actions:
actions[args.show_build_subcommand](args)
else:
raise ValueError(
f"Unknown subcommand for 'show-build': {args.show_build_subcommand}"
)
6 changes: 3 additions & 3 deletions lib/benchpark/cmd/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ def system_external(args):


def setup_parser(root_parser):
system_subparser = root_parser.add_subparsers(dest="system_subcommand")
system_subparser = root_parser.add_subparsers(
dest="system_subcommand", required=True
)

init_parser = system_subparser.add_parser("init")
init_parser.add_argument("--dest", help="Place all system files here directly")
Expand Down Expand Up @@ -143,5 +145,3 @@ def command(args):
}
if args.system_subcommand in actions:
actions[args.system_subcommand](args)
else:
raise ValueError(f"Unknown subcommand for 'system': {args.system_subcommand}")
8 changes: 5 additions & 3 deletions lib/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
if "-V" in sys.argv or "--version" in sys.argv:
print(__version__)
exit()
helpstr = """usage: main.py [-h] [-V] {tags,system,experiment,setup,unit-test,audit,info,list} ...
helpstr = """usage: benchpark [-h] [-V] {tags,system,experiment,setup,unit-test,audit,mirror,info,show-build,list,bootstrap,analyze} ...

Benchpark

Expand All @@ -25,18 +25,20 @@
-V, --version show version number and exit

Subcommands:
{tags,system,experiment,setup,unit-test,audit,info,list}
{tags,system,experiment,setup,unit-test,audit,mirror,info,show-build,list,bootstrap,analyze}
tags Tags in Benchpark experiments
system Initialize a system config
experiment Interact with experiments
setup Set up an experiment and prepare it to build/run
unit-test Run benchpark unit tests
audit Look for problems in System/Experiment repos
mirror Copy a benchpark workspace
info Get information about Systems and Experiments
show-build Show how spack built a benchmark
list List experiments, systems, benchmarks, and modifiers
bootstrap Bootstrap benchpark or update an existing bootstrap
analyze Perform pre-defined analysis on the performance data (caliper files) after 'ramble on'"""
if "-h" == sys.argv[1] or "--help" == sys.argv[1]:
if len(sys.argv) == 1 or "-h" == sys.argv[1] or "--help" == sys.argv[1]:
print(helpstr)
exit()

Expand Down
Loading