[MPI3 Fortran] MPI-2.1: Fortran 90 bindings

Jeff Squyres jsquyres at cisco.com
Thu Mar 6 11:35:07 CST 2008


On Mar 6, 2008, at 11:13 AM, Harald Klimach wrote:

> I don't know how those 15 intrinsic types are coming from. As far as I
> know there are 5 intrinsic types in Fortran 90: integer, real,  
> complex,
> logical and character. Each of them can theoretically an unlimited
> number of kinds. As far as I understand it MPI allows to use the
> following:
> integer*1, *2, *4, *8, *16
> real*4, *8, *16
> complex*4, *8, *16
> logical
> character
> Which adds up to 13 in total. But most propably I'm missing the
> remaining 2.

In the paper, we have a footnote:

Assuming the compiler supports CHARACTER, LOGICAL{1,2,4,8},  
INTEGER{1,2,4,8},
REAL{4,8,16}, and COMPLEX{8,16,32}.

> Could you please explain why assumed shape arrays are necessary in the
> interfaces? I don't see the benefit we are gaining compared to the
> assumed size. I attached a little example using an assumed size array.

I cannot -- Bill Saphir was the original author of the F90 bindings  
(Bill's no longer involved with the MPI Forum).  I don't know why he  
chose assumed shape vs. assumed size.

I've recently been involved in MPI Fortran issues even though I'm not  
really a Fortran programmer (I confess to always being confused by  
"assumed shape" and "assumed size" :-( ).  In this effort, I'm trying  
to be a liason between the Fortran and MPI communities.

Keep in mind that we cannot make huge changes to the existing MPI F90  
bindings.  They're more-or-less set in stone.  What we can do is  
deprecate them in favor of newer, better bindings (E.g., stuff that  
takes advantage of more modern Fortran features, such as the C-to- 
Fortran interoperability compiler features).  That's going on for MPI-3.

My goal in posting this morning was the see if we could do a very  
minor fix for MPI-2.1 to make the existing MPI F90 bindings  
implementable.  My point: I don't know if we can change from assumed  
shape to assumed size for MPI-2.1.  Possibly for MPI-2.2...?  (MPI-2.2  
is allowed to have small changes that require a little implementation  
effort)

I think I would need to understand much better what this change would  
mean:

- for existing MPI F90 applications
- for existing MPI F90 implementations
- for the MPI-2.x standard

This is probably worth discussing on the teleconference tomorrow.

> I think the dimensional information of the assumed shape array is
> discarded anyway, when it is handed over to the actual C-Function.

Yes, we only get a pointer to the beginning of the data.

> Which leaves us with 15*50 = 750 Interfaces for the functions with one
> choice buffer.

This is probably something I don't understand well in Fortran; the  
goal is to be able to pass any intrinsic type of any array shape/size/ 
whatever through the "choice" MPI buffers (e.g., the buffer argument  
to MPI_SEND).  If we can reduce the number of subroutine signatures to  
750 from 5250, that's a good thing (but may be a moot point, per above).

> The calculation for the 25 functions with two choice buffers isn't
> clear to me.
> Shouldn't it read (15 * 7)^2 * 25 = 275625?

Crud, I think you're right.  Doh!

Even so, it's too many.  ;-)

> If this is the case we would "only" have 15^2 * 25 = 5625 interfaces
> for functions with two choice buffers.


That's predicated on whether we can change the F90 bindings to use  
assumed size, right?

-- 
Jeff Squyres
Cisco Systems




More information about the mpiwg-fortran mailing list