mpi4py.MPI.Datatype¶
- class mpi4py.MPI.Datatype¶
Bases:
objectDatatype object.
Methods Summary
Commit()Commit the datatype.
Create_contiguous(count)Create a contiguous datatype.
Create_darray(size, rank, gsizes, distribs, ...)Create a datatype for a distributed array on Cartesian process grids.
Create_f90_complex(p, r)Return a bounded complex datatype.
Return a bounded integer datatype.
Create_f90_real(p, r)Return a bounded real datatype.
Create_hindexed(blocklengths, displacements)Create an indexed datatype.
Create_hindexed_block(blocklength, displacements)Create an indexed datatype with constant-sized blocks.
Create_hvector(count, blocklength, stride)Create a vector (strided) datatype with stride in bytes.
Create_indexed(blocklengths, displacements)Create an indexed datatype.
Create_indexed_block(blocklength, displacements)Create an indexed datatype with constant-sized blocks.
Create_keyval([copy_fn, delete_fn, nopython])Create a new attribute key for datatypes.
Create_resized(lb, extent)Create a datatype with a new lower bound and extent.
Create_struct(blocklengths, displacements, ...)Create a general composite (struct) datatype.
Create_subarray(sizes, subsizes, starts[, order])Create a datatype for a subarray of a multidimensional array.
Create_vector(count, blocklength, stride)Create a vector (strided) datatype.
Delete_attr(keyval)Delete attribute value associated with a key.
Dup()Duplicate a datatype.
Free()Free the datatype.
Free_keyval(keyval)Free an attribute key for datatypes.
Get_attr(keyval)Retrieve attribute value by key.
Return the input arguments used to create a datatype.
Return the number of input arguments used to create a datatype.
Return lower bound and extent of datatype.
Get_name()Get the print name for this datatype.
Get_size()Return the number of bytes occupied by entries in the datatype.
Return the true lower bound and extent of a datatype.
Get_value_index(value, index)Return a predefined pair datatype.
Match_size(typeclass, size)Find a datatype matching a specified size in bytes.
Pack(inbuf, outbuf, position, comm)Pack into contiguous memory according to datatype.
Pack_external(datarep, inbuf, outbuf, position)Pack into contiguous memory according to datatype.
Pack_external_size(datarep, count)Determine the amount of space needed to pack a message.
Pack_size(count, comm)Determine the amount of space needed to pack a message.
Set_attr(keyval, attrval)Store attribute value associated with a key.
Set_name(name)Set the print name for this datatype.
Unpack(inbuf, position, outbuf, comm)Unpack from contiguous memory according to datatype.
Unpack_external(datarep, inbuf, position, outbuf)Unpack from contiguous memory according to datatype.
decode()Convenience method for decoding a datatype.
f2py(arg)free()Call
Freeif not null or predefined.fromcode(code)Get predefined MPI datatype from character code or type string.
fromhandle(handle)Create object from MPI handle.
fromint(arg, /)Translate integer handle to object.
py2f()tocode()Get character code or type string from predefined MPI datatype.
toint()Translate object to integer handle.
Attributes Summary
Combiner.
Contents.
Envelope.
Extent.
MPI handle.
Is a named datatype.
Is a predefined datatype.
Lower bound.
Print name.
Size (in bytes).
True extent.
True lower bound.
True upper bound.
Character code.
Type string.
Upper bound.
Methods Documentation
- Create_darray(size, rank, gsizes, distribs, dargs, psizes, order=ORDER_C)¶
Create a datatype for a distributed array on Cartesian process grids.
- classmethod Create_f90_complex(p, r)¶
Return a bounded complex datatype.
- classmethod Create_f90_integer(r)¶
Return a bounded integer datatype.
- classmethod Create_f90_real(p, r)¶
Return a bounded real datatype.
- Create_hindexed(blocklengths, displacements)¶
Create an indexed datatype.
Note
Displacements are measured in bytes.
- Create_hindexed_block(blocklength, displacements)¶
Create an indexed datatype with constant-sized blocks.
Note
Displacements are measured in bytes.
- Create_hvector(count, blocklength, stride)¶
Create a vector (strided) datatype with stride in bytes.
- Create_indexed(blocklengths, displacements)¶
Create an indexed datatype.
- Create_indexed_block(blocklength, displacements)¶
Create an indexed datatype with constant-sized blocks.
- classmethod Create_keyval(copy_fn=None, delete_fn=None, nopython=False)¶
Create a new attribute key for datatypes.
- Create_resized(lb, extent)¶
Create a datatype with a new lower bound and extent.
- classmethod Create_struct(blocklengths, displacements, datatypes)¶
Create a general composite (struct) datatype.
Note
Displacements are measured in bytes.
- Create_subarray(sizes, subsizes, starts, order=ORDER_C)¶
Create a datatype for a subarray of a multidimensional array.
- Create_vector(count, blocklength, stride)¶
Create a vector (strided) datatype.
- Delete_attr(keyval)¶
Delete attribute value associated with a key.
- classmethod Free_keyval(keyval)¶
Free an attribute key for datatypes.
- Get_attr(keyval)¶
Retrieve attribute value by key.
- Get_contents()¶
Return the input arguments used to create a datatype.
- Get_envelope()¶
Return the number of input arguments used to create a datatype.
- Get_true_extent()¶
Return the true lower bound and extent of a datatype.
- classmethod Get_value_index(value, index)¶
Return a predefined pair datatype.
- classmethod Match_size(typeclass, size)¶
Find a datatype matching a specified size in bytes.
- Pack(inbuf, outbuf, position, comm)¶
Pack into contiguous memory according to datatype.
- Pack_external(datarep, inbuf, outbuf, position)¶
Pack into contiguous memory according to datatype.
Uses the portable data representation external32.
- Pack_external_size(datarep, count)¶
Determine the amount of space needed to pack a message.
Uses the portable data representation external32.
Note
Returns an upper bound measured in bytes.
- Pack_size(count, comm)¶
Determine the amount of space needed to pack a message.
Note
Returns an upper bound measured in bytes.
- Set_attr(keyval, attrval)¶
Store attribute value associated with a key.
- Unpack(inbuf, position, outbuf, comm)¶
Unpack from contiguous memory according to datatype.
- Unpack_external(datarep, inbuf, position, outbuf)¶
Unpack from contiguous memory according to datatype.
Uses the portable data representation external32.
- decode()¶
Convenience method for decoding a datatype.
- classmethod fromcode(code)¶
Get predefined MPI datatype from character code or type string.
- classmethod fromhandle(handle)¶
Create object from MPI handle.
- classmethod fromint(arg, /)¶
Translate integer handle to object.
Attributes Documentation
- combiner¶
Combiner.
- contents¶
Contents.
- envelope¶
Envelope.
- extent¶
Extent.
- handle¶
MPI handle.
- is_named¶
Is a named datatype.
- is_predefined¶
Is a predefined datatype.
- lb¶
Lower bound.
- name¶
Print name.
- size¶
Size (in bytes).
- true_extent¶
True extent.
- true_lb¶
True lower bound.
- true_ub¶
True upper bound.
- typechar¶
Character code.
- typestr¶
Type string.
- ub¶
Upper bound.