19134984/-2d-3d-/mpi-domain-decomposition
Claude Code and agent skill by 19134984/-2d-3d-
- community
Checking that the SKILL.md file is still in the repository.
Implement or review MPI domain decomposition in this repository, especially slab decomposition, halo exchange, reductions, and gathered diagnostics in `3DRBOpenaccMpi.F90` or derived MPI solvers. Use when adding ranks, `MPI_Sendrecv`, halo layers, `MPI_Allreduce`, `MPI_Gather`, global or local indexing, or rank-specific output.
Install
npx vskill@latest install 19134984/-2d-3d-/mpi-domain-decompositionSKILL.md
The same SKILL.md was published earlier as 19134984/-2d-3d-/mpi-domain-decomposition.
MPI Domain Decomposition
Use this skill when a change affects how the solver is split across ranks or how rank-local results are assembled back into global results.
Repository baseline
Use 3DRBOpenaccMpi.F90 as the source of truth.
The current MPI design is:
- 1D
z-slab decomposition - owned cells on
1:nz - halo planes on
0andnz+1 - global range tracked by
zStartGlobalandzEndGlobal - neighbor ranks tracked by
mpiLeftandmpiRight
Do not silently change this decomposition model. Call out any move away from 1D z-slabs as an architectural departure.
Default workflow
1. Define the local subdomain correctly
Update the split logic together:
nzGlobal,nz,zStartGlobal,zEndGlobal- first-rank and last-rank flags
- periodic-neighbor handling
- root-rank assumptions for reporting
Keep local sizes strictly positive and guard impossible rank counts early.
2. Keep halo ownership unambiguous
Treat:
1:nzas owned interior planes0as the lower halonz+1as the upper halo
When porting a new field into MPI, update allocation, initialization, reload, halo exchange, and post-processing together.
3. Keep communication pairs symmetric
Match send and receive logic in one place:
- same buffer length on both sides
- distinct tags for distinct data families
MPI_PROC_NULLbranches for non-periodic outer ranks- identical pack and unpack traversal order
For the current repository, mirror the style of exchange_f_post_halo_mpi and exchange_g_post_halo_mpi.
4. Keep global reductions correct
Use:
MPI_Allreducefor global sums, residuals,Nu, andReMPI_GatherorMPI_Gathervwhen root must choose a maximum or reconstruct ordered data
Do not trust a global diagnostic until the reduction path is verified.
5. Keep local and global coordinates distinct
When computing extrema or mid-plane quantities:
- use local coordinates only for rank-local search
- convert or compare against global coordinates before reporting
- handle the case where the target global plane is not owned by a given rank
Mirror the style of calc_umid_max_common3d, calc_vmid_max_common3d, and calc_wmid_max_common3d.
MPI plus OpenACC rule
If arrays live on the device:
- update the boundary planes back to host before MPI communication
- perform MPI on host buffers unless the code explicitly supports device-aware MPI
- update the modified halo data back to the device before the next GPU kernel
Use openacc-porting together with this skill when both concerns are active.
Common failure modes
- Mix local
nzwith globalnzGlobal. - Forget to update both flow and thermal halo exchanges.
- Reuse a tag and accidentally cross-wire two message families.
- Write root-only files from all ranks.
- Validate local
Nuor residuals but forget the finalMPI_Allreduce.
Security
- Security scanPassed, 100 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 repositoryChecking2DRB/codex-skills/mpi-domain-decomposition/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
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/19134984/-2d-3d-/mpi-domain-decomposition)