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

class mpi4py.typing.SupportsBuffer

Python buffer protocol.

See also

Buffer Protocol

__buffer__(flags, /)

Create a buffer from a Python object.

Parameters:

flags (int)

Return type:

memoryview

class mpi4py.typing.SupportsDLPack

DLPack data interchange protocol.

See also

dlpack:python-spec

__dlpack__(*, stream=None)

Export data for consumption as a DLPack capsule.

Parameters:

stream (int | Any | None)

Return type:

object

__dlpack_device__()

Get device type and device ID in DLPack format.

Return type:

Tuple[int, int]

class mpi4py.typing.SupportsCAI

CUDA Array Interface (CAI) protocol.

See also

numba:cuda-array-interface

property __cuda_array_interface__: Dict[str, Any]

CAI protocol data.

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

Buffer-like object.

type mpi4py.typing.Bottom = BottomType | None

Start of the address range.

type mpi4py.typing.InPlace = InPlaceType | None

In-place buffer argument.

type mpi4py.typing.Aint = SupportsIndex

Address-sized integral type.

type mpi4py.typing.Count = SupportsIndex

Integral type for counts.

type mpi4py.typing.Displ = SupportsIndex

Integral type for displacements.

type mpi4py.typing.Offset = SupportsIndex

Integral type for offsets.

type mpi4py.typing.TypeSpec = Datatype | str

Datatype specification.

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

Buffer specification.

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

Buffer specification (block).

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

Buffer specification (vector).

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

Buffer specification (generalized).

type mpi4py.typing.TargetSpec = SupportsIndex | Tuple | Tuple[SupportsIndex] | Tuple[SupportsIndex, SupportsIndex] | Tuple[SupportsIndex, SupportsIndex, Datatype | str] | List[Any]

Target specification.

mpi4py.typing.S = ~S

Type variable.

mpi4py.typing.T = ~T

Type variable.

mpi4py.typing.U = ~U

Type variable.

mpi4py.typing.V = ~V

Type variable.