Next: Collective Communication
Up: Point-to-Point Communication
Previous: Derived datatypes
Contents
int Comm.pack(Object inbuf, int offset, int incount,
Datatype datatype,
byte [] outbuf, int position)
| inbuf |
input buffer array |
| offset |
initial offset in input buffer |
| incount |
number of items in input buffer |
| datatype |
datatype of each item in input buffer |
| outbuf |
output buffer |
| position |
initial position in ouput buffer |
| |
|
| returns: |
final position in output buffer |
Packs message in send buffer inbuf into space specified in
outbuf.
Java binding of the MPI operation MPI_PACK.
The return value is the output value of position--the
inital value incremented by the number of bytes written.
byte[] Comm.pack(Object inbuf, int offset, int incount,
Datatype datatype)
| inbuf |
input buffer array |
| offset |
initial offset in input buffer |
| incount |
number of items in input buffer |
| datatype |
datatype of each item in input buffer |
| |
|
| returns: |
output buffer |
Packs message in send buffer inbuf into buffer space allocated
internally.
- Rationale. This variant of pack is essentially equivalent to calling MPI_PACK_SIZE to find the amount of space needed for a packed
message, allocating a suitable byte vector, then calling the previous
variant of pack. Unfortunately the object serialization
mechanisms of Java do not provide a convenient way of precomputing the
amount of space required to pack objects (there is no analogue to
MPI_PACK_SIZE). So if the base type of the message is MPI.OBJECT the second form of pack is more convenient.(End of rationale.)
int Comm.unpack(byte [] inbuf, int position,
Object outbuf, int offset, int outcount,
Datatype datatype)
| inbuf |
input buffer |
| position |
initial position in input buffer |
| outbuf |
output buffer array |
| offset |
initial offset in output buffer |
| outcount |
number of items in output buffer |
| datatype |
datatype of each item in output buffer |
| |
|
| returns: |
final position in input buffer |
Unpacks message in receive buffer outbuf into space specified in
inbuf.
Java binding of the MPI operation MPI_UNPACK.
The return value is the output value of position--the
inital value incremented by the number of bytes read.
int Comm.packSize(int incount, Datatype datatype)
| incount |
number of items in input buffer |
| datatype |
datatype of each item in input buffer |
| |
|
| returns: |
upper bound on size of packed message |
Returns an upper bound on the increment of position effected
by pack.
Java binding of the MPI operation MPI_PACK_SIZE.
It is an error to call this function if the base type of datatype
is MPI.OBJECT.
Next: Collective Communication
Up: Point-to-Point Communication
Previous: Derived datatypes
Contents
Bryan Carpenter
2002-07-12