Class Datatype
Datatype
class represents MPI_Datatype
handles.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected long
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
protected static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Java binding ofMPI_TYPE_DUP
.void
commit()
Commits a derived datatype.static Datatype
createContiguous
(int count, Datatype oldType) Construct new datatype representing replication of old datatype into contiguous locations.static Datatype
createHIndexed
(int[] blockLengths, int[] displacements, Datatype oldType) Identical tocreateIndexed
except that the displacements are expressed directly in terms of the buffer index, rather than the units of the old type.static Datatype
createHVector
(int count, int blockLength, int stride, Datatype oldType) Identical tocreateVector
except that the stride is expressed directly in terms of the buffer index, rather than the units of the old type.static Datatype
createIndexed
(int[] blockLengths, int[] displacements, Datatype oldType) Construct new datatype representing replication of old datatype into a sequence of blocks where each block can contain a different number of copies and have a different displacement.static int
Create a new attribute key.static Datatype
createResized
(Datatype oldType, int lb, int extent) Create a datatype with a new lower bound and extent from an existing datatype.static Datatype
createStruct
(int[] blockLengths, int[] displacements, Datatype[] types) The most general type constructor.static Datatype
createVector
(int count, int blockLength, int stride, Datatype oldType) Construct new datatype representing replication of old datatype into locations that consist of equally spaced blocks.void
deleteAttr
(int keyval) Deletes an attribute value associated with a key.dup()
Java binding ofMPI_TYPE_DUP
.void
free()
Frees the datatype.static void
freeKeyval
(int keyval) Frees an attribute key.getAttr
(int keyval) Retrieves attribute value by key.int
Returns the extent of a datatype.int
getLb()
Returns the lower bound of a datatype.getName()
Return the print name from the datatype.protected int
Gets the offset of a buffer in bytes.int
getSize()
Returns the total size of a datatype - the number of buffer elements it represents.int
Returns the true extent of a datatype.int
Returns the true lower bound of a datatype.boolean
isNull()
Returnstrue
if this datatype is MPI_DATATYPE_NULL.void
Stores attribute value associated with a key.protected void
setBasic
(int type) protected void
void
Sets the print name for the datatype.
-
Field Details
-
handle
protected long handle -
baseType
protected int baseType -
baseSize
protected int baseSize -
NULL
protected static final int NULL- See Also:
-
BYTE
protected static final int BYTE- See Also:
-
CHAR
protected static final int CHAR- See Also:
-
SHORT
protected static final int SHORT- See Also:
-
BOOLEAN
protected static final int BOOLEAN- See Also:
-
INT
protected static final int INT- See Also:
-
LONG
protected static final int LONG- See Also:
-
FLOAT
protected static final int FLOAT- See Also:
-
DOUBLE
protected static final int DOUBLE- See Also:
-
PACKED
protected static final int PACKED- See Also:
-
INT2
protected static final int INT2- See Also:
-
SHORT_INT
protected static final int SHORT_INT- See Also:
-
LONG_INT
protected static final int LONG_INT- See Also:
-
FLOAT_INT
protected static final int FLOAT_INT- See Also:
-
DOUBLE_INT
protected static final int DOUBLE_INT- See Also:
-
FLOAT_COMPLEX
protected static final int FLOAT_COMPLEX- See Also:
-
DOUBLE_COMPLEX
protected static final int DOUBLE_COMPLEX- See Also:
-
-
Constructor Details
-
Datatype
protected Datatype()
-
-
Method Details
-
setBasic
protected void setBasic(int type) -
setBasic
-
getLb
Returns the lower bound of a datatype.Java binding of the MPI operation
MPI_TYPE_GET_EXTENT
.- Returns:
- lower bound of datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getExtent
Returns the extent of a datatype.Java binding of the MPI operation
MPI_TYPE_GET_EXTENT
.- Returns:
- datatype extent
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getTrueLb
Returns the true lower bound of a datatype.Java binding of the MPI operation
MPI_TYPE_GET_TRUE_EXTENT
.- Returns:
- lower bound of datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getTrueExtent
Returns the true extent of a datatype.Java binding of the MPI operation
MPI_TYPE_GET_TRUE_EXTENT
.- Returns:
- datatype true extent
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getSize
Returns the total size of a datatype - the number of buffer elements it represents.Java binding of the MPI operation
MPI_TYPE_SIZE
.- Returns:
- datatype size
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
commit
Commits a derived datatype. Java binding of the MPI operationMPI_TYPE_COMMIT
.- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
free
Frees the datatype.Java binding of the MPI operation
MPI_TYPE_FREE
.- Specified by:
free
in interfaceFreeable
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
isNull
public boolean isNull()Returnstrue
if this datatype is MPI_DATATYPE_NULL.- Returns:
true
if this datatype is MPI_DATATYPE_NULL
-
clone
Java binding ofMPI_TYPE_DUP
.It is recommended to use
dup()
instead ofclone()
because the last can't throw anMPIException
. -
dup
Java binding ofMPI_TYPE_DUP
.- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createContiguous
Construct new datatype representing replication of old datatype into contiguous locations.Java binding of the MPI operation
MPI_TYPE_CONTIGUOUS
.The base type of the new datatype is the same as the base type of
oldType
.- Parameters:
count
- replication countoldType
- old datatype- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createVector
public static Datatype createVector(int count, int blockLength, int stride, Datatype oldType) throws MPIException Construct new datatype representing replication of old datatype into locations that consist of equally spaced blocks.Java binding of the MPI operation
MPI_TYPE_VECTOR
.The base type of the new datatype is the same as the base type of
oldType
.- Parameters:
count
- number of blocksblockLength
- number of elements in each blockstride
- number of elements between start of each blockoldType
- old datatype- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createHVector
public static Datatype createHVector(int count, int blockLength, int stride, Datatype oldType) throws MPIException Identical tocreateVector
except that the stride is expressed directly in terms of the buffer index, rather than the units of the old type.Java binding of the MPI operation
MPI_TYPE_CREATE_HVECTOR
.- Parameters:
count
- number of blocksblockLength
- number of elements in eachstride
- number of bytes between start of each blockoldType
- old datatype- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createIndexed
public static Datatype createIndexed(int[] blockLengths, int[] displacements, Datatype oldType) throws MPIException Construct new datatype representing replication of old datatype into a sequence of blocks where each block can contain a different number of copies and have a different displacement.Java binding of the MPI operation
MPI_TYPE_INDEXED
.The number of blocks is taken to be size of the
blockLengths
argument. The second argument,displacements
, should be the same size. The base type of the new datatype is the same as the base type ofoldType
.- Parameters:
blockLengths
- number of elements per blockdisplacements
- displacement of each block in units of old typeoldType
- old datatype- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createHIndexed
public static Datatype createHIndexed(int[] blockLengths, int[] displacements, Datatype oldType) throws MPIException Identical tocreateIndexed
except that the displacements are expressed directly in terms of the buffer index, rather than the units of the old type.Java binding of the MPI operation
MPI_TYPE_CREATE_HINDEXED
.- Parameters:
blockLengths
- number of elements per blockdisplacements
- byte displacement in buffer for each blockoldType
- old datatype- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createStruct
public static Datatype createStruct(int[] blockLengths, int[] displacements, Datatype[] types) throws MPIException The most general type constructor.Java binding of the MPI operation
MPI_TYPE_CREATE_STRUCT
.The number of blocks is taken to be size of the
blockLengths
argument. The second and third arguments,displacements
, andtypes
, should be the same size.- Parameters:
blockLengths
- number of elements in each blockdisplacements
- byte displacement of each blocktypes
- type of elements in each block- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createResized
Create a datatype with a new lower bound and extent from an existing datatype.Java binding of the MPI operation
MPI_TYPE_CREATE_RESIZED
.- Parameters:
oldType
- input datatypelb
- new lower bound of datatype (address integer)extent
- new extent of datatype (address integer)- Returns:
- new datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
setName
Sets the print name for the datatype.- Parameters:
name
- name for the datatype- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getName
Return the print name from the datatype.- Returns:
- name of the datatype
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
createKeyval
Create a new attribute key.Java binding of the MPI operation
MPI_TYPE_CREATE_KEYVAL
.- Returns:
- attribute key for future access
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
freeKeyval
Frees an attribute key.Java binding of the MPI operation
MPI_TYPE_FREE_KEYVAL
.- Parameters:
keyval
- attribute key- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
setAttr
Stores attribute value associated with a key.Java binding of the MPI operation
MPI_TYPE_SET_ATTR
.- Parameters:
keyval
- attribute keyvalue
- attribute value- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getAttr
Retrieves attribute value by key.Java binding of the MPI operation
MPI_TYPE_GET_ATTR
.- Parameters:
keyval
- attribute key- Returns:
- attribute value or null if no attribute is associated with the key.
- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
deleteAttr
Deletes an attribute value associated with a key.Java binding of the MPI operation
MPI_TYPE_DELETE_ATTR
.- Parameters:
keyval
- attribute key- Throws:
MPIException
- Signals that an MPI exception of some sort has occurred.
-
getOffset
Gets the offset of a buffer in bytes.- Parameters:
buffer
- buffer- Returns:
- offset in bytes
-