[MPIWG Fortran] Another MPI_SIZEOF question

William Gropp wgropp at illinois.edu
Tue Jun 10 15:55:29 CDT 2014


On SIZEOF, the language in the standard for the argument is 

a Fortran variable of numeric intrinsic type (choice)

I read this as different from "a *scalar* Fortran variable of numeric intrinsic type (choice)", but I may be interpreting the language too broadly.   My reading is probably intended, however, because the Advice to users says:

If given an array argument, it returns the size of the base element, not the size of the whole array.

Thus, the argument must be acceptable as an array (and note that the same language is present in MPI-2.0, and the Fortran 2008+TS29113 binding includes DIMENSION(..)

Thus, I believe that MPI_SIZEOF has the same choice parameter requirements of the communication routines such as MPI_SEND.  If not, then this part of the advice to users is bogus, and the parameter should clearly be labeled as scalar only.  And while not technically impossible to implement without DIMENSION(..), it is, as I said before, agreed to be impractical.  And it cannot be done in Fortran 77 (and is hard to do in anything less than F08+TS29113).

So that fact remains that in MPI-2, the "basic" support was setup to permit the use of Fortran 77 compilers, under the near universal extension that (and I will use the shorthand here) different types of variables could be passed to the same argument position in a routine.  With MPI-3.0, this is no longer possible; at least F90 is required, and a *practical* full implementation requires much more than F90.  

If you want an errata, I'd consider this:

Strike the sentence "MPI can still be used with most Fortran 77 compilers, as noted below." on page 81 line 47.  It is untrue; it will be hard to be perfectly compliant without the full F08+TS29113.

Page 85, line 26ff, strike the sentence that starts "On Fortran 77 systems"

Page 103, lines 7-14.  Strike this entire advice to users - its from MPI-2.0, when there was MPI_Address and MPI_Get_address.

Page 451, lines 29-30.  Delete "Fortran 77 users can use (non- portably) bit vector IOR on systems that support it."

Page 492, lines 45-46.  Delete "Fortran 77 users can use (nonportably) bit vector IOR on systems that support it."

Page 497, Example 13.1.  Either delete the entire example or change it to Fortran 9x or above.

Page 545, lines 16-17.  Delete "In Fortran 77 environments that do not support KIND parameters, MPI_Offset arguments should be declared as an INTEGER of suitable size."

Page 605, lines 8-9.  Delete "To support Fortran 77 as well as Fortran 90 and later, it may be necessary to eliminate all comments from mpif.h. "

Page 616, line 32.  The following is suspicious: "MPI provides named datatypes corresponding to standard Fortran 77 numeric types:".  Is there a way to describe this that does not refer to Fortran 77?

There are a few other places where Fortran 77 is mentioned, but I think they're ok, if dated.  But as long as mpif.h must contain, for example, any interface blocks, then MPI-3 cannot be used with Fortran 77 and it is incorrect and misleading to suggest otherwise.

An alternative is to remove all of the functions that were not present in the "basic" Fortran support from the mpif.h module, at least as a requirement.  This route, however, will require a very careful search through the document for other places where there may be requirements that make it impossible to implement against standard-practice Fortran 77 compilers (and given the MPI-3 standard's endorsement of the use of non-standard extensions to permit the newer interfaces to be compiled, lets not argue about whether only fully and strictly Fortran 77 should be considered).  Given both the age and the complexity of the task, I believe a more robust solution is to explicitly drop support for Fortran 77.  It may *also* be necessary to weaken the requirement for MPI_SIZEOF in order to permit any but the most recent Fortran compilers to be used.

Bill

William Gropp
Director, Parallel Computing Institute
Thomas M. Siebel Chair in Computer Science
University of Illinois Urbana-Champaign





On Jun 10, 2014, at 4:41 PM, Jeff Squyres (jsquyres) wrote:

> On Jun 10, 2014, at 10:10 AM, William Gropp <wgropp at illinois.edu> wrote:
> 
>> Jeff, as I noted before, in MPI-2, MPI_SIZEOF was not required for the Fortran "basic" support, thus MPI-2 did not break the existing practice with Fortran 77 compilers and the mpif.h include file (see the beginning of section 10.2.5 in MPI-2).
> 
> Sorry, you're right -- you even said this earlier in the thread.  My mistake.
> 
>> The issue is deciding that mpif.h is not a way to compile MPI programs with a Fortran compiler that is for Fortran before 2008 + TS29113 but simply a different interface to the one true and only Fortran interface - which isn't even yet standard (since it requires TS29113).
> 
> Same question as I asked before: Is 2003 or 2008+TS29113 required for SIZEOF?  I have no knowledge of when INTERFACE blocks were added to Fortran.
> 
> I'm asking this because DIMENSION(..) is *useful* to implement MPI_SIZEOF succinctly/easily, but it is not *required*.
> 
> -- 
> 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




More information about the mpiwg-fortran mailing list