parallel / 7-2010
.pdfMPI_Type_struct "
MPI - !
! .
/ ! !
, % !,
! . MPI
, ! :
MPI_Type_сontiguous, MPI_Type_vector MPI_Type_indexed.
,
! .
, !
.
' , ! " .
2008
MPI_Type_vector:
int MPI_Type_vector(int count, int blocklen, int stride,
MPI_Datatype oldtype, MPI_Datatype *newtype)
MPI_Type_vector(count, blocklen, stride, oldtype, newtype, ierr)
:
count ( );
blocklen ! ( ,
);
stride , ! !
" " (« »);
oldtype .
% newtype. ) % . (
.
2008
& !
2008
count = 2; stride = 4; blocklen = 3; oldtype = double;
:
{(double, 0), (double, 1), (double, 2), (double, 4), (double, 5), (double, 6)}
2008
MPI_Type_hvector "
:
int MPI_Type_hvector(int count, int blocklen, MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype)
MPI_Type_hvector(count, blocklen, stride, oldtype, newtype, ierr)
&
MPI_Type_vector, stride
.
2008
#
MPI_Type_struct. , ! "
:
int MPI_Type_struct(int count, int blocklengths[], MPI_Aint indices[], MPI_Datatype oldtypes[], MPI_Datatype *newtype)
MPI_Type_struct(count, blocklengths, indices, oldtypes, newtype, ierr)
/ :
count ,
! oldtypes, indices blocklengths;
blocklengths ! ( );
indices " ! ( );
oldtypes ! ( ).
% newtype.
2008
& !
2008
:
blen[0] = 1;
indices[0] = 0; oldtypes[0] = MPI_INT; blen[1] = 1;
indices[1] = &data.b — &data; oldtypes[1] = MPI_CHAR; blen[2] = 1;
indices[2] = sizeof(data); oldtypes[2] = MPI_FLOAT;
MPI_Type_struct(3, blen, indices, oldtypes, &newtype);
!
newtype . $ %,
! " % ?
2008
" ! "
. # :
int MPI_Type_indexed(int count, int blocklens[], int indices[], MPI_Datatype oldtype, MPI_Datatype *newtype)
MPI_Type_indexed(count, blocklens, indices, oldtype, newtype, ierr)
/ :
count ,
indices blocklens;
blocklens ! ;
indices " ! ,
( );
oldtype .
%
newtype.
2008
Fortran "
. & "
. 0 "
, Fortran
. $
" :
real vector_a(0:99)
".
2008
