source: proiecte/hpl/openmpi_compiled/share/man/man3/MPI_Pack.3 @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 3.6 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Pack 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Pack\fP \- Packs data of a given datatype into contiguous memory.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Pack(void *\fIinbuf\fP, int\fI incount\fP, MPI_Datatype\fI datatype\fP,
13        void\fI *outbuf\fP, int\fI outsize\fP, int\fI *position\fP, MPI_Comm\fI comm\fP)
14
15.SH Fortran Syntax
16.nf
17INCLUDE 'mpif.h'
18MPI_PACK(\fIINBUF, INCOUNT, DATATYPE, OUTBUF,OUTSIZE, POSITION,
19                COMM, IERROR\fP)
20        <type>  \fIINBUF(*), OUTBUF(*)\fP
21        INTEGER \fIINCOUNT, DATATYPE, OUTSIZE, POSITION, COMM, IERROR\fP
22
23.SH C++ Syntax
24.nf
25#include <mpi.h>
26void Datatype::Pack(const void* \fIinbuf\fP, int \fIincount\fP, void *\fIoutbuf\fP,
27        int \fIoutsize\fP, int& \fIposition\fP, const Comm &\fIcomm\fP) const
28
29.SH INPUT PARAMETERS
30.ft R
31.TP 1i
32inbuf
33Input buffer start (choice).
34.TP 1i
35incount
36Number of input data items (integer).
37.TP 1i
38datatype
39Datatype of each input data item (handle).
40.TP 1i
41outsize
42Output buffer size, in bytes (integer).
43.TP 1i
44comm
45Communicator for packed message (handle).
46
47.SH INPUT/OUTPUT PARAMETER
48.ft R
49.TP 1i
50position
51Current position in buffer, in bytes (integer).
52
53.SH OUTPUT PARAMETERS
54.ft R
55.TP 1i
56outbuf
57Output buffer start (choice).
58.ft R
59.TP 1i
60IERROR
61Fortran only: Error status (integer).
62
63.SH DESCRIPTION
64.ft R
65Packs 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).
66.sp
67The 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.
68.sp
69\fBExample:\fP An example using MPI_Pack:
70.sp
71.nf
72    int position, i, j, a[2];
73    char buff[1000];
74     
75    \&....
76     
77    MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
78    if (myrank == 0)
79    {
80       / * SENDER CODE */
81     
82    position = 0;
83      MPI_Pack(&i, 1, MPI_INT, buff, 1000, &position, MPI_COMM_WORLD);
84      MPI_Pack(&j, 1, MPI_INT, buff, 1000, &position, MPI_COMM_WORLD);
85      MPI_Send( buff, position, MPI_PACKED, 1, 0, MPI_COMM_WORLD);
86    }
87    else  /* RECEIVER CODE */
88      MPI_Recv( a, 2, MPI_INT, 0, 0, MPI_COMM_WORLD)
89     
90    }
91
92.SH ERRORS
93Almost 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.
94.sp
95Before the error value is returned, the current MPI error handler is
96called. 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. 
97
98.SH SEE ALSO
99.ft R
100MPI_Unpack
101.br
102MPI_Pack_size
103
Note: See TracBrowser for help on using the repository browser.