scientific-parallel-debugging
Skill1 starsChanged 6 months agoApache-2.0View on GitHub
Debug parallel scientific-computing and HPC software, especially
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-benchmarkSkill
- 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-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
20 rules. About 0 are common, 18 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈18
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
Use this skill when debugging scientific, numerical, or parallel software where failures depend on thread count, rank count, scheduling, …
- Distinctive: line 28
Use this skill when:
- Distinctive: line 36
Do not use this skill as a substitute for general serial debugging when the bug does not depend on parallel execution.
- Distinctive: line 41
When this skill applies:
- Distinctive: line 43
Read the repository AGENTS.md first, if present.
- Distinctive: line 50
Prefer reproducible minimal cases over large production runs while debugging.
- Distinctive: line 68
Start from a known-good serial baseline.
- Distinctive: line 72
Prefer deterministic seeds and stable inputs while isolating the issue.
- Distinctive: line 74
If the bug disappears under logging or debugging, say so explicitly and treat that as a clue rather than a contradiction.
- Distinctive: line 80
Check whether divergence starts at boundaries, reductions, or exchanged data.
- Distinctive: line 90
Check for mismatched send/receive patterns, collectives, or barriers.
- Distinctive: line 91
Look for code paths where one rank or thread can skip required synchronization.
- Distinctive: line 94
Use timeouts, progress logging, or coarse checkpoints to locate the stall.
- Very specific: line 102
Check reductions, nowait regions, task dependencies, and loop schedules.
- Very specific: line 103
Test whether OMP_NUM_THREADS=1 matches the serial code path.
- Distinctive: line 112
Verify message sizes, tags, communicators, and collective participation.
- Distinctive: line 113
Check decomposition logic and off-by-one errors at subdomain boundaries.
- Distinctive: line 117
Treat rank-dependent file I/O and restart logic as potential correctness hazards, not just infrastructure details.
- Distinctive: line 123
Test whether binding, rank mapping, or oversubscription changes the failure.
- Distinctive: line 154
When using this skill, briefly note:
≈ “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 Parallel Debugging
Use this skill when debugging scientific, numerical, or parallel software where failures depend on thread count, rank count, scheduling, communication, or runtime placement rather than purely serial logic.
Repository AGENTS.md instructions take precedence over this skill.
Purpose
Apply a pragmatic default for:
- isolating parallel-only correctness failures;
- debugging thread, task, OpenMP, or MPI behavior;
- separating communication, synchronization, and numerical drift issues;
- reporting actionable root-cause hypotheses instead of vague nondeterminism.
When To Use
Use this skill when:
- the bug appears only with multiple threads, tasks, or ranks;
- serial and parallel results diverge unexpectedly;
- the program hangs, deadlocks, or stalls under parallel execution;
- output depends suspiciously on scheduling, affinity, or launch configuration;
- race conditions, halo exchanges, reductions, or partitioning logic are suspect.
Do not use this skill as a substitute for general serial debugging when the bug does not depend on parallel execution.
Working Approach
When this skill applies:
- Read the repository
AGENTS.mdfirst, if present. - Reduce the failure to the smallest thread or rank count that still reproduces it.
- Compare serial and parallel behavior on the same input.
- Change one dimension at a time: threads, ranks, affinity, schedule, or input.
- Distinguish crash, hang, wrong answer, and performance-pathology cases.
- State what is observed, what is inferred, and what remains unverified.
Prefer reproducible minimal cases over large production runs while debugging.
Common Failure Classes
Look for:
- data races and unsafely shared state;
- deadlocks, missed notifications, or mismatched barriers;
- reduction mistakes and non-associative drift beyond expected roundoff;
- halo or ghost-cell exchange errors;
- partitioning and boundary-condition mistakes;
- rank- or thread-local initialization mismatches;
- affinity, oversubscription, or placement-induced misbehavior.
Parallel bugs often combine logic, runtime, and numerical effects.
Reproduction Strategy
- Start from a known-good serial baseline.
- Reproduce on the smallest input that still exercises the bug.
- Sweep low thread or rank counts before testing larger scales.
- Record launch commands and environment variables exactly.
- Prefer deterministic seeds and stable inputs while isolating the issue.
If the bug disappears under logging or debugging, say so explicitly and treat that as a clue rather than a contradiction.
Wrong-Answer Debugging
- Compare serial and parallel outputs at multiple granularities.
- Check whether divergence starts at boundaries, reductions, or exchanged data.
- Validate invariants such as conservation, positivity, or residual behavior.
- Distinguish acceptable reduction-order roundoff from real algorithmic drift.
- Inspect data ownership and update ordering before widening tolerances.
Wrong answers in parallel code are often communication or ownership bugs before they are "just floating-point noise."
Hangs and Deadlocks
- Check for mismatched send/receive patterns, collectives, or barriers.
- Look for code paths where one rank or thread can skip required synchronization.
- Inspect lock acquisition order and nested critical sections.
- Reduce concurrency to the smallest case that still hangs.
- Use timeouts, progress logging, or coarse checkpoints to locate the stall.
A hang is usually easier to localize when you first determine which participant stops making forward progress.
OpenMP and Threading Issues
- Review shared versus private data clauses carefully.
- Check reductions,
nowaitregions, task dependencies, and loop schedules. - Test whether
OMP_NUM_THREADS=1matches the serial code path. - Record
OMP_NUM_THREADS,OMP_PROC_BIND,OMP_PLACES, and any runtime affinity settings. - Watch for false sharing, oversubscription, and thread-unsafe library calls.
Thread count changes that alter correctness often point to hidden shared state.
MPI and Distributed Issues
- Verify message sizes, tags, communicators, and collective participation.
- Check decomposition logic and off-by-one errors at subdomain boundaries.
- Confirm that all ranks agree on global dimensions and iteration structure.
- Separate communication bugs from local-kernel bugs by validating local states before and after exchange points.
- Treat rank-dependent file I/O and restart logic as potential correctness hazards, not just infrastructure details.
Affinity and Runtime Configuration
- Record launcher arguments, rank counts, thread counts, and placement settings.
- Test whether binding, rank mapping, or oversubscription changes the failure.
- Distinguish correctness bugs from performance-sensitive scheduling behavior.
- Expect shared cluster environments to amplify timing-sensitive issues.
Runtime configuration is part of the bug report, not just execution trivia.
Useful Tools
Useful tools for this skill include:
gdborlldbfor process-level debugging;valgrindtools when slowdown is acceptable;- compiler sanitizers such as ThreadSanitizer or AddressSanitizer when supported by the toolchain and runtime;
- MPI launcher options and runtime diagnostics;
- strategic logging with rank or thread identifiers;
perfor profiler support only when a stall or slowdown may hide the bug.
Choose the lightest tool that can confirm or refute the current hypothesis.
Anti-Patterns
- debugging only at large scale when the bug reproduces at small scale;
- widening tolerances before checking communication or ownership logic;
- assuming nondeterminism means the bug is impossible to localize;
- changing thread and rank counts at the same time during diagnosis;
- ignoring environment variables and launcher configuration in bug reports;
- treating a hang as a performance issue without first finding the blocked phase.
Output Expectations
When using this skill, briefly note:
- what parallel configuration reproduces the issue;
- whether the failure is a crash, hang, wrong answer, or configuration-sensitive pathology;
- which thread, rank, reduction, exchange, or synchronization hypotheses were tested;
- what observations support the leading diagnosis;
- which uncertainty remains and what next isolation step is most justified.
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.

