Skip to content
Projects

Installation

mpifield needs Python 3.10 or newer. Install it from PyPI:

Terminal window
pip install mpifield

or, for development, from a checkout with uv:

Terminal window
git clone https://github.com/max-models/mpifield.git
cd mpifield
make install # uv sync --extra dev, plus the pre-commit hooks
ExtraInstallsFor
mpimpi4pyruns under mpiexec or srun; serial runs use maybempi’s stand-in and never start MPI
plotmatplotlib, plasma-plotsField.plot
gpuCuPythe CUDA kernels, for fields and markers on the GPU
metalMLXthe Metal kernels on Apple-silicon Macs
testpytest, pytest-mpi, coveragethe tests
docsthe notebook runner, griffethis site
devruff, pyright, pre-commit, plus test and docsdevelopment
Terminal window
pip install "mpifield[mpi,plot]"

The CPU kernels are Python files compiled with Pyccel the first time they run, with OpenMP, and cached on disk:

VariableDefaultEffect
MPIFIELD_KERNEL_CACHE~/.cache/mpifield/kernelswhere the compiled kernels are kept
MPIFIELD_OPENMP10 builds them without OpenMP
OMP_NUM_THREADSall coresthreads per process; under MPI, the cores per rank

Compiling needs a C compiler. Without one, run the NumPy versions: cunumpy.kernels.set_host_kernel_implementation("numpy").