⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mpi_type_create_subarray.3

📁 MPI stands for the Message Passing Interface. Written by the MPI Forum (a large committee comprising
💻 3
字号:
.\"Copyright 2006, Sun Microsystems, Inc..\"Copyright (c) 1996 Thinking Machines.TH MPI_Type_create_subarray 3OpenMPI "September 2006" "Open MPI 1.2" " ".SH NAME\fBMPI_Type_create_subarray\fP \- Creates a data type describing an \fIn\fP-dimensional subarray of an \fIn\fP-dimensional array. .SH SYNTAX.ft R.SH C Syntax.nf#include <mpi.h>int 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) .SH Fortran Syntax.nfINCLUDE 'mpif.h'MPI_TYPE_CREATE_SUBARRAY(\fINDIMS, ARRAY_OF_SIZES, ARRAY_OF_SUBSIZES, 	ARRAY_OF_STARTS, ORDER, OLDTYPE, NEWTYPE, IERROR\fP) 	INTEGER	\fINDIMS, ARRAY_OF_SIZES(*), ARRAY_OF_SUBSIZES(*),	ARRAY_OF_STARTS(*), ORDER, OLDTYPE, NEWTYPE, IERROR\fP.SH C++ Syntax.nf#include <mpi.h>MPI::Datatype MPI::Datatype::Create_subarray(int \fIndims\fP, 	const int \fIarray_of_sizes\fP[], const int \fIarray_of_subsizes[]\fP, 	const int \fIarray_of_starts[]\fP, int \fIorder\fP) const.SH INPUT PARAMETERS.ft R.TP 1indimsNumber of array dimensions (positive integer)..TP 1iarray_of_sizesNumber of elements of type \fIoldtype\fP in each dimension of the full array (array of positive integers)..TP 1iarray_of_subsizesNumber of elements of type \fIoldtype\fP in each dimension of the subarray (array of positive integers)..TP 1iarray_of_startsStarting coordinates of the subarray in each dimension (array of nonnegative integers)..TP 1iorderArray storage order flag (state)..TP 1ioldtypeArray element data type (handle)..SH OUTPUT PARAMETERS.ft R.TP 1inewtypeNew data type (handle)..TP 1iIERRORFortran only: Error status (integer). .SH DESCRIPTION.ft RThe 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. .spThis 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. .spThe \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. .spThe 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. .spThe \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 .sp.nf\fIarray_of_starts[i]\fP < 0 .fi.spor .sp.nf\fIarray_of_starts[i]\fP > (\fIarray_of_sizes[i]\fP - \fIarray_of_subsizes[i]\fP). .fi.spThe \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: .sp- MPI_ORDER_C: The ordering used by C arrays, (that is, row-major order).sp- MPI_ORDER_FORTRAN: The ordering used by Fortran arrays, (that is, column-major order).spA \fIndims\fP-dimensional subarray (\fInewtype\fP) with no extra padding can be defined by the function Subarray() as follows: .sp.nf   newtype = Subarray(ndims, {size , size ,\..., size       },                                  0      1           ndims-1             {subsize , subsize , \..., subsize       },                     0         1               ndims-1             {start , start , \..., start       }, \fIoldtype\fP)                   0       1             bduns-1.fi.spLet the typemap of \fIoldtype\fP have the form:.sp.nf   {(type , disp ), (type , disp ), \..., (type   , disp   )}         0      0        1      1              n-1      n-1.fi.spwhere type\fIi\fP is a predefined MPI data type, and let \fIex\fP be the extent of \fIoldtype\fP. .spThe Subarray() function is defined recursively in three equations on page 72 of the MPI-2 standard. .spFor an example use of MPI_Type_create_subarray in the context of I/O, see Section 9.9.2 of the MPI-2 standard..SH NOTES.ft RIn 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. .SH ERRORSAlmost 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..spBefore the error value is returned, the current MPI error handler iscalled. 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.  ' @(#)MPI_Type_create_subarray.3 1.17 06/03/09

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -