[MPIWG Fortran] MPI_STATUS_SIZE: Why only in Fortran?

Jeff Squyres (jsquyres) jsquyres at cisco.com
Tue Sep 8 12:54:45 CDT 2020

On Sep 8, 2020, at 11:15 AM, Rolf Rabenseifner via mpiwg-fortran <mpiwg-fortran at lists.mpi-forum.org<mailto:mpiwg-fortran at lists.mpi-forum.org>> wrote:

It was clearly overseen when setting up the language interoperability chapter.
Yes, we should duplicate the whole table MPI-3.1 A.1.1. p672:6-12
My apologies, because I was involved.

In C, I would recommend to use the following name scheme that we already
use for other Fortran specific constants and functions:


Ah, yes: "F" is better (i.e., shorter than "FORTRAN").

(in C only to specify a Fortran status array and indexes into such an array
as defined in mpif.h and the mpi module. The values of Fortran MPI_STATUS_SIZE
and C MPI_F_STATUS_SIZE are identical, whereas the indexes in C are 1 less
than in Fortran to reflect that the arrays in Fortran start by default with index 1
whereas in C with index 0)

On MPI-3.1 p656:29, I would add

In C, such an f_status array can be defined with  MPI_Fint f_status[MPI_F_STATUS_SIZE].
Within this array, one can use in C the indexes MPI_F_SOURCE, MPI_F_TAG and MPI_F_ERROR
to access the same elements as in Fortran with MPI_SOURCE, MPI_TAG and MPI_ERROR.
The C indexes are 1 less the corresponding indexes in Fortran due to the different
default array start indexes in both languages.

This is better than the text I had roughed out.  I'll use it; thanks.

And MPI_F_STATUS_SIZE must be added to the list on page 15.

Yes, and I would treat it is an Errata because of the incompletness of
Section 17.2.5.

And yes, sizeof(MPI_Status) may be 24 (bytes in C) whereas MPI_STATUS_SIZE
and the new MPI_F_STATUS_SIZE would both be 6 (Fortran INTEGER).

I'll submit an Errata PR / PDF for everyone to review shortly.

Jeff Squyres
jsquyres at cisco.com<mailto:jsquyres at cisco.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpiwg-fortran/attachments/20200908/83c7fec6/attachment-0001.html>

More information about the mpiwg-fortran mailing list