[97] | 1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
| 2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
| 3 | .TH MPI_Type_match_size 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
| 4 | .SH NAME |
---|
| 5 | |
---|
| 6 | \fBMPI_Type_match_size\fP \- Returns an MPI datatype of a given type and size |
---|
| 7 | |
---|
| 8 | .SH SYNTAX |
---|
| 9 | .ft R |
---|
| 10 | |
---|
| 11 | .SH C Syntax |
---|
| 12 | .nf |
---|
| 13 | #include <mpi.h> |
---|
| 14 | int MPI_Type_match_size(int \fItypeclass\fP, int \fIsize\fP, |
---|
| 15 | MPI_Datatype *\fItype\fP) |
---|
| 16 | |
---|
| 17 | .SH Fortran Syntax |
---|
| 18 | .nf |
---|
| 19 | INCLUDE 'mpif.h' |
---|
| 20 | MPI_TYPE_MATCH_SIZE(\fITYPECLASS, SIZE, TYPE, IERROR\fP) |
---|
| 21 | INTEGER \fITYPECLASS, SIZE, TYPE, IERROR\fP |
---|
| 22 | |
---|
| 23 | .SH C++ Syntax |
---|
| 24 | .nf |
---|
| 25 | #include <mpi.h> |
---|
| 26 | static MPI::Datatype MPI::Match_size(int \fItypeclass\fP, int \fIsize\fP) |
---|
| 27 | |
---|
| 28 | .SH INPUT PARAMETERS |
---|
| 29 | .ft R |
---|
| 30 | .TP 1i |
---|
| 31 | typeclass |
---|
| 32 | Generic type specifier (integer). |
---|
| 33 | .ft R |
---|
| 34 | .TP 1i |
---|
| 35 | size |
---|
| 36 | Size, in bytes, of representation (integer). |
---|
| 37 | |
---|
| 38 | .SH OUTPUT PARAMETERS |
---|
| 39 | .ft R |
---|
| 40 | .TP 1i |
---|
| 41 | type |
---|
| 42 | Datatype with correct type and size (handle). |
---|
| 43 | .ft R |
---|
| 44 | .TP 1i |
---|
| 45 | IERROR |
---|
| 46 | Fortran only: Error status (integer). |
---|
| 47 | |
---|
| 48 | .SH DESCRIPTION |
---|
| 49 | .ft R |
---|
| 50 | The function returns an MPI datatype matching a local variable of type |
---|
| 51 | (\fItypeclass\fP, \fIsize\fP). The returned type is a reference |
---|
| 52 | (handle) to a predefined named datatype, not a duplicate. This type |
---|
| 53 | cannot be freed. |
---|
| 54 | .sp |
---|
| 55 | The value of \fItypeclass\fR may be set to one of MPI_TYPECLASS_REAL, |
---|
| 56 | MPI_TYPECLASS_INTEGER, or MPI_TYPECLASS_COMPLEX, corresponding to the |
---|
| 57 | desired datatype. |
---|
| 58 | .sp |
---|
| 59 | MPI_type_match_size can be used to obtain a size-specific type that |
---|
| 60 | matches a Fortran numeric intrinsic type: first call MPI_Sizeof to |
---|
| 61 | compute the variable size, then call MPI_Type_match_size to find a |
---|
| 62 | suitable datatype. In C and C++, use the sizeof builtin instead of |
---|
| 63 | MPI_Sizeof. |
---|
| 64 | .sp |
---|
| 65 | It is erroneous to specify a size not supported by the compiler. |
---|
| 66 | |
---|
| 67 | .SH ERRORS |
---|
| 68 | .ft R |
---|
| 69 | Almost all MPI routines return an error value; C routines as |
---|
| 70 | the value of the function and Fortran routines in the last argument. C++ |
---|
| 71 | functions do not return errors. If the default error handler is set to |
---|
| 72 | MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism |
---|
| 73 | will be used to throw an MPI:Exception object. |
---|
| 74 | .sp |
---|
| 75 | Before the error value is returned, the current MPI error handler is |
---|
| 76 | called. By default, this error handler aborts the MPI job, except for |
---|
| 77 | I/O function errors. The error handler may be changed with |
---|
| 78 | MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN |
---|
| 79 | may be used to cause error values to be returned. Note that MPI does not |
---|
| 80 | guarantee that an MPI program can continue past an error. |
---|
| 81 | .sp |
---|
| 82 | See the MPI man page for a full list of MPI error codes. |
---|
| 83 | |
---|
| 84 | .SH SEE ALSO |
---|
| 85 | .ft R |
---|
| 86 | .nf |
---|
| 87 | MPI_Sizeof |
---|
| 88 | MPI_Type_get_extent |
---|
| 89 | |
---|