# mpi4py.typing

Added in version 4.0.0.

This module provides type aliases used to add type hints to the various functions and methods within the `MPI` module.

See also

Module `typing`

  Documentation of the `typing` standard module.

Types Summary

`SupportsBuffer` | Python buffer protocol.
`SupportsDLPack` | DLPack data interchange protocol.
`SupportsCAI` | CUDA Array Interface (CAI) protocol.
`Buffer` | Buffer-like object.
`Bottom` | Start of the address range.
`InPlace` | In-place buffer argument.
`Aint` | Address-sized integral type.
`Count` | Integral type for counts.
`Displ` | Integral type for displacements.
`Offset` | Integral type for offsets.
`TypeSpec` | Datatype specification.
`BufSpec` | Buffer specification.
`BufSpecB` | Buffer specification (block).
`BufSpecV` | Buffer specification (vector).
`BufSpecW` | Buffer specification (generalized).
`TargetSpec` | Target specification.

Types Documentation

mpi4py.typing.SupportsBuffer = <class 'mpi4py.typing.SupportsBuffer'>

  Python buffer protocol.

  See also

  Buffer Protocol

mpi4py.typing.SupportsDLPack = <class 'mpi4py.typing.SupportsDLPack'>

  DLPack data interchange protocol.

  See also

  dlpack:python-spec

mpi4py.typing.SupportsCAI = <class 'mpi4py.typing.SupportsCAI'>

  CUDA Array Interface (CAI) protocol.

  See also

  numba:cuda-array-interface

mpi4py.typing.Buffer = mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI

  Buffer-like object.

mpi4py.typing.Bottom = mpi4py.MPI.BottomType | None

  Start of the address range.

mpi4py.typing.InPlace = mpi4py.MPI.InPlaceType | None

  In-place buffer argument.

mpi4py.typing.Aint = <class 'typing.SupportsIndex'>

  Address-sized integral type.

  alias of `SupportsIndex`

mpi4py.typing.Count = <class 'typing.SupportsIndex'>

  Integral type for counts.

  alias of `SupportsIndex`

mpi4py.typing.Displ = <class 'typing.SupportsIndex'>

  Integral type for displacements.

  alias of `SupportsIndex`

mpi4py.typing.Offset = <class 'typing.SupportsIndex'>

  Integral type for offsets.

  alias of `SupportsIndex`

mpi4py.typing.TypeSpec = mpi4py.MPI.Datatype | str

  Datatype specification.

mpi4py.typing.BufSpec = mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.SupportsIndex] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.SupportsIndex, mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.MPI.BottomType | None, typing.SupportsIndex, mpi4py.MPI.Datatype] | typing.List[typing.Any]

  Buffer specification.

  - `Buffer`

  - Tuple[`Buffer`, `Count`]

  - Tuple[`Buffer`, `TypeSpec`]

  - Tuple[`Buffer`, `Count`, `TypeSpec`]

  - Tuple[`Bottom`, `Count`, `Datatype`]

mpi4py.typing.BufSpecB = mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.SupportsIndex] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.SupportsIndex, mpi4py.MPI.Datatype | str] | typing.List[typing.Any]

  Buffer specification (block).

  - `Buffer`

  - Tuple[`Buffer`, `Count`]

  - Tuple[`Buffer`, `TypeSpec`]

  - Tuple[`Buffer`, `Count`, `TypeSpec`]

mpi4py.typing.BufSpecV = mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Sequence[typing.SupportsIndex]] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Tuple[typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex]]] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Sequence[typing.SupportsIndex], mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Tuple[typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex]], mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex], mpi4py.MPI.Datatype | str] | typing.Tuple[mpi4py.MPI.BottomType | None, typing.Tuple[typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex]], mpi4py.MPI.Datatype] | typing.Tuple[mpi4py.MPI.BottomType | None, typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex], mpi4py.MPI.Datatype] | typing.List[typing.Any]

  Buffer specification (vector).

  - `Buffer`

  - Tuple[`Buffer`, Sequence[`Count`]]

  - Tuple[`Buffer`, Tuple[Sequence[`Count`], Sequence[`Displ`]]]

  - Tuple[`Buffer`, `TypeSpec`]

  - Tuple[`Buffer`, Sequence[`Count`], `TypeSpec`]

  - Tuple[`Buffer`, Tuple[Sequence[`Count`], Sequence[`Displ`]], `TypeSpec`]

  - Tuple[`Buffer`, Sequence[`Count`], Sequence[`Displ`], `TypeSpec`]

  - Tuple[`Bottom`, Tuple[Sequence[`Count`], Sequence[`Displ`]], `Datatype`]

  - Tuple[`Bottom`, Sequence[`Count`], Sequence[`Displ`], `Datatype`]

mpi4py.typing.BufSpecW = typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Sequence[mpi4py.MPI.Datatype]] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Tuple[typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex]], typing.Sequence[mpi4py.MPI.Datatype]] | typing.Tuple[mpi4py.typing.SupportsBuffer | mpi4py.typing.SupportsDLPack | mpi4py.typing.SupportsCAI, typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex], typing.Sequence[mpi4py.MPI.Datatype]] | typing.Tuple[mpi4py.MPI.BottomType | None, typing.Tuple[typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex]], typing.Sequence[mpi4py.MPI.Datatype]] | typing.Tuple[mpi4py.MPI.BottomType | None, typing.Sequence[typing.SupportsIndex], typing.Sequence[typing.SupportsIndex], typing.Sequence[mpi4py.MPI.Datatype]] | typing.List[typing.Any]

  Buffer specification (generalized).

  - Tuple[`Buffer`, Sequence[`Datatype`]]

  - Tuple[`Buffer`, Tuple[Sequence[`Count`], Sequence[`Displ`]], Sequence[`Datatype`]]

  - Tuple[`Buffer`, Sequence[`Count`], Sequence[`Displ`], Sequence[`Datatype`]]

  - Tuple[`Bottom`, Tuple[Sequence[`Count`], Sequence[`Displ`]], Sequence[`Datatype`]]

  - Tuple[`Bottom`, Sequence[`Count`], Sequence[`Displ`], Sequence[`Datatype`]]

mpi4py.typing.TargetSpec = typing.SupportsIndex | typing.Tuple[()] | typing.Tuple[typing.SupportsIndex] | typing.Tuple[typing.SupportsIndex, typing.SupportsIndex] | typing.Tuple[typing.SupportsIndex, typing.SupportsIndex, mpi4py.MPI.Datatype | str] | typing.List[typing.Any]

  Target specification.

  - `Displ`

  - Tuple[()]

  - Tuple[`Displ`]

  - Tuple[`Displ`, `Count`]

  - Tuple[`Displ`, `Count`, `TypeSpec`]

mpi4py.typing.S = TypeVar("S")

  Invariant `TypeVar`.

mpi4py.typing.T = TypeVar("T")

  Invariant `TypeVar`.

mpi4py.typing.U = TypeVar("U")

  Invariant `TypeVar`.

mpi4py.typing.V = TypeVar("V")

  Invariant `TypeVar`.