mpi4py.MPI.memory¶
- class mpi4py.MPI.memory(buf)¶
Bases:
object
Memory buffer
- Parameters
buf (Buffer) –
- Return type
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
Return a readonly version of the memory object
Attributes Summary
Memory address
A string with the format of each element
The size in bytes of each element
Memory size (in bytes)
The underlying object of the memory
Boolean indicating whether the memory is read-only
Methods Documentation
- static allocate(nbytes, clear=False)¶
Memory allocation
- Parameters
nbytes (int) –
clear (bool) –
- Return type
- static fromaddress(address, nbytes, readonly=False)¶
Memory from address and size in bytes
- Parameters
address (int) –
nbytes (int) –
readonly (bool) –
- Return type
- static frombuffer(obj, readonly=False)¶
Memory from buffer-like object
- Parameters
obj (Buffer) –
readonly (bool) –
- Return type
- 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 (Optional[str]) –
- Return type
bytes
Attributes Documentation
- address¶
Memory address
- format¶
A string with the format of each element
- itemsize¶
The size in bytes of each element
- nbytes¶
Memory size (in bytes)
- obj¶
The underlying object of the memory
- readonly¶
Boolean indicating whether the memory is read-only