numba-mpi

Numba @njittable MPI wrappers tested on Linux, macOS and Windows


Keywords
conda-forge, hpc, mpi, mpi4py, numba, pypi-package, python
License
GPL-3.0
Install
pip install numba-mpi==0.40

Documentation

numba-mpi logo numba-mpi

Python 3 LLVM Linux OK macOS OK Windows OK Github Actions Status Maintenance License: GPL v3 PyPI version Anaconda-Server Badge AUR package DOI

Numba @njittable MPI wrappers

  • covering: size/rank, send/recv, allreduce, bcast, scatter/gather & allgather, barrier and wtime
  • basic asynchronous communication with isend/irecv (only for contiguous arrays); for request handling including wait/waitall/waitany and test/testall/testany
  • not yet implemented: support for non-default communicators, ...
  • API based on NumPy and supporting numeric and character datatypes
  • auto-generated docstring-based API docs on the web: https://numba-mpi.github.io/numba-mpi
  • pure-Python implementation with packages available at PyPI, Conda Forge and for Arch Linux
  • CI-tested on: Linux (MPICH, OpenMPI & Intel MPI), macOS (MPICH & OpenMPI) and Windows (MS MPI)

Hello world example:

import numba, numba_mpi, numpy

@numba.njit()
def hello():
  print(numba_mpi.rank())
  print(numba_mpi.size())

  src = numpy.array([1., 2., 3., 4., 5.])
  dst_tst = numpy.empty_like(src)

  if numba_mpi.rank() == 0:
    numba_mpi.send(src, dest=1, tag=11)
  elif numba_mpi.rank() == 1:
    numba_mpi.recv(dst_tst, source=0, tag=11)

hello()

For information on MPI, see: