void Datatype::Pack(const void* \fIinbuf\fP, int \fIincount\fP, void *\fIoutbuf\fP,
int \fIoutsize\fP, int& \fIposition\fP, const Comm &\fIcomm\fP) const
.SHINPUTPARAMETERS
.ftR
.TP1i
inbuf
Input buffer start (choice).
.TP1i
incount
Number of input data items (integer).
.TP1i
datatype
Datatype of each input data item (handle).
.TP1i
outsize
Output buffer size, in bytes (integer).
.TP1i
comm
Communicator for packed message (handle).
.SHINPUT/OUTPUTPARAMETER
.ftR
.TP1i
position
Current position in buffer, in bytes (integer).
.SHOUTPUTPARAMETERS
.ftR
.TP1i
outbuf
Output buffer start (choice).
.ftR
.TP1i
IERROR
Fortran only: Error status (integer).
.SHDESCRIPTION
.ftR
Packs the message in the send buffer specified by \fIinbuf\fP, \fIincount\fP, \fIdatatype\fP into the buffer space specified by \fIoutbuf\fP and \fIoutsize\fP. The input buffer can be any communication buffer allowed in MPI_Send. The output buffer is a contiguous storage area containing \fIoutsize\fP bytes, starting at the address \fIoutbuf\fP (length is counted in bytes, not elements, as if it were a communication buffer for a message of type MPI_Packed).
.sp
The input value of \fIposition\fP is the first location in the output buffer to be used for packing. \fIposition\fP is incremented by the size of the packed message, and the output value of \fIposition\fP is the first location in the output buffer following the locations occupied by the packed message. The \fIcomm\fP argument is the communicator that will be subsequently used for sending the packed message.
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object.
.sp
Before the error value is returned, the current MPI error handler is
called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.