mpi4py.MPI.memory

class mpi4py.MPI.memory

Bases: object

Memory buffer.

static __new__(cls, buf)
Parameters:

buf (Buffer) –

Return type:

memory

Methods Summary

allocate(nbytes[, clear])

Memory allocation.

fromaddress(address, nbytes[, readonly])

Memory from address and size in bytes.

frombuffer(obj[, readonly])

Memory from buffer-like object.

release()

Release the underlying buffer exposed by the memory object.

tobytes([order])

Return the data in the buffer as a byte string.

toreadonly()

Return a readonly version of the memory object.

Attributes Summary

address

Memory address.

format

Format of each element.

itemsize

Size (in bytes) of each element.

nbytes

Memory size (in bytes).

obj

Object exposing the memory.

readonly

Memory is read-only.

Methods Documentation

static allocate(nbytes, clear=False)

Memory allocation.

Parameters:
  • nbytes (int) –

  • clear (bool) –

Return type:

memory

static fromaddress(address, nbytes, readonly=False)

Memory from address and size in bytes.

Parameters:
  • address (int) –

  • nbytes (int) –

  • readonly (bool) –

Return type:

memory

static frombuffer(obj, readonly=False)

Memory from buffer-like object.

Parameters:
Return type:

memory

release()

Release the underlying buffer exposed by the memory 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 memory object.

Return type:

memory

Attributes Documentation

address

Memory address.

format

Format of each element.

itemsize

Size (in bytes) of each element.

nbytes

Memory size (in bytes).

obj

Object exposing the memory.

readonly

Memory is read-only.