Purpose
Packs the message in the specified send buffer into the specified buffer space, using the external32 data format.
C synopsis
#include <mpi.h> int MPI_Pack_external(char *datarep, void *inbuf, int incount, MPI_Datatype datatype, void *outbuf, MPI_Aint outsize, MPI_Aint *position);
C++ synopsis
#include mpi.h void MPI::Datatype::Pack_external(const char* datarep, const void* inbuf, int incount, void* outbuf, MPI::Aint outsize, MPI_Aint& position) const;
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_PACK_EXTERNAL(CHARACTER*(*) DATAREP, CHOICE INBUF(*), INTEGER INCOUNT, INTEGER DATATYPE, CHOICE OUTBUF(*), INTEGER(KIND=MPI_ADDRESS_KIND) OUTSIZE, INTEGER(KIND=MPI_ADDRESS_KIND) POSITION, INTEGER IERROR)
Parameters
Description
This subroutine packs the message specified by inbuf, incount, and datatype into the buffer space specified by outbuf and outsize. The input buffer is any communication buffer allowed in MPI_SEND. The output buffer is any contiguous storage space containing outsize bytes and starting at the address outbuf.
The input value of position is the beginning offset in the output buffer that will be used for packing. The output value of position is the offset in the output buffer following the locations occupied by the packed message.
Notes
In FORTRAN, MPI_PACK_EXTERNAL returns an argument of type INTEGER(KIND=MPI_ADDRESS_KIND), where type MPI_Aint is used in C. Such variables may be declared as INTEGER*4 in purely 32-bit codes and as INTEGER*8 in 64-bit codes; KIND=MPI_ADDRESS_KIND works correctly in either mode.
Errors
Related information