scimate-ai/hpc-skills/hpc-petsc
Claude Code and agent skill by scimate-ai/hpc-skills
- community
Checking that the SKILL.md file is still in the repository.
Build, review, debug, and tune PETSc-based solver workflows. Use when working with PETSc `Vec`, `Mat`, `KSP`, `PC`, `SNES`, `TS`, options-database tuning, MPI-distributed assembly, external package integration, or PETSc build and runtime failures.
Install
npx vskill@latest install scimate-ai/hpc-skills/hpc-petscSKILL.md
HPC PETSc
Treat PETSc as a layered solver toolkit. Start from the highest-level object that matches the mathematical problem and only drop lower when there is a clear reason.
Start
- Read
references/solver-stack-and-object-model.mdbefore creating or repairing a PETSc-based solve path. - Read
references/ksp-and-pc-matrix.mdwhen selecting Krylov methods, direct solves, or preconditioner families. - Read
references/snes-and-ts-patterns.mdwhen the application is nonlinear or time-dependent. - Read
references/options-and-ksp-snes-playbook.mdwhen translating runtime options into code or debugging prefix handling. - Read
references/runtime-option-matrix.mdwhen selecting monitors, residual diagnostics, or common options-database switches. - Read
references/dm-and-discretization-playbook.mdwhenDM, nullspaces, multigrid layout, or field decomposition matter. - Read
references/external-backend-matrix.mdwhen deciding whether to route through HYPRE, direct solvers, or matrix-free paths. - Read
references/build-and-integration.mdwhen configuring PETSc, enabling external packages, or integrating PETSc into another codebase. - Read
references/parallel-and-runtime-debugging.mdwhen a distributed run shows assembly, ownership, convergence, or monitoring problems. - Read
references/error-recovery.mdwhen configure, setup, or solve phases fail.
Work sequence
- Classify the problem first:
- linear system ->
KSP - nonlinear residual ->
SNES - time-dependent problem ->
TS
- Choose the data model before tuning the solver:
Vecfor distributed unknownsMator matrix-free operator for the linearizationDMwhen mesh, hierarchy, or field layout must drive assembly and coarsening
- Get a robust baseline solve working before tuning for scale.
- Move configuration into the options database whenever practical so runs stay inspectable and reproducible.
- Read convergence reason and monitor output before changing algorithms.
Guardrails
- Do not hand-roll nonlinear or time-stepping logic that
SNESorTSalready manages unless the application truly needs it. - Do not tune preconditioners before checking operator correctness, boundary conditions, and assembly completion.
- Do not mix compiler, MPI, and external solver stacks casually across PETSc and the host application.
- Do not treat options prefixes or convergence reasons as optional diagnostics.
Additional References
Load these on demand:
references/ksp-and-pc-matrix.mdfor operator-class to solver-family mappingreferences/snes-and-ts-patterns.mdfor nonlinear and transient workflow designreferences/runtime-option-matrix.mdfor monitor, logging, and option-database baselinesreferences/dm-and-discretization-playbook.mdforDMDA,DMPlex, field splits, and hierarchy-aware setupreferences/external-backend-matrix.mdfor HYPRE, direct-solver, and matrix-free integration tradeoffsreferences/build-and-integration.mdfor external package wiring such as HYPRE or direct-solver backendsreferences/parallel-and-runtime-debugging.mdfor ownership ranges, assembly ordering, monitors, and distributed diagnosticsreferences/error-pattern-dictionary.mdfor fast matching of common PETSc failure classes
Reusable Templates
Use assets/templates/ when a concrete starting point is faster than rebuilding the solve path from scratch, especially:
ksp_poisson_minimal.cpetsc4py_ksp_minimal.pypetsc_build_example.shpetsc_ksp_slurm.sh
Outputs
Summarize:
- problem class and chosen PETSc layer
- matrix or operator strategy
- solver and preconditioner baseline
- runtime options or code-path decisions
- the exact failure phase if the workflow is being repaired
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hpc-petsc/SKILL.md
Popularity
- Repository stars
- 34
- Repository forks
- 6
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/scimate-ai/hpc-skills/hpc-petsc)