MPI_UNPACK, MPI_Unpack Purpose Unpacks the message into the specified receive buffer from the specified packed buffer. C synopsis #include int MPI_Unpack(void* inbuf,int insize,int *position,void *outbuf, int outcount,MPI_Datatype datatype,MPI_Comm comm); C++ synopsis #include mpi.h void MPI::Datatype::Unpack(const void* inbuf, int insize, void* outbuf, int outcount, int& position, const MPI::Comm& comm) const; FORTRAN synopsis include 'mpif.h' or use mpi MPI_UNPACK(CHOICE INBUF,INTEGER INSIZE,INTEGER POSITION,CHOICE OUTBUF, INTEGER OUTCOUNT,INTEGER DATATYPE,INTEGER COMM,INTEGER IERROR) Parameters inbuf is the input buffer start (choice) (IN) insize is an integer specifying the size of input buffer in bytes (IN) position is an integer specifying the current packed buffer offset in bytes (INOUT) outbuf is the output buffer start (choice) (OUT) outcount is an integer specifying the number of instances of datatype to be unpacked (IN) datatype is the datatype of each output data item (handle) (IN) comm is the communicator for the packed message (handle) (IN) IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine unpacks the message specified by outbuf, outcount, and datatype from the buffer space specified by inbuf and insize. The output buffer is any receive buffer allowed in MPI_RECV. The input buffer is any contiguous storage space containing insize bytes and starting at address inbuf. The input value of position is the beginning offset in the input buffer for the data to be unpacked. The output value of position is the offset in the input buffer following the data already unpacked. That is, the starting point for another call to MPI_UNPACK. comm is the communicator that was used to receive the packed message. Notes In MPI_UNPACK, the outcount argument specifies the actual number of items to be unpacked. The size of the corresponding message is the increment in position. Errors Invalid outcount outcount < 0 Invalid datatype Type is not committed Invalid communicator Inbuf too small Negative length or position for buffer outsize < 0 or position < 0 MPI not initialized MPI already finalized Related information