Skip to content

Latest commit

 

History

History
110 lines (74 loc) · 2.86 KB

MPI_Type_create_hvector.3.rst

File metadata and controls

110 lines (74 loc) · 2.86 KB

MPI_Type_create_hvector

:ref:`MPI_Type_create_hvector` - Creates a vector (strided) data type with offset in bytes.

SYNTAX

C Syntax

#include <mpi.h>

int MPI_Type_create_hvector(int count, int blocklength,
     MPI_Aint stride, MPI_Datatype oldtype, MPI_Datatype *newtype)

Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_TYPE_CREATE_HVECTOR(COUNT, BLOCKLENGTH, STRIDE, OLDTYPE,
     NEWTYPE, IERROR)

     INTEGER COUNT, BLOCKLENGTH, OLDTYPE, NEWTYPE, IERROR
     INTEGER(KIND=MPI_ADDRESS_KIND) STRIDE

Fortran 2008 Syntax

USE mpi_f08
MPI_Type_create_hvector(count, blocklength, stride, oldtype, newtype,
             ierror)
     INTEGER, INTENT(IN) :: count, blocklength
     INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: stride
     TYPE(MPI_Datatype), INTENT(IN) :: oldtype
     TYPE(MPI_Datatype), INTENT(OUT) :: newtype
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

INPUT PARAMETERS

  • count: Number of blocks (nonnegative integer).
  • blocklength: Number of elements in each block (nonnegative integer).
  • stride: Number of bytes between start of each block (integer).
  • oldtype: Old data type (handle).

OUTPUT PARAMETERS

  • newtype: New data type (handle).
  • ierror: Fortran only: Error status (integer).

DESCRIPTION

:ref:`MPI_Type_create_hvector` creates a vector (strided) data type with offset in bytes. This routine replaces :ref:`MPI_Type_hvector`, which is deprecated.

The function :ref:`MPI_Type_create_hvector` is identical to :ref:`MPI_Type_vector`, except that stride is given in bytes, rather than in elements. The use for both types of vector constructors is illustrated in the examples in Section 3.12.7 of the MPI-1 Standard.

Assume that oldtype has type map

{(type(0), disp(0)), ..., (type(n-1), disp(n-1))}

with extent ex. Let bl be the blocklength. The newly created datatype has a type map with count * bl * n entries:

{(type(0), disp(0)), ..., (type(n-1), disp(n-1)),
(type(0), disp(0) + ex), ..., (type(n-1), disp(n-1) + ex),
..., (type(0), disp(0) + (bl -1) * ex),...,(type(n-1),
disp(n-1) + (bl -1) * ex), (type(0), disp(0) + stride),
...,(type(n-1), disp(n-1) + stride), ..., (type(0),
disp(0) + stride + (bl - 1) * ex), ..., (type(n-1),
disp(n-1) + stride + (bl -1) * ex), ..., (type(0),
disp(0) + stride * (count -1)), ...,(type(n-1),
disp(n-1) + stride * (count -1)), ..., (type(0),
disp(0) + stride * (count -1) + (bl -1) * ex), ...,
(type(n-1), disp(n-1) + stride * (count -1) + (bl -1) * ex)}

ERRORS

.. seealso::
   * :ref:`MPI_Type_create_hindexed`
   * :ref:`MPI_Type_vector`