1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
3 | .TH MPI_Get_count 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | .SH NAME |
---|
5 | \fBMPI_Get_count \fP \- Gets the number of top-level elements received. |
---|
6 | |
---|
7 | .SH SYNTAX |
---|
8 | .ft R |
---|
9 | .SH C Syntax |
---|
10 | .nf |
---|
11 | #include <mpi.h> |
---|
12 | int MPI_Get_count(MPI_Status *\fIstatus\fP, MPI_Datatype\fI datatype\fP, |
---|
13 | int\fI *count\fP) |
---|
14 | |
---|
15 | .SH Fortran Syntax |
---|
16 | .nf |
---|
17 | INCLUDE 'mpif.h' |
---|
18 | MPI_GET_COUNT(\fISTATUS, DATATYPE, COUNT, IERROR\fP) |
---|
19 | INTEGER \fISTATUS(MPI_STATUS_SIZE), DATATYPE, COUNT, IERROR\fP |
---|
20 | |
---|
21 | .SH C++ Syntax |
---|
22 | .nf |
---|
23 | #include <mpi.h> |
---|
24 | int Status::Get_count(const Datatype& \fIdatatype\fP) const |
---|
25 | |
---|
26 | .SH INPUT PARAMETERS |
---|
27 | .ft R |
---|
28 | .TP 1i |
---|
29 | status |
---|
30 | Return status of receive operation (status). |
---|
31 | .TP 1i |
---|
32 | datatype |
---|
33 | Datatype of each receive buffer element (handle). |
---|
34 | |
---|
35 | .SH OUTPUT PARAMETERS |
---|
36 | .ft R |
---|
37 | .TP 1i |
---|
38 | count |
---|
39 | Number of received elements (integer). |
---|
40 | .ft R |
---|
41 | .TP 1i |
---|
42 | IERROR |
---|
43 | Fortran only: Error status (integer). |
---|
44 | |
---|
45 | .SH DESCRIPTION |
---|
46 | .ft R |
---|
47 | Returns the number of entries received. (We count entries, each of type |
---|
48 | datatype, not bytes.) The datatype argument should match the argument |
---|
49 | provided by the receive call that set the status variable. (As explained in Section 3.12.5 in the MPI-1 Standard, "Use of General Datatypes in Communication," MPI_Get_count may, in certain situations, return the value MPI_UNDEFINED.) |
---|
50 | .sp |
---|
51 | The datatype argument is passed to MPI_Get_count to improve performance. A message might be received without counting the number of elements it contains, and the count value is often not needed. Also, this allows the same function to be used after a call to MPI_Probe. |
---|
52 | |
---|
53 | .SH NOTES |
---|
54 | If the size of the datatype is zero, this routine will return a count of |
---|
55 | zero. If the amount of data in |
---|
56 | .I status |
---|
57 | is not an exact multiple of the |
---|
58 | size of |
---|
59 | .I datatype |
---|
60 | (so that |
---|
61 | .I count |
---|
62 | would not be integral), a |
---|
63 | .I count |
---|
64 | of |
---|
65 | .I MPI_UNDEFINED |
---|
66 | is returned instead. |
---|
67 | |
---|
68 | .SH ERRORS |
---|
69 | 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. |
---|
70 | .sp |
---|
71 | Before the error value is returned, the current MPI error handler is |
---|
72 | 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. |
---|
73 | |
---|
74 | .SH SEE ALSO |
---|
75 | .ft R |
---|
76 | .sp |
---|
77 | MPI_Get_elements |
---|
78 | |
---|
79 | |
---|