[MPI3 Fortran] MPI function symbol naming convention for tools

Rasmussen, Craig E rasmussn at lanl.gov
Mon Jun 20 14:58:04 CDT 2011


Here are the interfaces:

interface MPI_Recv

subroutine MPI_Recv_f(buf,count,datatype,source,tag,comm,status,ierror) &
   BIND(C, name="mpi_recv_f")
   use :: mpi_f08_types
   implicit none
   !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf                                                   
   real, INTENT(IN) :: buf
   INTEGER, INTENT(IN) :: count, source, tag
   INTEGER, INTENT(IN) :: datatype
   INTEGER, INTENT(IN) :: comm
   INTEGER, INTENT(OUT) :: status(MPI_STATUS_SIZE)
   INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f


subroutine MPI_Recv_f_nostatus(buf,count,datatype,source,tag,comm,ierror) &
   BIND(C, name="mpi_recv_f_nostatus")
   use :: mpi_f08_types
   implicit none
   !DEC$ ATTRIBUTES NO_ARG_CHECK :: buf                                                   
   real, INTENT(IN) :: buf
   INTEGER, INTENT(IN) :: count, source, tag
   INTEGER, INTENT(IN) :: datatype
   INTEGER, INTENT(IN) :: comm
   INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f_nostatus

subroutine MPI_Recv_f08(buf,count,datatype,source,tag,comm,status,ierror) &
   BIND(C, name="mpi_recv_f08")
   use :: mpi_f08_types
   implicit none
   TYPE(*), DIMENSION(..), INTENT(IN) :: buf
   INTEGER, INTENT(IN) :: count, source, tag
   TYPE(MPI_Datatype), INTENT(IN) :: datatype
   TYPE(MPI_Comm), INTENT(IN) :: comm
   TYPE(MPI_Status), INTENT(OUT) :: status
   INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f08

subroutine MPI_Recv_f08_nostatus(buf,count,datatype,source,tag,comm,ierror) &
   BIND(C, name="mpi_recv_f08_nostatus")
   use :: mpi_f08_types
   implicit none
   TYPE(*), DIMENSION(..), INTENT(IN) :: buf
   INTEGER, INTENT(IN) :: count, source, tag
   TYPE(MPI_Datatype), INTENT(IN) :: datatype
   TYPE(MPI_Comm), INTENT(IN) :: comm
   INTEGER, OPTIONAL, INTENT(OUT) :: ierror
end subroutine MPI_Recv_f08_nostatus

end interface MPI_Recv

-craig


On Jun 20, 2011, at 1:24 PM, Bill Long wrote:

> For those of us who are clearly missing some pieces here, could you 
> write out the full interfaces for the 4 routines mentioned below?  Thanks.
> 
> Cheers,
> Bill
> 
> 
> On 6/20/11 1:09 PM, Rasmussen, Craig E wrote:
>> No, the status variable will be of type(MPI_Status) and will be made "optional" through overloading.  Only the IERROR will have the optional attribute.  We felt it would complicate things if more that one variable had the optional attribute.  Please comment on this choice, perhaps there is a better way for the status variable to be optional.
>> 
>> The goal is to allow a user to pass MPI_STATUS_IGNORE for the status variable or to not pass a status variable at all.  The results would be the same for both calls.
>> 
>> -craig
>> 
>> 
>> On Jun 20, 2011, at 11:42 AM, Bill Long wrote:
>> 
>>> Hi Craig,
>>> 
>>> The "status variable" is the IERROR argument that comes last in the
>>> argument list, right?  If so, then it would seem easier to declare that
>>> as optional.  If the interfaces are declared bind(c) in Fortran, then a
>>> C version of the routine would know how to handle the optional argument.
>>>  That would allow getting rid of the _nostatus versions.  Given the
>>> number of MPI routines, cutting the list below by a factor of 2 seems
>>> like a big win.
>>> 
>>> Cheers,
>>> Bill
>>> 
>>> 
>>> On 6/20/11 12:15 PM, Rasmussen, Craig E wrote:
>>>> I've talked with Jeff Squyres and we come up with naming convention that we'd like to propose for tools to have access to Fortran.
>>>> 
>>>> I believe we need four different symbol naming conventions.  Consider MPI_Recv(), the four functions are
>>>> 
>>>> 1. mpi_recv_f
>>>>         - This function implements (in C or Fortran) MPI_Recv with integer handles and the choice buffer passed by address.
>>>> 
>>>> 2. mpi_recv_f_nostatus
>>>>         - This function implements (in C or Fortran) MPI_Recv with integer handles without a status variable and the choice buffer passed by address.
>>>> 
>>>> 3. mpi_recv_f08
>>>>         - This function implements (in C or Fortran) MPI_Recv with integer handles and the choice buffer passed via an array descriptor.
>>>> 
>>>> 4. mpi_recv_f_nostatus
>>>>         - This function implements (in C or Fortran) MPI_Recv with integer handles without a status variable and the choice buffer passed via an array descriptor.
>>>> 
>>>> Note that these functions only need to support integer handles because of the way we (thanks to Rolf) have chosen to define the handle types in the mpi_f08 module.
>>>> 
>>>> Please comment on this naming convention.
>>>> 
>>>> -craig
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> 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
>> 
> 
> -- 
> 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
> 
> 





More information about the mpiwg-fortran mailing list