[MPIWG Fortran] Type of MPI_Status
Jeff Hammond
jeff.science at gmail.com
Mon Mar 17 14:19:57 CDT 2014
On Mon, Mar 17, 2014 at 4:52 PM, Craig Rasmussen <rasmus at cas.uoregon.edu> wrote:
> Jeff and I had a similar conversation last week. It is my viewpoint that
> the MPI-3 interfaces are formal interfaces that can be adapted by an
> implementation in a way that formally meets the specification.
>
> For Open MPI I believe that Jeff will add configuration magic to check is
> INTEGER(C_INT) and default INTEGER have the same KIND value. This should be
> true for 100% of the compilers. If not, then that compiler will not be able
> to build Open MPI.
So what you're saying is that users will not be able to use "-i8" or
equivalent when building OpenMPI? That is quite common despite being
totally evil.
Jeff
> The use of INTEGER(C_INT) to replace the default INTEGER in the MPI types is
> needed to stopped compiler warning from GNU. We did this work (adding
> BIND(C) to gfortran) at Los Alamos and I think we perhaps got carried away
> with the warning messages.
>
> Craig Rasmussen
> CAS Scientific Programmer
> rasmus at cas.uoregon.edu
>
>
>
>
> On Mar 14, 2014, at 4:11 PM, Junchao Zhang wrote:
>
> Not sure if it is worth discussing. Even if INTEGER and C_INT are of
> different size, I think I can still use C_INT in MPI_Status.
>
> TYPE, BIND(C) :: MPI_Status
> INTEGER(C_INT) :: MPI_SOURCE, MPI_TAG, MPI_ERROR
> ... ! other fields
> END TYPE MPI_Status
>
> Since MPI_Status is a derived datatype, users access it through its public
> interfaces(i.e., %MPI_SOURCE, ..., MPI_STATUS_SIZE).
> As long as MPI_STATUS_SIZE >= sizeof(MPI_STATUS)/sizeof(INTEGER), who cares
> its internals.
>
>
> --Junchao Zhang
>
>
> On Thu, Mar 13, 2014 at 10:56 AM, Rolf Rabenseifner <rabenseifner at hlrs.de>
> wrote:
>>
>> Jeff is right.
>> Bill's theoretical statement is also correct.
>>
>> And ticket#415 is also correct because it resolves an inconsistency
>> within the mpi_f08 interface.
>>
>> Strange theoretical discussions are also there for
>> long Fortran INTEGER may not be identical with some shorter
>> INTEGER(C_int).
>> As a side effect also solved by this ticket.
>>
>> Rolf
>>
>> ----- Original Message -----
>> > From: "Jeff Hammond" <jeff.science at gmail.com>
>> > To: "MPI-WG Fortran working group" mpi-forum.org>
>> > Sent: Thursday, March 13, 2014 4:12:56 PM
>> > Subject: Re: [MPIWG Fortran] Type of MPI_Status
>> >
>> > MPI should test for interoperability of Fortran's default integer and
>> > light the machine room on fire if it is not.
>> >
>> > Jeff
>> >
>> > On Thu, Mar 13, 2014 at 8:58 AM, Bill Long <longb at cray.com> wrote:
>> > > This does raise an earlier issue that it is
>> > > possible that Fortran’s default INTEGER is not an interoperable
>> > > type, and thus the MPI_Status type should not be a BIND(C) type if
>> > > it has INTEGER components. Having BIND(C) does allow you to
>> > > declare a C global name MPI_STATUS_IGNORE in Fortran, which solves
>> > > one problem nicely. I don’t see any advantage to having INTEGER
>> > > components (as opposed to INTEGER(C_Int), for example). So this
>> > > seems to represent the worse of the two options.
>> > >
>> > > Cheers,
>> > > Bill
>> > >
>> > >
>> > >
>> > > On Mar 13, 2014, at 8:36 AM, Jeff Squyres (jsquyres)
>> > > <jsquyres at cisco.com> wrote:
>> > >
>> > >> Done. Good catch:
>> > >>
>> > >> https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/415
>> > >>
>> > >> This is a trivial ticket, but if you could make sure it's ok, I'll
>> > >> send it to the mpi-forum list so that it can get added to the
>> > >> next meeting's agenda.
>> > >>
>> > >>
>> > >> On Mar 13, 2014, at 1:51 AM, Rolf Rabenseifner
>> > >> <rabenseifner at hlrs.de> wrote:
>> > >>
>> > >>> Jeff and Junchao,
>> > >>>
>> > >>> it is a missing word INTEGER in this part of the sentence
>> > >>>
>> > >>> In whole MPI these three values are in Fortran INTEGER and
>> > >>> nothing else
>> > >>>
>> > >>> Junchao, thank you for the hint that an erratum is neede
>> > >>> to prevent from such misinterpretation
>> > >>>
>> > >>> Jeff, please can you file the errata ticket resulting in
>> > >>>
>> > >>> ... containing three public INTEGER fields named ...
>> > >>>
>> > >>> Best regards
>> > >>> Rolf
>> > >>>
>> > >>>
>> > >>> ----- Original Message -----
>> > >>>> From: "Junchao Zhang" <jczhang at mcs.anl.gov>
>> > >>>> To: "MPI-WG Fortran working group"
>> > >>>> mpi-forum.org>
>> > >>>> Sent: Thursday, March 13, 2014 4:49:49 AM
>> > >>>> Subject: [MPIWG Fortran] Type of MPI_Status
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>> Hello,
>> > >>>>
>> > >>>>
>> > >>>> p30 of MPI3 says "In Fortran with USE mpi or INCLUDE ’mpif.h’,
>> > >>>> status
>> > >>>> is an array of INTEGERs of size MPI_STATUS_SIZE. ..., With
>> > >>>> Fortran
>> > >>>> USE mpi_f08, status is defined as the Fortran BIND(C) derived
>> > >>>> type
>> > >>>> TYPE(MPI_Status) containing three public fields named MPI_SOURCE
>> > >>>> ,
>> > >>>> MPI_TAG , and MPI_ERROR"
>> > >>>>
>> > >>>> In other words, it does't say type of the three public fields
>> > >>>> must be
>> > >>>> INTEGER. So, in mpi_f08, can I declare MPI_Status as
>> > >>>>
>> > >>>>
>> > >>>> TYPE, BIND(C) :: MPI_Status
>> > >>>> INTEGER(C_INT) :: MPI_SOURCE, MPI_TAG, MPI_ERROR
>> > >>>> ... ! other fields
>> > >>>> END TYPE MPI_Status
>> > >>>>
>> > >>>>
>> > >>>> I find it makes MPI_Status binding easier. Since this type is
>> > >>>> interoperable with C, I do not need to allocate temp variables
>> > >>>> to do
>> > >>>> type conversion when INTEGER is not a C_INT.
>> > >>>>
>> > >>>>
>> > >>>>
>> > >>>> --Junchao Zhang
>> > >>>> _______________________________________________
>> > >>>> 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)
>> > >>> _______________________________________________
>> > >>> mpiwg-fortran mailing list
>> > >>> mpiwg-fortran at lists.mpi-forum.org
>> > >>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>> > >>
>> > >>
>> > >> --
>> > >> 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
>> > >
>> > > Bill Long
>> > >
>> > > longb at cray.com
>> > > Fortran Technical Suport & voice:
>> > > 651-605-9024
>> > > Bioinformatics Software Development fax:
>> > > 651-605-9142
>> > > Cray Inc./ Cray Plaza, Suite 210/ 380 Jackson St./ St. Paul, MN
>> > > 55101
>> > >
>> > >
>> > > _______________________________________________
>> > > mpiwg-fortran mailing list
>> > > mpiwg-fortran at lists.mpi-forum.org
>> > > http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>> >
>> >
>> >
>> > --
>> > Jeff Hammond
>> > jeff.science at gmail.com
>> > _______________________________________________
>> > 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)
>> _______________________________________________
>> mpiwg-fortran mailing list
>> mpiwg-fortran at lists.mpi-forum.org
>> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>
>
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
>
>
>
> _______________________________________________
> mpiwg-fortran mailing list
> mpiwg-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran
--
Jeff Hammond
jeff.science at gmail.com
More information about the mpiwg-fortran
mailing list