1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
3 | .TH MPI_Type_contiguous 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | .SH NAME |
---|
5 | \fBMPI_Type_contiguous\fP \- Creates a contiguous datatype. |
---|
6 | |
---|
7 | .SH SYNTAX |
---|
8 | .ft R |
---|
9 | .SH C Syntax |
---|
10 | .nf |
---|
11 | #include <mpi.h> |
---|
12 | int MPI_Type_contiguous(int \fIcount\fP, MPI_Datatype\fI oldtype\fP, |
---|
13 | MPI_Datatype\fI *newtype\fP) |
---|
14 | |
---|
15 | .SH Fortran Syntax |
---|
16 | .nf |
---|
17 | INCLUDE 'mpif.h' |
---|
18 | MPI_TYPE_CONTIGUOUS(\fICOUNT, OLDTYPE, NEWTYPE, IERROR\fP) |
---|
19 | INTEGER \fICOUNT, OLDTYPE, NEWTYPE, IERROR\fP |
---|
20 | |
---|
21 | .SH C++ Syntax |
---|
22 | .nf |
---|
23 | #include <mpi.h> |
---|
24 | Datatype Datatype::Create_contiguous(int \fIcount\fP) const |
---|
25 | |
---|
26 | .SH INPUT PARAMETERS |
---|
27 | .ft R |
---|
28 | .TP 1i |
---|
29 | count |
---|
30 | Replication count (nonnegative integer). |
---|
31 | .TP 1i |
---|
32 | oldtype |
---|
33 | Old datatype (handle). |
---|
34 | .sp |
---|
35 | .SH OUTPUT PARAMETERS |
---|
36 | .ft R |
---|
37 | .TP 1i |
---|
38 | newtype |
---|
39 | New datatype (handle). |
---|
40 | .ft R |
---|
41 | .TP 1i |
---|
42 | IERROR |
---|
43 | Fortran only: Error status (integer). |
---|
44 | |
---|
45 | .SH DESCRIPTION |
---|
46 | .ft R |
---|
47 | The simplest datatype constructor is MPI_Type_contiguous, which allows replication of a datatype into contiguous locations. |
---|
48 | .sp |
---|
49 | \fInewtype\fP is the datatype obtained by concatenating \fIcount\fP copies of \fIoldtype\fP. Concatenation is defined using the extent of \fIoldtype\fP as the size of the concatenated copies. |
---|
50 | .sp |
---|
51 | \fBExample:\fR Let oldtype have type map {(double, 0), (char, 8)}, with extent 16, and let count = 3. The type map of the datatype returned by newtype is |
---|
52 | .sp |
---|
53 | .nf |
---|
54 | {(double, 0), (char, 8), (double, 16), (char, 24), |
---|
55 | (double, 32), (char, 40)]; |
---|
56 | .fi |
---|
57 | .sp |
---|
58 | i.e., alternating double and char elements, with displacements 0, 8, 16, 24, 32, 40. |
---|
59 | .sp |
---|
60 | In general, assume that the type map of oldtype is |
---|
61 | .sp |
---|
62 | .nf |
---|
63 | {(type(0), disp(0)),...,(type(n-1), disp(n-1))}, |
---|
64 | .fi |
---|
65 | .sp |
---|
66 | with extent ex. Then newtype has a type map with count times n entries defined by: |
---|
67 | .sp |
---|
68 | .nf |
---|
69 | {(type(0), disp(0)), ...,(type(n-1), disp(n-1)), |
---|
70 | (type(0), disp(0) + ex), ...,(type(n-1), |
---|
71 | disp(n-1) + ex), ...,(type(0), disp(0) + ex * (count - 1)), |
---|
72 | ...,(type(n-1), disp(n-1) + ex * (count - 1))}. |
---|
73 | .fi |
---|
74 | .sp |
---|
75 | For more information about derived datatypes, see Section 3.12 of the MPI-1 Standard. |
---|
76 | |
---|
77 | .SH ERRORS |
---|
78 | 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. |
---|
79 | .sp |
---|
80 | Before the error value is returned, the current MPI error handler is |
---|
81 | 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. |
---|
82 | |
---|