scientific-cli-benchmark
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Benchmark command-line applications for scientific computing and
- Installs packages
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- developer-tool-installation-policySkill
- git-refactor-hygieneSkill
- project-repository-setupSkill
- scientific-accelerator-portabilitySkill
- scientific-build-systemsSkill
- scientific-ciSkill
- scientific-cli-designSkill
- scientific-code-styleSkill
- scientific-container-workflowsSkill
- scientific-data-analysis-and-visualizationSkill
- scientific-data-managementSkill
- scientific-documentationSkill
- scientific-io-and-data-formatsSkill
- scientific-notebook-workflowsSkill
- scientific-numerics-reviewSkill
- scientific-package-managementSkill
- scientific-parallel-debuggingSkill
- scientific-performance-portabilitySkill
- scientific-profilingSkill
- scientific-release-and-publicationSkill
- scientific-reproducibilitySkill
- scientific-reviewSkill
- scientific-testingSkill
- scientific-workflow-automationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. About 0 are common, 17 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill to benchmark command-line applications in a way that is appropriate for scientific computing workloads.
- Distinctive: line 23
Use this skill when the user asks to:
- Distinctive: line 68
Run warmups before recording data.
- Distinctive: line 78
Keep the benchmark focused on one question at a time.
- Distinctive: line 79
Use wall-clock time for end-to-end application performance.
- Distinctive: line 83
Keep correctness work minimal in this skill: only do enough to ensure benchmark results are meaningful.
- Distinctive: line 86
Avoid comparing runs with different problem sizes unless the goal is a weak-scaling or throughput study.
- Distinctive: line 91
Treat first-run effects explicitly: filesystem cache, JIT compilation, page faults, and data staging can distort a single timing.
- Distinctive: line 94
Prefer at least 5 measured runs for stable executables.
- Very specific: line 103
When hyperfine is available, prefer it for simple repeated command timing.
- Very specific: line 128
Use --prepare only when the preparation step is intentionally excluded from the measurement.
- Very specific: line 131
If hyperfine is missing and the user wants it, use scripts/install_hyperfine.sh to install a private copy without root access.
- Very specific: line 150
If hyperfine is not installed, use scripts/simple_benchmark.py.
- Distinctive: line 174
start from a 1-thread baseline.
- Distinctive: line 176
check whether SMT should be disabled or excluded.
- Very specific: line 177
test placement policies such as close and spread.
- Distinctive: line 180
If the user asks for scaling results, compute:
- Distinctive: line 185
When the machine topology matters, gather context with commands such as:
- Distinctive: line 192
If running under a scheduler, also record the allocation details.
- Distinctive: line 225
Avoid claiming a speedup without stating the baseline, problem size, and thread placement.
- Distinctive: line 230
When reporting results, include:
- Distinctive: line 246
When the user wants a finished benchmark artifact, produce one or more of the following:
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Scientific CLI Benchmark
Overview
Use this skill to benchmark command-line applications in a way that is appropriate for scientific computing workloads. Prefer reproducible runs, explicit runtime settings, lightweight sanity checks before timing, and reporting that distinguishes single-thread baselines from multithreaded scaling and placement effects. This skill is for performance measurement, not for full functional or scientific verification.
When to Use It
Use this skill when the user asks to:
- benchmark a CLI executable or script;
- compare serial and parallel runtime;
- measure OpenMP or thread-count scaling;
- study socket placement, affinity, or memory locality effects;
- collect repeatable timing data for a report, table, or plot.
This skill is a poor fit for microbenchmarks inside a programming language runtime. It is meant for end-to-end command execution.
Useful Tools
Useful tools for this skill include:
hyperfinefor repeated end-to-end timing with warmups and summary statistics;STREAMfor sustained memory-bandwidth measurements;lmbench, especiallylat_mem_rd, for memory-latency probes;LIKWIDfor topology-aware bandwidth-style microbenchmarks and hardware-counter workflows on Linux HPC systems;lscpuandnprocfor basic CPU and topology information;hwloctools such aslstopofor richer topology inspection;numactlfor NUMA policy control and hardware layout queries;tasksetfor lightweight CPU affinity control on Linux;perf statandperf recordfor hardware-counter diagnosis and hotspot investigation;OMP_DISPLAY_ENVfor confirming the OpenMP runtime configuration that the program actually sees.
Workflow
- Identify the benchmark target and how it is built or launched.
- Build an optimized executable before timing, usually a release build.
- Establish a benchmark sanity check: run a small or representative case first and verify a checksum, residual, output file hash, or other stable signal sufficient to ensure the timed cases are comparable.
- Inspect hardware and runtime constraints that affect performance: core counts, sockets, SMT, cache hierarchy and cache sizes, memory bandwidth, allocator, CPU frequency policy, and scheduler placement if running under Slurm or similar systems.
- Choose the timing method:
prefer
hyperfine; use the bundled fallback script whenhyperfineis unavailable or when the benchmark needs more custom control. - Run warmups before recording data.
- Sweep the relevant parameters: problem size, thread count, affinity policy, tile sizes, input files, and build variants.
- Report the exact command line and all relevant environment variables.
- Summarize results with mean runtime, variability, and derived metrics such as speedup and efficiency when thread scaling is measured.
Benchmark Design Rules
- Keep the benchmark focused on one question at a time.
- Use wall-clock time for end-to-end application performance.
- Record the machine and scheduler context when available.
- Separate benchmark sanity checks from timing runs if validation adds material overhead.
- Keep correctness work minimal in this skill: only do enough to ensure benchmark results are meaningful. Full program verification belongs in a different workflow or skill.
- Avoid comparing runs with different problem sizes unless the goal is a weak-scaling or throughput study.
- For multithreaded runs, always record:
OMP_NUM_THREADS,OMP_PROC_BIND,OMP_PLACES, and any affinity variables such asGOMP_CPU_AFFINITYorKMP_AFFINITY. - Treat first-run effects explicitly: filesystem cache, JIT compilation, page faults, and data staging can distort a single timing.
- Prefer at least 5 measured runs for stable executables. Increase run counts when jitter is high or runtime is short.
- Long-running benchmark scripts should emit progress updates through
logging, typically atINFOlevel, for build, correctness checks, and each major sweep dimension so the user can see which case is currently running and suppress output easily when needed.
Timing with Hyperfine
When hyperfine is available, prefer it for simple repeated command
timing. Common pattern:
hyperfine \
--warmup 2 \
--runs 8 \
--export-json benchmark.json \
'OMP_NUM_THREADS=1 ./my_solver input.dat' \
'OMP_NUM_THREADS=16 OMP_PROC_BIND=spread OMP_PLACES=cores ./my_solver input.dat'For parameter sweeps, keep one varying dimension per loop so the output stays interpretable. For example:
for threads in 1 2 4 8 16 32; do
echo "=== threads=${threads} ==="
OMP_NUM_THREADS="${threads}" \
OMP_PROC_BIND=spread \
OMP_PLACES=cores \
hyperfine --warmup 1 --runs 6 './my_solver -n 4000'
doneUse --prepare only when the preparation step is intentionally excluded
from the measurement.
If hyperfine is missing and the user wants it, use
scripts/install_hyperfine.sh to install a private copy without root
access. By default it installs into ./tools/hyperfine, which is useful
for project-local workflows and shared cluster environments.
Example:
skills/scientific-cli-benchmark/scripts/install_hyperfine.sh \
--prefix ./tools/hyperfine
export PATH="$PWD/tools/hyperfine/bin:$PATH"The installer prefers cargo install --root ... when cargo is
available. Otherwise it downloads a prebuilt release tarball for common
Linux architectures.
Fallback Timing
If hyperfine is not installed, use
scripts/simple_benchmark.py. It runs warmups, repeats the command,
captures wall-clock timings, and can emit either a plain-text table or
JSON.
Example:
python3 skills/scientific-cli-benchmark/scripts/simple_benchmark.py \
--warmup 2 \
--runs 8 \
--threads 1,2,4,8,16 \
--env OMP_PROC_BIND=spread \
--env OMP_PLACES=cores \
--command ./my_solver -- -n 4000 -t 100The --threads option expands into multiple runs by setting
OMP_NUM_THREADS for each requested value.
Multithreading and Affinity
For OpenMP or thread-pool based programs:
- start from a 1-thread baseline;
- sweep meaningful thread counts, not just powers of two;
- check whether SMT should be disabled or excluded;
- test placement policies such as
closeandspread; - distinguish one-socket from full-node runs on multisocket machines.
If the user asks for scaling results, compute:
- speedup =
T1 / Tp; - parallel efficiency =
speedup / p.
When the machine topology matters, gather context with commands such as:
lscpu
numactl --hardwareIf running under a scheduler, also record the allocation details.
Interpreting Results
In scientific computing, benchmark interpretation should connect the timings to workload characteristics:
- gather basic hardware context before drawing conclusions;
- compute-bound kernels may scale until core or vector limits dominate;
- memory-bound kernels often saturate bandwidth early;
- placement sensitivity often indicates NUMA or bandwidth effects;
- high variance can indicate oversubscription, thermal throttling, interference from other jobs, or unstable I/O.
Useful system-characterization tools include:
lscpufor CPU topology, sockets, cores, threads, cache sizes, and NUMA layout;nprocfor the visible logical CPU count;- Intel
mlcwhen available to estimate sustained memory bandwidth and latency, which is often valuable when interpreting memory-bound kernels.
Cache and memory-hierarchy context matters when interpreting benchmark results:
- tile-size effects often reflect cache-capacity and cache-line reuse behavior rather than only algorithmic changes;
- runtime jumps can occur when the working set stops fitting in a given cache level;
- a result that looks compute-bound at small
nmay become memory-bound once the footprint exceeds the relevant cache capacity.
Avoid claiming a speedup without stating the baseline, problem size, and thread placement.
Outputs
When reporting results, include:
- the tested command;
- build type and compiler when relevant;
- machine or node description;
- hostname and basic CPU topology from tools such as
nprocorlscpu; - git remote and commit hash when the benchmark was run from a clean worktree;
- thread and affinity settings;
- number of warmups and measured runs;
- mean runtime and variability;
- speedup and efficiency for scaling studies;
- any benchmark sanity signal used before timing.
Deliverables
When the user wants a finished benchmark artifact, produce one or more of the following:
- a reproducible shell script;
- a scheduler job script for cluster runs;
- a markdown summary table;
- a CSV or JSON file with raw timing data.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

