Miscellaneous

Fortran-2008 | Fortran-90

MPI_COUNT_KIND

Definition

MPI_COUNT_KIND is an MPI_Datatype that is able to contain an address location in memory, an address offset in a file or just a count. The fact that the majority of MPI routines still rely on "INTEGER" count arguments is due to backward compatibility reasons. Please refer to MPI_Count to see the C equivalent.

Example

Copy

Feedback

!> @brief Illustrate how to use the MPI_Count datatype.
!> @details This application gets the size of an MPI Datatype via MPI_Count.
PROGRAM main
    USE mpi_f08

    IMPLICIT NONE

    TYPE(MPI_Datatype) :: my_type
    INTEGER(KIND=MPI_COUNT_KIND) :: count

    CALL MPI_Init()

    ! Create the MPI datatype
    CALL MPI_Type_contiguous(10, MPI_INTEGER, my_type)
    CALL MPI_Type_commit(my_type)

    ! Retrieve the size of the MPI datatype created
    CALL MPI_Type_size_x(my_type, count)
    WRITE(*,'(A,I0,A)') 'The type created would generate a message of ', count, ' bytes.'

    CALL MPI_Finalize()
END PROGRAM main