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

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

Adding compiled files

File size: 5.5 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\"Copyright (c) 1996 Thinking Machines
3.TH MPI_Type_create_subarray 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Type_create_subarray\fP \- Creates a data type describing an \fIn\fP-dimensional subarray of an \fIn\fP-dimensional array.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Type_create_subarray(int \fIndims\fP, int \fIarray_of_sizes[]\fP, int \fIarray_of_subsizes[]\fP, int \fIarray_of_starts[]\fP, int \fIorder\fP, MPI_Datatype \fIoldtype\fO, MPI_Datatype \fI*newtype\fP)
13
14.SH Fortran Syntax
15.nf
16INCLUDE 'mpif.h'
17MPI_TYPE_CREATE_SUBARRAY(\fINDIMS, ARRAY_OF_SIZES, ARRAY_OF_SUBSIZES,
18        ARRAY_OF_STARTS, ORDER, OLDTYPE, NEWTYPE, IERROR\fP)
19
20        INTEGER \fINDIMS, ARRAY_OF_SIZES(*), ARRAY_OF_SUBSIZES(*),
21        ARRAY_OF_STARTS(*), ORDER, OLDTYPE, NEWTYPE, IERROR\fP
22
23.SH C++ Syntax
24.nf
25#include <mpi.h>
26MPI::Datatype MPI::Datatype::Create_subarray(int \fIndims\fP,
27        const int \fIarray_of_sizes\fP[], const int \fIarray_of_subsizes[]\fP,
28        const int \fIarray_of_starts[]\fP, int \fIorder\fP) const
29
30.SH INPUT PARAMETERS
31.ft R
32.TP 1i
33ndims
34Number of array dimensions (positive integer).
35.TP 1i
36array_of_sizes
37Number of elements of type \fIoldtype\fP in each dimension of the full array (array of positive integers).
38.TP 1i
39array_of_subsizes
40Number of elements of type \fIoldtype\fP in each dimension of the subarray (array of positive integers).
41.TP 1i
42array_of_starts
43Starting coordinates of the subarray in each dimension (array of nonnegative integers).
44.TP 1i
45order
46Array storage order flag (state).
47.TP 1i
48oldtype
49Array element data type (handle).
50
51
52.SH OUTPUT PARAMETERS
53.ft R
54.TP 1i
55newtype
56New data type (handle).
57.TP 1i
58IERROR
59Fortran only: Error status (integer).
60
61.SH DESCRIPTION
62.ft R
63The subarray type constructor creates an MPI data type describing an \fIn\fP-dimensional subarray of an \fIn\fP-dimensional array. The subarray may be situated anywhere within the full array, and may be of any nonzero size up to the size of the larger array as long as it is confined within this array. This type constructor facilitates creating file types to access arrays distributed in blocks among processes to a single file that contains the global array.
64.sp
65This type constructor can handle arrays with an arbitrary number of dimensions and works for both C- and Fortran-ordered matrices (that is, row-major or column-major). Note that a C program may use Fortran order and a Fortran program may use C order.
66.sp
67The \fIndims\fP parameter specifies the number of dimensions in the full data array and gives the number of elements in \fIarray_of_sizes\fP, \fIarray_of_subsizes\fP, and \fIarray_of_starts\fP.
68.sp
69The number of elements of type \fIoldtype\fP in each dimension of the \fIn\fP-dimensional array and the requested subarray are specified by \fIarray_of_sizes\fP and \fIarray_of_subsizes\fP, respectively. For any dimension \fIi\fP, it is erroneous to specify \fIarray_of_subsizes[i]\fP < 1 or \fIarray_of_subsizes[i]\fP > \fIarray of sizes[i]\fP.
70.sp
71The \fIarray_of_starts\fP contains the starting coordinates of each dimension of the subarray. Arrays are assumed to be indexed starting from zero. For any dimension \fIi\fP, it is erroneous to specify
72.sp
73.nf
74\fIarray_of_starts[i]\fP < 0
75.fi
76.sp
77or
78.sp
79.nf
80\fIarray_of_starts[i]\fP > (\fIarray_of_sizes[i]\fP - \fIarray_of_subsizes[i]\fP).
81.fi
82.sp
83The \fIorder\fP argument specifies the storage order for the subarray as well as the full array. It must be set to one of the following:
84.sp
85- MPI_ORDER_C: The ordering used by C arrays, (that is, row-major order)
86.sp
87- MPI_ORDER_FORTRAN: The ordering used by Fortran arrays, (that is, column-major order)
88.sp
89A \fIndims\fP-dimensional subarray (\fInewtype\fP) with no extra padding can be defined by the function Subarray() as follows:
90.sp
91.nf
92   newtype = Subarray(ndims, {size , size ,\..., size       },
93                                  0      1           ndims-1
94             {subsize , subsize , \..., subsize       },
95                     0         1               ndims-1
96             {start , start , \..., start       }, \fIoldtype\fP)
97                   0       1             bduns-1
98.fi
99.sp
100Let the typemap of \fIoldtype\fP have the form:
101.sp
102.nf
103   {(type , disp ), (type , disp ), \..., (type   , disp   )}
104         0      0        1      1              n-1      n-1
105.fi
106.sp
107where type\fIi\fP is a predefined MPI data type, and let \fIex\fP be the extent of \fIoldtype\fP.
108.sp
109The Subarray() function is defined recursively in three equations on page 72 of the MPI-2 standard.
110.sp
111For an example use of MPI_Type_create_subarray in the context of I/O, see Section 9.9.2 of the MPI-2 standard.
112
113
114.SH NOTES
115.ft R
116In a Fortran program with arrays indexed starting from 1, if the starting coordinate of a particular dimension of the subarray is \fIn\fP, then the entry in array of starts for that dimension is \fIn\fP-1.
117
118.SH ERRORS
119Almost 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.
120.sp
121Before the error value is returned, the current MPI error handler is
122called. 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. 
123
124
Note: See TracBrowser for help on using the repository browser.