Skip to main content

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

Project description

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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numba-mpi-0.40.tar.gz (34.4 kB view hashes)

Uploaded Source

Built Distribution

numba_mpi-0.40-py3-none-any.whl (26.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page