MPI Forum Meetings logo

MPI Forum: mpi3-fortran Mailing List Archives

all MPI Forum: mpi3-fortran mailing list

Subject: Re: [MPI3 Fortran] MPI-2.1: Fortran 90 bindings
From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2008-03-07 07:27:37


On Mar 7, 2008, at 7:01 AM, Harald Klimach wrote:

>> But the type is variable, right? Hence, if you use an explicit size,
>> the *real* size of the buffer (in bytes) is sizeof(type)*size. The
>> "size" parameter is supposed to be specified in bytes, not increments
>> of type size. So I don't think the above binding would yield correct
>> results for non-character types. Right?
> Hm, ok, perhaps this was a bad example, I never used MPI_BUFFER_ATTACH
> and just picked it because it has only two arguments ;)
> MPI_SEND would have been more appropiate.

I think that would work for scalars (heck, you don't even need the
count for a scalar) and for 1D arrays. But it seems problematic for
2D and above.

>> Actually, MPI explicitly allows you to mix-n-match the types. :-\
> Could you please point me to, where this is stated?

It is required that the send and receive buffers have compatible type
maps. See MPI-1:4.1:

"The type-matching conditions for the collective operations are more
strict than the corresponding conditions between sender and receiver
in point-to-point. Namely, for collective operations, the amount of
data sent must exactly match the amount of data specified by the
receiver. Distinct type maps (the layout in memory, see Sec. Derived
datatypes ) between sender and receiver are still allowed."

> I can't find it.
> All I see is mentioning of that it should be allowed to have different
> types on separate calls. Which is also true for functions with one
> choice argument. Of course this may be due to my humble understanding
> of MPI.
> Anyway this may be a detail which needs clarification?

-- 
Jeff Squyres
Cisco Systems