[97] | 1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
| 2 | .\"Copyright (c) 1996 Thinking Machines |
---|
| 3 | .TH MPI_Type_create_struct 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
| 4 | .SH NAME |
---|
| 5 | \fBMPI_Type_create_struct\fP \- Creates a structured data type. |
---|
| 6 | |
---|
| 7 | .SH SYNTAX |
---|
| 8 | .ft R |
---|
| 9 | .SH C Syntax |
---|
| 10 | .nf |
---|
| 11 | #include <mpi.h> |
---|
| 12 | int MPI_Type_create_struct(int \fIcount\fP, int \fIarray_of_blocklengths\fP[], |
---|
| 13 | MPI_Aint \fIarray_of_displacements\fP[], MPI_Datatype \fIarray_of_types\fP[], |
---|
| 14 | MPI_Datatype *\fInewtype\fP) |
---|
| 15 | |
---|
| 16 | .SH Fortran Syntax (see FORTRAN 77 NOTES) |
---|
| 17 | .nf |
---|
| 18 | INCLUDE 'mpif.h' |
---|
| 19 | MPI_TYPE_CREATE_STRUCT(\fICOUNT, ARRAY_OF_BLOCKLENGTHS, |
---|
| 20 | ARRAY_OF_DISPLACEMENTS, ARRAY_OF_TYPES, NEWTYPE, IERROR\fP) |
---|
| 21 | INTEGER \fICOUNT, ARRAY_OF_BLOCKLENGTHS(*), ARRAY_OF_TYPES(*),\fP |
---|
| 22 | INTEGER \fINEWTYPE, IERROR \fP |
---|
| 23 | INTEGER(KIND=MPI_ADDRESS_KIND) \fIARRAY_OF_DISPLACEMENTS(*)\fP |
---|
| 24 | |
---|
| 25 | .SH C++ Syntax |
---|
| 26 | .nf |
---|
| 27 | #include <mpi.h> |
---|
| 28 | static MPI::Datatype MPI::Datatype::Create_struct(int \fIcount\fP, |
---|
| 29 | const int \fIarray_of_blocklengths\fP[], const MPI::Aint |
---|
| 30 | \fIarray_of_displacements\fP[], const MPI::Datatype |
---|
| 31 | \fIarray_of_types\fP[]) |
---|
| 32 | |
---|
| 33 | .SH INPUT PARAMETERS |
---|
| 34 | .ft R |
---|
| 35 | .TP 1i |
---|
| 36 | count |
---|
| 37 | Number of blocks (integer) -- also number of entries in arrays \fIarray_of_types\fP, \fIarray_of_displacements\fP, and \fIarray_of_blocklengths\fP. |
---|
| 38 | .TP 1i |
---|
| 39 | array_of_blocklengths |
---|
| 40 | Number of elements in each block (array of integers). |
---|
| 41 | .TP 1i |
---|
| 42 | array_of_displacements |
---|
| 43 | Byte displacement of each block (array of integers). |
---|
| 44 | .TP 1i |
---|
| 45 | array_of_types |
---|
| 46 | Type of elements in each block (array of handles to data-type objects). |
---|
| 47 | |
---|
| 48 | .SH OUTPUT PARAMETERS |
---|
| 49 | .ft R |
---|
| 50 | .TP 1i |
---|
| 51 | newtype |
---|
| 52 | New data type (handle). |
---|
| 53 | .TP 1i |
---|
| 54 | IERROR |
---|
| 55 | Fortran only: Error status (integer). |
---|
| 56 | |
---|
| 57 | .SH DESCRIPTION |
---|
| 58 | MPI_Type_create_struct creates a structured data type. This routine replaces MPI_Type_struct, which is now deprecated. |
---|
| 59 | .PP |
---|
| 60 | NOTE \- This routine replaces MPI_Type_struct, which is deprecated. See the man page MPI_Type_struct(3) for information about that routine. |
---|
| 61 | |
---|
| 62 | .SH FORTRAN 77 NOTES |
---|
| 63 | .ft R |
---|
| 64 | The MPI standard prescribes portable Fortran syntax for |
---|
| 65 | the \fIARRAY_OF_DISPLACEMENTS\fP(*) argument only for Fortran 90. FORTRAN 77 |
---|
| 66 | users may use the non-portable syntax |
---|
| 67 | .sp |
---|
| 68 | .nf |
---|
| 69 | INTEGER*MPI_ADDRESS_KIND \fIARRAY_OF_DISPLACEMENTS\fP(*) |
---|
| 70 | .fi |
---|
| 71 | .sp |
---|
| 72 | where MPI_ADDRESS_KIND is a constant defined in mpif.h |
---|
| 73 | and gives the length of the declared integer in bytes. |
---|
| 74 | |
---|
| 75 | .SH ERRORS |
---|
| 76 | 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. |
---|
| 77 | .sp |
---|
| 78 | Before the error value is returned, the current MPI error handler is |
---|
| 79 | 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. |
---|
| 80 | |
---|
| 81 | .SH SEE ALSO |
---|
| 82 | .ft R |
---|
| 83 | .sp |
---|
| 84 | MPI_Type_struct |
---|
| 85 | .br |
---|
| 86 | MPI_Type_create_hindexed |
---|
| 87 | |
---|