Guide for using and contributing to Benchpark, a Spack+Ramble framework for specifying reproducible HPC benchmarks across multiple systems. Covers experiment.py, application.py, package.py, and system.py layers.
Ships in Benchpark. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Benchpark (originally from LLNL) is a specification framework: it does not build or run anything itself. You describe a benchmark's build (Spack), run (Ramble), the experiment parameters, and the target system as code; Benchpark assembles a Ramble workspace from those specs, then Spack builds the code and Ramble runs and analyzes it. The payoff is reproducibility — the same specs build and run the same way across sites.
Upstream: https://github.com/LLNL/benchpark RIKEN fork: https://github.com/RIKEN-RCCS/benchpark (carries extra system configs and apps; see "Branches" below)
Two things you'll do with it: run an existing benchmark, or contribute a new benchmark or target system. This skill covers both, generically. It does not cover maintaining Benchpark's own framework internals.
Every benchmark in Benchpark is the composition of four files. Learn this shape — it's exactly what you add or edit when contributing.
experiments/<benchmark>/experiment.py # 1. experiment
repos/ramble_applications/<benchmark>/application.py # 2. ramble app (run + FOM)
repos/spack_repo/benchpark/packages/<benchmark>/package.py # 3. spack package (build)
# + optional *.patch files
systems/<site>/system.py # 4. system (per-site compilers/externals)
What each layer owns:
experiment.py — which run, on how many resources, with which
params. A class inheriting Experiment plus a ProgrammingModel(...)
mixin declaring supported models (Mpionly, Openmp, Cuda, Rocm),
optionally Scaling(ScalingMode.Strong, ScalingMode.Weak, ...), and
optionally Caliper. Declares variant("workload"), variant("version"),
and maintainers("ghuser"). The body is two methods:
compute_applications_section(): sets at least one of
n_nodes/n_ranks/n_gpus (required — Benchpark can't allocate
resources otherwise), n_threads_per_proc, the workload's input
parameters, and must call set_required_variables(n_resources=, process_problem_size=, total_problem_size=) (all three are required
metadata for Benchpark's bookkeeping — they are not Ramble variables).
Can branch on self.system_spec.name / self.system_spec.variants
for per-system config. exec_mode=test|perf is a built-in variant for
a small validation run vs. the real performance run.compute_package_section(): self.add_package_spec(self.name, [f"{name}{self.determine_version()}"]).application.py (Ramble ExecutableApplication) — how to run and
how to extract the figure of merit. Defines executable("name", "<cmd>", use_mpi=True/False) (often one for input prep, one for the
run, optionally one to compute the FOM), a workload("name", executables=[...]), workload_variable("X", default="..."),
environment_variable("OMP_NUM_THREADS", "{n_threads_per_proc}", ...),
success_criteria("id", mode="string", match=<regex>, file=<log>), and
figure_of_merit("id", fom_regex=r"...(?P<grp>...)", group_name="grp", log_file="<path>", units="..."). The FOM is a regex over a log file,
not an inline computation — if the app doesn't already write the number
you want to a log, add a small executable that runs a parser (python,
awk) to produce a .dat file the regex then reads (mVMC's compute-fom
is the canonical example).
package.py (Spack recipe — CMakePackage, MakefilePackage, etc.)
— how to build. version('x', sha256='...'), variant(...),
depends_on('mpi')/('blas')/etc., cmake_args(), install(). If
upstream Spack already has the package, Benchpark uses that unless you
add one here to override. Optional *.patch files live alongside
package.py.
system.py — the target site's compilers, scheduler, and external
libraries. A System subclass with id_to_resources (per-cluster
sys_cores_per_node/sys_gpus_per_node/sys_mem_per_node_GB/queue/
hardware_key), variant("cluster", ...), variant("compiler", ...),
compute_packages_section() (Spack packages: with externals + paths),
and compute_compilers_section() (compiler_section_for/compiler_def).
This is where module-load equivalents and compiler/library paths live —
not inline in the experiment.
git clone https://github.com/LLNL/benchpark.git && cd benchpark
. setup-env.sh # adds bin/ to PATH (bootstraps Spack+Ramble lazily)
benchpark --version # sanity check
The run loop has three init steps then a build/run. The directory
nesting matters: setup walks the experiment dir's parents looking for
system_id.yaml, so the experiment dir must live inside the system
dir from step 1.
# 1. initialize the target system → creates <sysdir>/system_id.yaml
# (cluster/compiler are only valid if <SystemName> defines those variants)
benchpark system init --dest=<sysdir> <SystemName> [cluster=<x>] [compiler=<c>]
# 2. initialize the experiment — <system> is the DIR from step 1, not a name.
# Put the experiment dir INSIDE the system dir (nesting requirement, see below).
benchpark experiment init --dest=<sysdir>/<expdir> <sysdir> <Benchmark> [+openmp] [workload=<w>] ...
# 3. assemble the Ramble workspace (two positionals: experiment_def_dir, experiments_root)
benchpark setup <sysdir>/<expdir> <experiments_root>
. <experiments_root>/setup.sh # sets up Spack + Ramble env
# 4. build (Spack) and run (Ramble) — workspace is under <experiments_root>/<sys>/<exp>/workspace
cd <experiments_root>
ramble --workspace-dir . workspace setup # Spack builds the benchmark
ramble --workspace-dir . on # runs all experiments in the workspace
ramble --workspace-dir . workspace analyze # FOMs + success/fail summary
<SystemName> and <Benchmark> are the names from benchpark list systems
/ benchpark list benchmarks. Variants on experiment init take the form
+openmp/~cuda (boolean) or workload=problem1/version=develop
(string); built-ins include exec_mode=test|perf, scaling-factor,
scaling-iterations, package_manager (e.g. user-managed to use a
pre-built binary via prepend_path=/path/to/bin), n_repeats, and
timeout.
To run a single experiment rather than all: invoke its
execute_experiment script directly, e.g.
$workspace/experiments/<bench>/<problem>/<exp_name>/execute_experiment.
benchpark list # benchmarks, systems, experiments
benchpark list systems # all systems (see docs/system-list.rst)
benchpark list benchmarks # all benchmarks (docs/benchmark-list.rst)
benchpark list experiments
benchpark list modifiers # affinity, caliper, hwloc, allocation, ...
benchpark info system <system> # full detail on one system
benchpark info experiment <experiment> # full detail on one experiment
benchpark tags -a application <app> # tags for an application
Reference examples in the repo: experiments/amg2023/experiment.py (full
features — multi programming model, scaling, Caliper) and
experiments/test/saxpy/experiment.py + repos/ramble_applications/saxpy/ application.py (minimal). The docs walkthrough is
docs/add-an-experiment.rst (uses HPL) and docs/add-a-benchmark.rst.
experiments/<benchmark>/experiment.py — start from a copy of a
similar experiment. Set the right ProgrammingModelTypes. Add
variant("workload") and variant("version", values=(...), default=...). Add maintainers("yourgh"). In
compute_applications_section(), set the resource variables (at least
one of n_nodes/n_ranks/n_gpus), n_threads_per_proc, the workload
input params, and the three required set_required_variables. In
compute_package_section(), add the package spec.
repos/ramble_applications/<benchmark>/application.py — define the
executables, workload, workload_variables, environment_variables,
success_criteria (regex on a log file), and figure_of_merits. If
upstream Ramble already defines the app, Benchpark uses that unless you
add one here.
repos/spack_repo/benchpark/packages/<benchmark>/package.py — a
Spack recipe with version(..., sha256=...). If upstream Spack already
has the package, Benchpark uses that unless you add one here. Add
*.patch files alongside if the source needs patching.
No new system.py unless the target site is absent — reuse an
existing system and add a cluster variant value + id_to_resources
entry (see "Contributing a system" below).
Validate before opening a PR (per docs/testing-your-contribution.rst):
benchpark system init --dest=mysys <SystemName> compiler=<c>
benchpark experiment init --dest=myexp mysys <benchmark>
# CI auto-runs "dryrunexperiments" on PRs — these do NOT build or run;
# they verify the experiment/system initializes and the required variables
# exist. A maintainer approves CI for first-time contributors.
The doc explicitly encourages upstreaming the package.py to Spack and the
application.py to Ramble once the experiment is working, then removing
the copy from repos/ — repos/ is a staging area.
Follow docs/add-a-system-config.rst. First check whether a system with
the same hardware already exists (docs/system-list.rst,
systems/all_hardware_descriptions/):
cluster variant and add an id_to_resources entry.
No new file.system.py.systems/all_hardware_descriptions/<name>/ (naming:
[INTEGRATOR][-MICROARCH][-ACCELERATOR][-NETWORK]) and a new
systems/<site>/system.py.Per-cluster compiler paths, module equivalents, and library externals go
in compute_packages_section/compute_compilers_section of system.py —
not in the experiment. This centralizes site knowledge per site, the
opposite of a per-app inline approach.
docs/FAQ.rst)| Changed | Rerun |
|---|---|
| configs | ramble --workspace-dir . workspace setup |
benchmark's package.py or a dependency | ramble --workspace-dir . workspace setup |
| experiment parameters | delete workspace/experiments |
| wish to rerun experiments | delete workspace/experiments |
Modifiers (modifiers/: affinity, caliper, hwloc, allocation)
inject reusable patterns — e.g. affinity=on at experiment init adds a
small separate run that records thread/GPU affinity to a file; caliper
adds Caliper profiling. See docs/modifiers.rst.
executable that parses the
app's output and writes a small .dat file, then point figure_of_merit
at it.set_required_variables is mandatory — n_resources,
process_problem_size, total_problem_size are all required even though
they're metadata, not Ramble variables. Pick per-process vs total
problem size to match how the app defines problem size (see
amg2023 for per-process, kripke for total).n_nodes/n_ranks/n_gpus must be set or Benchpark
can't allocate resources.benchpark setup
walks the experiment def dir's parents for system_id.yaml; if the
experiment dir is a sibling of the system dir, setup fails with
No benchpark system dir detected ... or any parent. Use
experiment init --dest=<sysdir>/<expdir> <sysdir> ....cluster/compiler are not universal. They're only valid on
system init if <SystemName>'s system.py defines those variants
(e.g. riken-cloud defines cluster; llnl-cluster defines
cluster). generic-x86 accepts neither. Passing an undefined
variant fails with <name> is not a valid variant of <System>.benchpark experiment init takes a system directory, not a name.
Signature: experiment init --dest=<dir> <system_def_dir> <Benchmark> [+var ...]. The <system_def_dir> is the --dest from
benchpark system init.+openmp requires the Spack package to define an openmp variant. If
it doesn't, keep the experiment Mpionly and set threading via an
OMP_NUM_THREADS environment_variable in the ramble app instead.repos/ is the override location, not repo/. The actual layout is
repos/ramble_applications/<bench>/ and
repos/spack_repo/benchpark/packages/<bench>/ (some older docs/FAQ
text says benchpark/repo/<bench>/ — that's the upstream LLNL layout).
config/repos.yaml declares these search paths.checkout-versions.yaml pins Spack/Ramble — the latest upstream
Spack/Ramble features or packages may lag in Benchpark. You can
temporarily copy a needed package into repos/ to get ahead of this.The RIKEN-RCCS fork carries RIKEN system configs and apps on branches,
not all on develop. Always check branches before concluding an app or
system is absent:
git ls-tree -r --name-only origin/<branch> | grep -i <name>
develop tracks upstream plus some RIKEN additions. Confirm where a
specific contribution belongs before branching off it.
BenchKit (shell-first, same RIKEN ecosystem) and Benchpark (Spack+Ramble, structured) are complementary, not redundant:
| BenchKit | Benchpark | |
|---|---|---|
| Build/run | shell build.sh/run.sh you read by hand | Spack builds, Ramble runs (generated) |
| Where site modules/compilers live | inline per-app per-system case block | system.py compute_*_section (per-site) |
| Adding an app | programs/<code>/{build,run}.sh,list.csv} | 4 files (experiment + ramble app + spack pkg + maybe system) |
| FOM | bk_emit_result --fom ... → results/result | figure_of_merit(...) regex on a log file |
| Verification | scripts/test_submit.sh real batch job | dryrun CI (init only) + manual build/run |
Keep site-level compiler/library facts in Benchpark's system.py and
app-level run recipes in BenchKit's shell files; keep the two consistent
with what you have actually verified.
docs/)for-the-impatient.rst — the 5-command run loop.add-an-experiment.rst — full experiment.py walkthrough (HPL).add-a-benchmark.rst — package.py + application.py prerequisites.add-a-system-config.rst — system.py + hardware descriptions.testing-your-contribution.rst — dryrun CI + manual validation.benchpark-commands.rst — benchpark list/info/tags reference.run-binary.rst — using a pre-built binary (package_manager=user-managed).modifiers.rst — affinity, caliper, hwloc, allocation.FAQ.rst — what to rerun after edits, Spack/Ramble version pinning.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/Benchpark:benchparkfrom Benchpark
npx claudepluginhub riken-rccs/hpc-agentic-sdk --plugin Benchpark