[MPIWG Fortran] MPI_SIZEOF: Errata required (was: Another MPI_SIZEOF question)

Rolf Rabenseifner rabenseifner at hlrs.de
Fri Jun 13 03:32:29 CDT 2014


Back to MPI_SIZEOF in mpif.h:

A few clarifications:

1) The interface of Argument x was not changed between 
   MPI-2.0, 2.1, 2.2 and MPI-3.0:
   It is always "<type> x" for mpif.h, i.e., without a dimension.

2) The requirement of having this function in mpif.h was changed:

   MPI-2.0 through 2.2 requiered MPI_SIZEOF in mpif.h
   "unless the target compiler does not support modules
   or KIND-parametrized types."

   This restriction was removed.

3) In general, MPI-2.0 was defined for Fortran 77, but then
   without, the routines MPI_SIZEOF, MPI_TYPE_MATCH_SIZE, 
   MPI_TYPE_CREATE_F90_REAL/COMPLEX/INTEGER,
   and without the module mpi

   MPI-3.0 does not define such a subset. For Fortran 77,
   it says on MPI-3.0, page 609 line 47:
   Only MPI-1.1, MPI-1.2 and MPI-1.3 can be implemented. ...

4) We do not have correct rules for PMPI interception
   of MPI_SIZEOF because it must be implemented through
   overloading.

5) The other routines in the former "Extended Fortran Support"
   do not cause such problems.  

How to solve these problems? 

I would expect that we should add two errata:

A) MPI_SIZEOF needs not to be interceptable,
   the idea of ticket #428.

B) The Fortran 77 rule on p609:47 - p610:2
   should be extended to allow mpif.h with
   all MPI-3.0 routines that are defined with an mpif.h
   interface, but with the exception of MPI_SIZEOF,
   because MPI_SIZEOF is the only routine that requires
   (several overloaded) INTERFACE specifications,
   which did not came before Fortran 90.

Rolf

----- Original Message -----
> From: "Jeff Squyres (jsquyres)" <jsquyres at cisco.com>
> To: "MPI-WG Fortran working group" <mpiwg-fortran at lists.mpi-forum.org>
> Sent: Thursday, June 12, 2014 9:19:27 PM
> Subject: Re: [MPIWG Fortran] MPI_SIZEOF: Errata required	(was:	Another	MPI_SIZEOF question)
> 
> On Jun 11, 2014, at 4:25 PM, Bill Long <longb at cray.com> wrote:
> 
> >> Actually, this doesn't work, either.  If you have an mpif.h that
> >> contains an "INTERFACE MPI_Sizeof", the compiler will treat it
> >> differently depending on whether it is included from source.f or
> >> source.f90 (and probably other variants, too).  Gaahhh!
> > 
> > Not sure why you say this.  Unless the lines get too long because
> > of long names, you can write an include file so that it works for
> > both fixed and free source forms.  The assumed source form is the
> > only distinction to the compiler between source files that end in
> > .f and .f90.
> 
> Argh -- my Fortran ignorance rears its ugly head.  Yes, indenting
> properly makes that problem go away.
> 
> It's a tight squeeze, but the longest interface I can find is with
> COMPLEX(REAL128) and DIMENSION for 15 ranks; it barely fits into 72
> columns:
> 
>       COMPLEX(REAL128),DIMENSION(1,1,1,1,1,1,1,1,1,1,1,1,1,1,*)::x
> 
> Quite ugly, of course.  But with a perl script to generate all the
> possibilities (for maximum portability), it works.  Yuck.
> 
> > As you might recall from earlier conference calls,  I prefer that
> > nothing be added to mpif.h that was not there before.  None of the
> > new functions or constants.  It should be frozen at MPI 2.2 for
> > compatibility with legacy codes.  If programmers want to use new
> > features, they have to modify their sources anyway, and should
> > change to using a module at the same time.
> 
> There was unfortunately pushback from the Forum on this issue; we
> lost that battle.
> 
> --
> Jeff Squyres
> jsquyres at cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
> 

-- 
Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner at hlrs.de
High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530
University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832
Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner
Nobelstr. 19, D-70550 Stuttgart, Germany . . . . (Office: Room 1.307)



More information about the mpiwg-fortran mailing list