Add MPI parallelization infrastructure for distributed FE computation#35
Draft
Copilot wants to merge 2 commits into
Draft
Add MPI parallelization infrastructure for distributed FE computation#35Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
- Add edelweissfe/numerics/mpi/ package with: - mpiutils.py: MPI communicator wrapper with fallback stubs - partitioner.py: Mesh partitioning with RCB algorithm - distributeddofmanager.py: Local/ghost/global DOF mapping - petscsolver.py: Distributed PETSc KSP linear solver - Add NISTMPI solver (nonlinearimplicitstaticmpi.py) extending NIST with MPI-parallel element computation and collective reductions - Register NISTMPI in solver library - Add MPI test input file
Copilot created this pull request from a session on behalf of
matthiasneuner
May 27, 2026 17:44
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds foundational MPI infrastructure using mpi4py/petsc4py for distributed-memory parallelization. Uses a replicated-model approach: all ranks hold the full mesh, elements are partitioned for parallel computation, results combined via Allreduce. This parallelizes the expensive element evaluation phase with minimal architectural disruption.
New package:
edelweissfe/numerics/mpi/mpiutils.py— Thin mpi4py wrapper with serial fallback stubs (comm, rank, size, collectives)partitioner.py— Element partitioning via Recursive Coordinate Bisection; node ownership = lowest-ranked element owner; ghost identificationdistributeddofmanager.py— Local/ghost/global DOF index maps, PETSc ownership rangespetscsolver.py— Distributed PETSc Mat/Vec/KSP with batch assemblyNew solver:
NISTMPINISTwith partitionedcomputeElements()— each rank evaluates its element subsetAllreduce(SUM)on P, K, F vectors so all ranks have consistent global stateConfig
edelweissfe/config/solvers.py: register"NISTMPI"→"nonlinearimplicitstaticmpi"Limitations / future work
This is the "medium" difficulty path from the analysis — replicated model with partitioned computation. True distributed scalability (ghost exchange, distributed Mat assembly, rank-aware I/O) requires the deeper refactor of
DofManager/VIJSystemMatrixownership semantics.