public abstract class Datatype
extends java.lang.Object
Datatype
class represents MPI_DATATYPE
handles.Modifier and Type | Field and Description |
---|---|
int |
baseType |
Constructor and Description |
---|
Datatype() |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commit a derived datatype.
|
static Datatype |
createContiguous(int count,
Datatype oldtype)
Construct new datatype representing replication of old datatype into contiguous locations.
|
static Datatype |
createHVector(int count,
int blocklength,
int stride,
Datatype oldtype)
Identical to vector 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[] array_of_blocklengths,
int[] array_of_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 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.
|
int |
extent()
Returns the extent of a datatype - the difference between upper and lower bound.
|
void |
free()
Frees the datatype.
|
int |
getByteSize() |
int |
getType() |
static Datatype |
hIndexed(int[] array_of_blocklengths,
int[] array_of_displacements,
Datatype oldtype)
Identical to
indexed except that the displacements are expressed directly in terms of
the buffer index, rather than the units of the old type. |
int |
lb()
Find the lower bound of a datatype - the least value in its displacement sequence.
|
int |
size()
Returns the total size of a datatype - the number of buffer elements it represents.
|
static Datatype |
struct(int[] array_of_blocklengths,
int[] array_of_displacements,
Datatype[] array_of_types)
The most general type constructor.
|
int |
ub()
Find the upper bound of a datatype - the greatest value in its displacement sequence.
|
public static Datatype createContiguous(int count, Datatype oldtype) throws MPIException
count
- replication count.oldtype
- datatype.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
.
MPIException
- Points out that an MPI exception has occured.public static Datatype createVector(int count, int blocklength, int stride, Datatype oldtype) throws MPIException
count
- number of blocks.blocklength
- number of elements in each block.stride
- number of elements between start of each block.oldtype
- old datatype.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
.
MPIException
- Points out that an MPI exception has occured.public static Datatype createHVector(int count, int blocklength, int stride, Datatype oldtype) throws MPIException
count
- number of blocks.blocklength
- number of elements in each block.stride
- number of elements between start of each block.oldtype
- old datatype.Java binding of the MPI operation MPI_TYPE_CREATE_HVECTOR
.
Unlike other language bindings, the value of stride
is not
measured in bytes.
MPIException
- Points out that an MPI exception has occured.public static Datatype createIndexed(int[] array_of_blocklengths, int[] array_of_displacements, Datatype oldtype) throws MPIException
array_of_blocklengths
- number of elements per block.array_of_displacements
- displacement of each block in units of old
type.oldtype
- old datatype.Java binding of the MPI operation MPI_TYPE_INDEXED
.
The number of blocks is taken to be size of the array_of_blocklengths
argument. The
second argument, array_of_displacements
, should be the same size. The base type of the
new datatype is the same as the base type of oldtype
.
MPIException
- Points out that an MPI exception has occured.public static Datatype hIndexed(int[] array_of_blocklengths, int[] array_of_displacements, Datatype oldtype) throws MPIException
indexed
except that the displacements are expressed directly in terms of
the buffer index, rather than the units of the old type.array_of_blocklengths
- number of elements per block.array_of_displacements
- displacement in buffer for each block.oldtype
- old datatype.Java binding of the MPI operation MPI_TYPE_HINDEXED
.
Unlike other language bindings, the values in array_of_displacements
are
not measured in bytes.
MPIException
- Points out that an MPI exception has occured.public static Datatype struct(int[] array_of_blocklengths, int[] array_of_displacements, Datatype[] array_of_types) throws MPIException
array_of_blocklengths
- number of elements per block.array_of_displacements
- displacement in buffer for each block.array_of_types
- type of elements in each block.Java binding of the MPI operation MPI_TYPE_STRUCT
.
The number of blocks is taken to be size of the array_of_blocklengths
argument. The
second and third arguments, array_of_displacements
, and array_of_types
,
should be the same size. Unlike other language bindings, the values in
array_of_displacements
are not measured in bytes. All elements of
array_of_types
with definite base types must have the same base
type: this will be the base type of new datatype.
MPIException
- Points out that an MPI exception has occured.public int getType()
public int getByteSize()
public int extent() throws MPIException
Java binding of the MPI operation MPI_TYPE_EXTENT
.
MPIException
- Points out that an MPI exception has occured.public int size() throws MPIException
Java binding of the MPI operation MPI_TYPE_SIZE
.
MPIException
- Points out that an MPI exception has occured.public int lb() throws MPIException
Java binding of the MPI operation MPI_TYPE_LB
.
MPIException
- Points out that an MPI exception has occured.public int ub() throws MPIException
Java binding of the MPI operation MPI_TYPE_UB
.
MPIException
- Points out that an MPI exception has occured.public void commit() throws MPIException
Java binding of the MPI operation MPI_TYPE_COMMIT
.
MPIException
- Points out that an MPI exception has occured.public void free() throws MPIException
Java binding of the MPI operation MPI_TYPE_FREE
.
Not Implemented in the current release
.MPIException
- Points out that an MPI exception has occured.