Parallelism and distribution
Scaling across MPI ranks and shared-memory threads.
monoprop scales in two complementary ways: across MPI ranks (distributing the operator) and across threads within each rank (shared-memory parallelism). The MPI distribution shards both the operator and the graph across ranks, which can allow variational optimisation and simulation of larger systems than would fit in memory on a single node.
Single-node (MPI.COMM_SELF)
from mpi4py import MPI
sim = MajoranaPropagator(..., comm=MPI.COMM_SELF)Multi-node (MPI.COMM_WORLD)
Replace the communicator and launch with mpiexec:
from mpi4py import MPI
sim = MajoranaPropagator(..., comm=MPI.COMM_WORLD)mpiexec -n 8 uv run python your_script.pyEnabling MPI
MPI is off by default, so the prebuilt PyPI wheels run single-rank and the communicators above only distribute work after a from-source build with MPI enabled. See Building from source for the full build instructions.
Shared-memory parallelism
Within each MPI rank, monoprop uses Intel oneTBB for shared-memory parallelism.
The thread count is read from the monoprop_NUM_THREADS environment variable,
for example:
export monoprop_NUM_THREADS=8When the variable is unset, TBB falls back to its own hardware-concurrency detection.