[MPI3 Fortran] Fwd: Re: Fwd: [Mpi-comments] MPI 3.0:Fortran 2008 interface - issue with the LOGICAL kind

Rolf Rabenseifner rabenseifner at hlrs.de
Mon Mar 4 10:34:39 CST 2013


Bill,

Without BIND(C), you have to make it according to
MPI-3.0 page 605, lines 31-38.

Therefore, ticket #364 should work.

Please check again.

Best regards
Rolf

----- Original Message -----
> From: "Bill Long" <longb at cray.com>
> To: "MPI-3 Fortran working group" <mpi3-fortran at lists.mpi-forum.org>
> Sent: Monday, March 4, 2013 5:29:24 PM
> Subject: [MPI3 Fortran] Fwd: Re: Fwd: [Mpi-comments] MPI 3.0:Fortran 2008 interface - issue with the LOGICAL kind
> As an example, this is from page 606 in the spec:
> 
> SUBROUTINE MPI_SEND(...) BIND(C,NAME=’MPI_Send_f’)
> USE mpi
> CALL PMPI_SEND(...)
> END SUBROUTINE
> 
> If you expect to support external linkage names like "MPI_Send_f",
> then
> the BIND(C) is required.
> 
> There is no problem with the normal MPI routines since they go through
> wrappers and the wrapper can convert the LOGICAL value into an int for
> sending on to C (and back, if necessary).
> 
> The callbacks are more difficult. But there is no need to mess up the
> normal routines, with the associated undesirable side effects.
> 
> Cheers,
> Bill
> 
> 
> 
> -------- Original Message --------
> Subject: Re: [MPI3 Fortran] Fwd: [Mpi-comments] MPI 3.0:Fortran 2008
> interface - issue with the LOGICAL kind
> Date: Mon, 4 Mar 2013 10:13:36 -0600
> From: Bill Long <longb at cray.com>
> Reply-To: <longb at cray.com>
> Organization: Cray Inc.
> To: <mpi3-fortran at lists.mpi-forum.org>
> 
> 
> 
> On 3/4/13 9:47 AM, Rolf Rabenseifner wrote:
> > Dear all,
> >
> > I forget to say thank you to all of you who helped to solve
> > this hard problem. It was a really helpful discussion.
> > It is a pity that we could not keep the BIND(C) for
> > all routines in mpi_f08, which was one goal with mpi_f08 and TS
> > 29113.
> >
> > In my proposal #364, we have to remove BIND(C) from
> >   - the 30 normal MPI routines with LOGICAL arguments,
> 
> I would be strongly against this, as it prevents putting the wrapper
> routines in a module. We will have to start over from scratch with a
> vastly inferior implementation, with reduced performance. (Unless you
> concurrently delete completely the mpif.h include file, in which case
> the BIND(C) on the wrappers is no needed any longer.)
> 
> 
> >   - the 9 MPI routines with callbacks in the argument list,
> >   - and 10 predefined callbacks,
> > i.e., from 49 out of 357 MPI routines.
> >
> > I do not see a better solution that can be done by the MPI Forum.
> > Better solutions are still possible for the 30 normal routines
> > and/or for the 9 routines with callback-arguments as soon as
> > the Fortran standard will include some additions and
> > those additions are provided by the compilers - but if this
> > will happen then it will not happen soon.
> >
> > It was luck that all routines with buffer arguments do not
> > have also a LOGICAL argument.
> >
> > Best regards
> > Rolf
> >
> > ------------------
> > Malcolm and all MPI implementors,
> > and TOOLS implementors,
> >
> > First Malcolm, thank you for your helpful answer.
> > After all the discussion, the MPI-3.0 errata decision is
> > very simple: Remove BIND(C) everywhere where LOGICAL is around.
> >
> > I did it in the ticket #364
> > https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/364
> >
> > I hope that one of the implementors with Fortran knowledge goes
> > through my proposal and returns an "okay" as a review on the ticket.
> >
> > The major changes:
> >   - BIND(C) removed on all callback abstract interfaces.
> >   - BIND(C) removed on all predefined callbacks.
> >   - Creating a new routine group "MPI_TEST" for all MPI routines
> >     with LOGICAL arguments, except MPI_OP_CREATE, which is already
> >     in an own group.
> >   - Telling that the routines in the groups MPI_TEST,
> >     MPI_OP_CREATE, MPI_REGISTER_DATEREP, and MPI_COMM_KEYVAL_CREATE
> >     cannot be implemented with BIND(C) in Fortran 2008 + TS 29113
> >     and earlier.
> >
> > TOOLS implementors should be aware that I added this new routine
> > group.
> >
> > Best regards
> > Rolf
> >
> > ----- Original Message -----
> >> From: "Malcolm Cohen" <malcolm at nag-j.co.jp>
> >> To: "MPI-3 Fortran working group"
> >> <mpi3-fortran at lists.mpi-forum.org>
> >> Sent: Monday, March 4, 2013 3:56:50 AM
> >> Subject: Re: [MPI3 Fortran] Fwd: [Mpi-comments] MPI 3.0:Fortran
> >> 2008 interface - issue with the LOGICAL kind
> >>>     (B1) Is it possible, that a BIND(C) routine
> >>>          has a dummy argument that is a non-BIND(C)
> >>>          ABSTRACT INTERFACE procedure argument?
> >>
> >> That is not possible: all dummy arguments of a BIND(C) routine must
> >> be
> >> interoperable - for procedures that requires BIND(C).
> >>
> >> It would be reasonable to extend C_FUNLOC and C_F_PROCPOINTER to
> >> permit
> >> non-interoperable procedures, similarly to how we permit
> >> non-interoperable
> >> variables in C_LOC and C_F_POINTER. Then the argument could be
> >> C_FUNPTR (by
> >> value). I don't know whether this would help you though.
> >>
> >>>     (B2) Do we have any problem with
> >>>          the TYPE(C_PTR), VALUE dummy arguments
> >>>          in the ABSTRACT INTERFACE MPI_User_function
> >>>          on MPI-3.0 page 183 line 45 - page 184 line 3
> >>>          if the we remove the BIND(C) from this
> >>>          ABSTRACT INTERFACE (i.e. on page 183, line 47).
> >>
> >> No problem.
> >>
> >> Cheers,
> >> --
> >> ................................Malcolm Cohen, Nihon NAG, Tokyo.
> >>
> >> _______________________________________________
> >> mpi3-fortran mailing list
> >> mpi3-fortran at lists.mpi-forum.org
> >> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-fortran
> >
> 
> --
> Bill Long longb at cray.com
> Fortran Technical Support & voice: 651-605-9024
> Bioinformatics Software Development fax: 651-605-9142
> Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
> 
> 
> 
> 
> _______________________________________________
> mpi3-fortran mailing list
> mpi3-fortran at lists.mpi-forum.org
> http://lists.mpi-forum.org/mailman/listinfo.cgi/mpi3-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)




More information about the mpiwg-fortran mailing list