[MPIWG Fortran] Type of MPI_Status

Junchao Zhang jczhang at mcs.anl.gov
Wed Mar 12 22:49:49 CDT 2014


Hello,

    p30 of MPI3 says "In Fortran with USE mpi or INCLUDE 'mpif.h', status
is an array of INTEGERs of size MPI_STATUS_SIZE. ..., With Fortran USE
mpi_f08, status is defined as the Fortran BIND(C) derived type
TYPE(MPI_Status) containing three public fields named MPI_SOURCE, MPI_TAG,
and MPI_ERROR"

In other words, it does't say type of the three public fields must be
INTEGER. So, in mpi_f08, can I declare MPI_Status as

    TYPE, BIND(C) :: MPI_Status
        INTEGER(C_INT) :: MPI_SOURCE, MPI_TAG, MPI_ERROR
        ... ! other fields
    END TYPE MPI_Status

 I find it makes MPI_Status binding easier.  Since this type is
interoperable with C, I do not need to allocate temp variables to do type
conversion when INTEGER is not a C_INT.

--Junchao Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-fortran/attachments/20140312/7faa0d80/attachment.html>


More information about the mpiwg-fortran mailing list