[Mpi-22] MPI-2.1 ambiguity?

Rolf Rabenseifner rabenseifner at [hidden]
Thu Jul 17 10:01:23 CDT 2008



My primary oal is:
We should make clarifications which state that
each predefined handle must be available in every
language binding.
People may be confused by current wording in several places:

- MPI-2.1 (June 23, 2008) Section 16.3.6 MPI Opaque Objects,
   page 483, lines 46-47:
   "All predefined datatypes can be used in datatype constructors
   in any language."

- MPI-2.1 (June 23, 2008) Section 16.3.9 Constants,
   page 488, lines 33-35:
   "MPI constants have the same value in all languages,
   unless specified otherwise. This does not
   apply to constant handles (MPI_INT, MPI_COMM_WORLD,
   MPI_ERRORS_RETURN, MPI_SUM, etc.) These handles need
   to be converted, as explained in Section 16.3.4."

- MPI-2.1 (June 23, 2008)  Annex A.1.1 Defined Constants,
   page 491, lines 22-23:
   "The C and Fortran name is listed in the left column and the
   C++ name is listed in the middle or right column."

Proposal:
=========

MPI-2.1 p. 488, lines 33-35 reads:
   "MPI constants have the same value in all languages,
   unless specified otherwise. This does not
   apply to constant handles (MPI_INT, MPI_COMM_WORLD,
   MPI_ERRORS_RETURN, MPI_SUM, etc.) These handles need
   to be converted, as explained in Section 16.3.4."

but should read:
   "MPI constants have the same value in all languages,
   unless specified otherwise. This does not
   apply to constant handles (MPI_INT, MPI_COMM_WORLD,
   MPI_ERRORS_RETURN, MPI_SUM, etc.)
   Although these handles (e.g. predefined datatypes)
   must exist in all language bindings, their values
   may be different in each language binding.
   If one wants to use a constant handle from one language binding
   (e.g., MPI_DOUBLE from mpi.h) in a call to an MPI function in
   another language binding (e.g., in Fortran MPI_SEND), then
   these handles need
   to be converted, as explained in Section 16.3.4."

Does this help?

Best regards
Rolf

On Thu, 17 Jul 2008 09:03:35 -0500
  William Gropp <wgropp_at_[hidden]> wrote:
