IBM Books

MPI Subroutine Reference

MPI_PACK_EXTERNAL_SIZE, MPI_Pack_external_size

Purpose

Returns the number of bytes required to hold the data, using the external32 data format.

C synopsis

#include <mpi.h>
int MPI_Pack_external_size(char *datarep, int incount, MPI_Datatype datatype,MPI_Aint *size);

C++ synopsis

#include mpi.h
MPI::Aint MPI::Datatype::Pack_external_size(const char* datarep, int incount) const;

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_PACK_EXTERNAL_SIZE(CHARACTER*(*) DATAREP, INTEGER INCOUNT, INTEGER DATATYPE,
		       INTEGER(KIND=MPI_ADDRESS_KIND) SIZE, INTEGER IERROR

Parameters

datarep
is the data representation (string) (IN)

incount
is an integer specifying the number of input data items (IN)

datatype
is the datatype of each input data item (handle) (IN)

size
is the size of the output buffer, in bytes (integer) (OUT)

IERROR
is the FORTRAN return code. It is always the last argument.

Description

This subroutine returns the number of bytes required to pack incount replications of the datatype. You can use MPI_PACK_EXTERNAL_SIZE to determine the size required for a packing buffer.

Notes

In FORTRAN, MPI_PACK_EXTERNAL_SIZE returns a size 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

Invalid datarep

Invalid datatype

Type is not committed

MPI not initialized

MPI already finalized

Invalid incount
incount < 0

Related information

MPI_PACK_EXTERNAL
MPI_UNPACK_EXTERNAL


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]