Skip to content

Commit 22494a2

Browse files
committed
Improve polybench usage and launcher help messages
1 parent c9a984d commit 22494a2

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

truffle/mx.truffle/mx_polybench/command.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ def parser_help_message(cls):
6969
return (
7070
"additional benchmark arguments. By default, arguments are passed to the Polybench launcher, "
7171
f"but you may use flags to forward arguments to specific components: "
72-
f"{cls.MX_BENCHMARK_FLAG} for mx benchmark, "
73-
f"{cls.VM_FLAG} for the host VM or native-image, or "
74-
f"{cls.POLYBENCH_FLAG} for the Polybench launcher. "
72+
f'"{cls.MX_BENCHMARK_FLAG}" for mx benchmark, '
73+
f'"{cls.VM_FLAG}" for the host VM or native-image, or '
74+
f'"{cls.POLYBENCH_FLAG}" for the Polybench launcher (pass "--help" to see launcher help). '
7575
f'For example: "-i 2 {cls.MX_BENCHMARK_FLAG} --fail-fast {cls.VM_FLAG} -ea '
7676
f'{cls.POLYBENCH_FLAG} --engine.TraceCompilation=true".'
7777
)
@@ -410,6 +410,7 @@ def _create_parser() -> ArgumentParser:
410410
"It is a thin wrapper around Polybench's mx benchmark integration that makes it easy to discover and run benchmarks. "
411411
"It also supports batch execution of the benchmarks in a suite, which is convenient for defining CI jobs."
412412
),
413+
usage="%(prog)s [options*] benchmarks [benchmark_arguments*]",
413414
)
414415

415416
parser.add_argument(

truffle/src/org.graalvm.polybench/src/org/graalvm/polybench/PolyBenchLauncher.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,16 @@ protected void printHelp(OptionCategory maxCategory) {
314314
}
315315
}
316316

317+
/**
318+
* Suppress the runtime options printed by the parent implementation. Some of these options
319+
* (like --jvm, --native) are handled by mx polybench, so using them in the launcher is
320+
* discouraged (and confusing).
321+
*/
322+
@Override
323+
protected void printDefaultHelp(OptionCategory helpCategory) {
324+
printHelp(helpCategory);
325+
}
326+
317327
static String getExtension(String path) {
318328
int lastDot = path.lastIndexOf('.');
319329
if (lastDot < 0) {

0 commit comments

Comments
 (0)