> To make this perfectly clear, should the standard state that the 
> values of the predefined datatypes from another language are exactly 
> the same as the value produced by the handle conversion function? 
>  E.g., in Fortran, the value of MPI_INT is what you would get from 
> MPI_TYPE_C2F( MPI_INT )  (where MPI_INT is the C version).  It 
>should  also state that just because Fortran defines MPI_LONG_LONG, 
>that does  not imply that Fortran support an integer type that 
>corresponds to  the C long long type.
> 
> Bill
> 
> On Jul 17, 2008, at 4:03 AM, Rolf Rabenseifner wrote:
> 
>> Hi all,
>>
>> The argument-chain was:
>>
>>>>> William Gropp wrote:
>>>>>> One piece of relevant text in MPI 2.0 is in section 4.12.6 (in
>>>>>> MPI-2.0) says that "All predefined datatypes can be used in
>>>>>> datatype constructors in any language."
>> [....]
>>
>> This text is supported also by:
>> MPI-2.0 Chap. 10.1.6 page 276 and
>> MPI-2.0 Annex B.2, page 344 define for all Fortran predefined
>> datatype handles as C++ counter-part.
>>
>> In the meeting, there was a consensus (?) that it is a bug
>> if an MPI implementation does not support, e.g. MPI_INT
>> in the mpif.h Fortran header file.
>> (This bug can be found, e.g., in MPICH-2 and will be fixed,
>> when I understood correctly)
>>
>> The value (not the name!!) of MPI_INT in mpif.h and mpi.h may be
>> different, as stated already in MPI-2.0, Sect. 4.12.9.
>> MPI_INT from C mpi.h cannot be used in a Fortran CALL MPI_SEND(...).
>> You need to convert, or you must use MPI_INT from Fortran mpif.h.
>>
>> (I.e. one may distiguish between mixed languages in
>> one MPI executable [addressed by MPI-2.0 Section 4.12.9],
>> and sending a message from a Fortran MPI executable to a C MPI
>> executable and vice versa [see MPI 2.0 Section 4.12.6].)
>>
>> Because this is already "clearly" defined in MPI-2.0,
>> you will not find any remark about this in the Change-Log
>> of MPI-2.1.
>>
>> MPI-2.2 may make it more clear in the revisiting of datatypes.
>>
>> Best regards
>> Rolf
>>
>> On Thu, 17 Jul 2008 10:20:28 +0200
>>   Hubert Ritzdorf <ritzdorf_at_it.neclab.eu> wrote:
>>> No, we didn't have them. The request to provide all C datatypes in
>>> Fortran was specified in one of the last meetings. When I remember
>>> correctly, it was specified in the last meeting in Chicago or
>>> the meeting before (I think it was specified together with item 33
>>> of the change log). I implemented it together with the changes
>>> for MPI 2.1 since I assumed that it was contained also in the
>>> change log. After your mail, I recognized that it is only implicitly
>>> mentioned by item 33.
>>>
>>> Hubert
>>>
>>> Jeff Squyres wrote:
>>>> What does NEC MPI do -- do you have MPI_INT and MPI_FLOAT (etc.) in
>>>> mpif.h?
>>>>
>>>>
>>>> On Jul 16, 2008, at 12:57 PM, Hubert Ritzdorf wrote:
>>>>
>>>>> What's about the C++ datatypes for complex ?
>>>>> MPI_COMPLEX and MPI_Double_Complex are already defined for Fortran
>>>>> datatypes. The complex Fortran datatypes  within C++  have a  
>>>>> special
>>>>> name in order to avoid a name collision.
>>>>>
>>>>> Hubert
>>>>>
>>>>> William Gropp wrote:
>>>>>> One piece of relevant text in MPI 2.0 is in section 4.12.6 (in
>>>>>> MPI-2.0) says that "All predefined datatypes can be used in  
>>>>>> datatype
>>>>>> constructors in any language."  However, the example uses
>>>>>> MPI_Type_f2c ton convert the Fortran handle to the C version  
>>>>>> before
>>>>>> passing it into the MPI_Type_create_struct routine, so this text
>>>>>> could be interpreted as allowing the use of those datatypes  
>>>>>> through
>>>>>> the handle conversion mechanism without requiring them to be  
>>>>>> defined
>>>>>> in each languages header file.  Presumably the requirement is that
>>>>>> they be predefined with the value that you'd get from the handle
>>>>>> conversion function?
>>>>>>
>>>>>> Bill
>>>>>>
>>>>>> On Jul 16, 2008, at 8:18 AM, Hubert Ritzdorf wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> when I remember correctly, it was decided to provide the C MPI
>>>>>>> datatypes
>>>>>>> in Fortran since
>>>>>>> the Fortran datatypes are supported in C and C++.
>>>>>>>
>>>>>>> Hubert
>>>>>>>
>>>>>>> Jeff Squyres wrote:
>>>>>>>> I will file a proposal about this if there is a problem, but I
>>>>>>>> wanted
>>>>>>>> to ask the group before I did so.  In the changelog for MPI-2.1:
>>>>>>>>
>>>>>>>> 2. Section 3.2.2 on page 27, Section 16.1.6 on page 453, and  
>>>>>>>> Annex
>>>>>>>> A.1
>>>>>>>> on page 491.
>>>>>>>> MPI_LONG_LONG_INT, MPI_LONG_LONG (as synonym),
>>>>>>>> MPI_UNSIGNED_LONG_LONG,
>>>>>>>> MPI_SIGNED_CHAR, and MPI_WCHAR are moved from optional to  
>>>>>>>> official
>>>>>>>> and they
>>>>>>>> are therefore defined for all three language bindings.
>>>>>>>>
>>>>>>>> Note that it says that these C datatype names must be in all  
>>>>>>>> three
>>>>>>>> language bindings.
>>>>>>>>
>>>>>>>> Are C MPI datatypes supposed to be available in Fortran?  I  
>>>>>>>> looked
>>>>>>>> in
>>>>>>>> mpif.h for Open MPI, MPICH2, HP MPI, and Intel MPI, and I didn't
>>>>>>>> see C
>>>>>>>> MPI datatypes in there (e.g., MPI_INT and MPI_FLOAT).
>>>>>>>>
>>>>>>>> So:
>>>>>>>>
>>>>>>>> - is there language somewhere in MPI that says that C  
>>>>>>>> datatypes are
>>>>>>>> not supposed to be in mpif.h? (and therefore the MPI-2.1  
>>>>>>>> changelog
>>>>>>>> is
>>>>>>>> wrong)
>>>>>>>>
>>>>>>>> or
>>>>>>>>
>>>>>>>> - are all 4 of the above MPI's wrong for not including the C
>>>>>>>> datatypes
>>>>>>>> in mpif.h?
>>>>>>>>
>>>>>>>> --Jeff Squyres
>>>>>>>> Cisco Systems
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> mpi-22 mailing list
>>>>>>>> mpi-22_at_[hidden] <mailto:mpi-22_at_[hidden]>
>>>>>>>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-22
>>>>>>>>
>>>>>>>> <smime.p7s><ATT00001.txt>
>>>>>>
>>>>>> William Gropp
>>>>>> Paul and Cynthia Saylor Professor of Computer Science
>>>>>> University of Illinois Urbana-Champaign
>>>>>>
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------ 
>>>>>> ------
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> mpi-22 mailing list
>>>>>> mpi-22_at_[hidden]
>>>>>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-22
>>>>>>
>>>>> _______________________________________________
>>>>> mpi-22 mailing list
>>>>> mpi-22_at_[hidden]
>>>>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-22
>>>>
>>>>
>>>> --Jeff Squyres
>>>> Cisco Systems
>>>>
>>>>
>>>> _______________________________________________
>>>> mpi-22 mailing list
>>>> mpi-22_at_[hidden]
>>>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-22
>>>>
>>
>> Dr. Rolf Rabenseifner . . . . . . . . . .. email 
>>rabenseifner_at_[hidden]
>> 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: Allmandring 30)
>> _______________________________________________
>> mpi-22 mailing list
>> mpi-22_at_[hidden]
>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi-22
> 
> William Gropp
> Paul and Cynthia Saylor Professor of Computer Science
> University of Illinois Urbana-Champaign
> 
> 
> 

Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner_at_[hidden]
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: Allmandring 30)



More information about the Mpi-22 mailing list