Command Line Interface#
Everything is reachable through the single ppbcc executable:
ppbcc <command> [options]
ppbcc code-complexity SOURCES... # Halstead / LOC metrics
ppbcc benchmark -r REGEX... # run and consolidate benchmarks
ppbcc profile -r REGEX... # profile kernels (ncu or likwid), roofline model
ppbcc p2analysis PLOT CSV... # efficiency and portability plots
ppbcc p3analysis PLOT COMPLEXITY_CSV CSV... # portability over code complexity
The package can also be run as a module:
python -m ppbcc code-complexity src/ -o report.csv
Tip
The tables below list the options you reach for most often, not every
option. Run ppbcc <command> --help (or -h) for the exhaustive,
always-current list.
ppbcc code-complexity#
Halstead complexity and LOC/SLOC metrics for C++ and GPU-enriched C++.
Option |
Meaning |
|---|---|
|
Files and/or directories; directories are searched recursively for known source extensions |
|
|
|
Metric selection, e.g. |
|
Add |
|
Append a |
|
Write the table to this CSV file |
|
List all known dialects and their aliases, then exit |
Details and examples: Code Complexity.
ppbcc benchmark#
Run Google Benchmark targets and consolidate their JSON reports into one CSV.
Option |
Meaning |
|---|---|
|
Build folder used as the working directory for the whole pipeline |
|
Directories searched recursively, relative to |
|
Required. Pattern(s) matched against file paths to select executables (or JSON reports) |
|
Pattern(s) excluding matched paths, e.g. |
|
Do not run anything; locate existing JSON reports and only consolidate them |
|
List the matched executables (or reports) and exit |
|
Value stored in the |
|
Base name of the consolidated CSV (defaults to a timestamped name) |
Details and examples: Benchmarking.
ppbcc profile#
Batch-profile GPU kernels and draw a roofline model. Expects executables built
with -DPPB_PROFILING=ON. --profiler picks the backend: ncu (default,
one row per kernel launch) or likwid (one row per marked region, needs
-DPPB_ENABLE_LIKWID=ON too).
Option |
Meaning |
|---|---|
|
Build folder used as the working directory for the whole pipeline |
|
Executable discovery, exactly as for |
|
Where the profiler artefacts are written (default: |
|
|
|
Path to that backend’s CLI; found automatically otherwise |
|
|
|
Skip profiling and plot from consolidated CSVs, merging several backends |
|
Run nothing; only re-parse the artefacts already in |
|
Wall-clock limit per executable; a run that hits it is skipped |
|
Level the arithmetic intensity refers to: |
|
|
|
Plot only the regions matching a pattern, e.g. |
|
Keep the launches outside every named region (dropped by default) |
|
|
|
Render the roofline chart, optionally to a given path |
|
Leave the paradigm legend out of the roofline chart |
|
Skip the consolidated CSV (for a pure collection run) |
|
Roofline ceilings for the backends without |
|
|
|
Hardware label and base name of the consolidated CSV |
Details and examples: Kernel Profiling & Roofline.
ppbcc p2analysis / ppbcc p3analysis#
Application efficiency, performance portability, and plots from benchmark CSVs.
p2analysis renders the charts that need benchmark results only,
p3analysis those that also need code complexity.
ppbcc p2analysis PLOT CSV [CSV ...] [options]
ppbcc p3analysis PLOT COMPLEXITY_CSV CSV [CSV ...] [options]
Option |
Meaning |
|---|---|
|
|
|
|
|
One or more CSVs produced by |
|
Benchmark problem to plot; exact case-insensitive match preferred, unique substring okay.
May be omitted when the CSVs contain exactly one problem. |
|
|
|
|
|
x-axis metric of |
|
|
|
|
|
|
|
With |
|
Compute \(\Phi\) over supported platforms only |
|
Regex filters on the |
|
|
|
|
|
|
|
Drop bracketed labels such as |
|
Save the legend as a separate PDF (add |
|
Also export efficiency and portability data as CSV; |
|
Output path; defaults to |
Details and examples: P3 Analysis and Available Plots.
Option compatibility#
Not every option applies to every chart, and the CLI rejects invalid combinations rather than silently ignoring them:
Option |
Valid for |
|---|---|
|
|
|
|
|
|
|
every chart except |
|
|
|
|
|
every chart except |
Logging#
All commands log through loguru at INFO by default. -v raises
the level to DEBUG, -vv to TRACE.