Manual Pages for UNIX Darwin command on man MPI_Type_create_subarray
MyWebUniversity

Manual Pages for UNIX Darwin command on man MPI_Type_create_subarray

MPITypecreatesubarray(3OpenMPI) MPITypecreatesubarray(3OpenMPI)

NAME

MMPPIITTyyppeeccrreeaatteessuubbaarrrraayy - Creates a data type describing an n-dimen-

sional subarray of an n-dimensional array.

SSYYNNTTAAXX CC SSyynnttaaxx

#include

int MPITypecreatesubarray(int ndims, int arrayofsizes[], int arrayofsubsizes[], int arrayofstarts[], int order, MPIDatatype oldtype, MPIDatatype *newtype) FFoorrttrraann SSyynnttaaxx INCLUDE 'mpif.h' MPITYPECREATESUBARRAY(NDIMS, ARRAYOFSIZES, ARRAYOFSUBSIZES,

ARRAYOFSTARTS, ORDER, OLDTYPE, NEWTYPE, IERROR)

INTEGER NDIMS, ARRAYOFSIZES(*), ARRAYOFSUBSIZES(*),

ARRAYOFSTARTS(*), ORDER, OLDTYPE, NEWTYPE, IERROR

CC++++ SSyynnttaaxx

#include

MPI::Datatype MPI::Datatype::Createsubarray(int ndims, const int arrayofsizes[], const int arrayofsubsizes[], const int arrayofstarts[], int order) const IINNPPUUTT PPAARRAAMMEETTEERRSS ndims Number of array dimensions (positive integer). arrayofsizes Number of elements of type oldtype in each dimension of the full array (array of positive integers). arrayofsubsizes Number of elements of type oldtype in each dimension of the subarray (array of positive integers). arrayofstarts Starting coordinates of the subarray in each dimension (array of nonnegative integers). order Array storage order flag (state). oldtype Array element data type (handle). OOUUTTPPUUTT PPAARRAAMMEETTEERRSS newtype New data type (handle).

IERROR Fortran only: Error status (integer).

DESCRIPTION

The subarray type constructor creates an MPI data type describing an n-

dimensional subarray of an n-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. This 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. The ndims parameter specifies the number of dimensions in the full data

array and gives the number of elements in arrayofsizes, arrayofsub-

sizes, and arrayofstarts.

The number of elements of type oldtype in each dimension of the n-

dimensional array and the requested subarray are specified by arrayofsizes and arrayofsubsizes, respectively. For any dimension

i, it is erroneous to specify arrayofsubsizes[i] < 1 or arrayofsub-

sizes[i] > array of sizes[i]. The arrayofstarts contains the starting coordinates of each dimension of the subarray. Arrays are assumed to be indexed starting from zero. For any dimension i, it is erroneous to specify arrayofstarts[i] < 0 or

arrayofstarts[i] > (arrayofsizes[i] - arrayofsubsizes[i]).

The order argument specifies the storage order for the subarray as well as the full array. It must be set to one of the following:

- MPIORDERC: The ordering used by C arrays, (that is, row-major

order)

- MPIORDERFORTRAN: The ordering used by Fortran arrays, (that is,

column-major order)

A ndims-dimensional subarray (newtype) with no extra padding can be

defined by the function Subarray() as follows: newtype = Subarray(ndims, {size , size ,..., size },

0 1 ndims-1

{subsize , subsize , ..., subsize },

0 1 ndims-1

{start , start , ..., start }, oldtype)

0 1 bduns-1

Let the typemap of oldtype have the form: {(type , disp ), (type , disp ), ..., (type , disp )}

0 0 1 1 n-1 n-1

where typei is a predefined MPI data type, and let ex be the extent of oldtype. The Subarray() function is defined recursively in three equations on

page 72 of the MPI-2 standard.

For an example use of MPITypecreatesubarray in the context of I/O,

see Section 9.9.2 of the MPI-2 standard.

NNOOTTEESS

In a Fortran program with arrays indexed starting from 1, if the start-

ing coordinate of a particular dimension of the subarray is n, then the

entry in array of starts for that dimension is n-1.

EERRRROORRSS Almost all MPI routines return an error value; C routines as the value

of the function and Fortran routines in the last argument. C++ func-

tions do not return errors. If the default error handler is set to

MPI::ERRORSTHROWEXCEPTIONS, then on error the C++ exception mechanism

will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with

MPICommseterrhandler; the predefined error handler MPIERRORSRETURN

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. Open MPI 1.2 September 200M6PITypecreatesubarray(3OpenMPI)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™