next up previous contents
Next: Collective Communication Up: Point-to-Point Communication Previous: Revised definition of general   Contents

Pack and unpack

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.

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.Pack_size(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 up previous contents
Next: Collective Communication Up: Point-to-Point Communication Previous: Revised definition of general   Contents
Bryan Carpenter 2002-07-12