mpi4py.MPI.buffer

class mpi4py.MPI.buffer

Bases: object

Buffer.

static __new__(cls, buf)
Parameters:

buf (Buffer) –

Return type:

Self

Methods Summary

allocate(nbytes[, clear])

Buffer allocation.

fromaddress(address, nbytes[, readonly])

Buffer from address and size in bytes.

frombuffer(obj[, readonly])

Buffer from buffer-like object.

release()

Release the underlying buffer exposed by the buffer object.

tobytes([order])

Return the data in the buffer as a byte string.

toreadonly()

Return a readonly version of the buffer object.

Attributes Summary

address

Buffer address.

format

Format of each element.

itemsize

Size (in bytes) of each element.

nbytes

Buffer size (in bytes).

obj

Object exposing buffer.

readonly

Buffer is read-only.

Methods Documentation

static allocate(nbytes, clear=False)

Buffer allocation.

Parameters:
  • nbytes (int) –

  • clear (bool) –

Return type:

buffer

static fromaddress(address, nbytes, readonly=False)

Buffer from address and size in bytes.

Parameters:
  • address (int) –

  • nbytes (int) –

  • readonly (bool) –

Return type:

buffer

static frombuffer(obj, readonly=False)

Buffer from buffer-like object.

Parameters:
Return type:

buffer

release()

Release the underlying buffer exposed by the buffer object.

Return type:

None

tobytes(order=None)

Return the data in the buffer as a byte string.

Parameters:

order (str | None) –

Return type:

bytes

toreadonly()

Return a readonly version of the buffer object.

Return type:

buffer

Attributes Documentation

address

Buffer address.

format

Format of each element.

itemsize

Size (in bytes) of each element.

nbytes

Buffer size (in bytes).

obj

Object exposing buffer.

readonly

Buffer is read-only.