<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">The first problem is a quality of Fortran compiler implementation issue - there's no technical reason why the compiler can't tell you that "there is no subprogram MPI_SEND with a real for the second argument", for example. <div><br></div><div>Bill</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="font-size: 12px; ">William Gropp</div><div style="font-size: 12px; ">Director, Parallel Computing Institute</div></div></div></span><span class="Apple-style-span" style="font-size: 12px; ">Thomas M. Siebel Chair in Computer Science</span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="font-size: 12px; ">University of Illinois Urbana-Champaign</div></div><div><br></div></div></span><br class="Apple-interchange-newline"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br><div><div>On May 1, 2014, at 1:34 PM, Junchao Zhang wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr"><div>Hello,</div><div>   I met a problem when implementing F08 binding in MPICH.  I have a file mpi_f08.F90, which contains all interfaces</div><div><br></div><div><div>module mpi_f08</div><div>..</div><div>
<div>interface MPI_Send</div><div>    subroutine MPI_Send_f08ts(buf, count, datatype, dest, tag, comm, ierror)</div><div>        use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm</div><div>        implicit none</div><div>
        type(*), dimension(..), intent(in) :: buf</div><div>        integer, intent(in) :: count, dest, tag</div><div>        type(MPI_Datatype), intent(in) :: datatype</div><div>        type(MPI_Comm), intent(in) :: comm</div>
<div>        integer, optional, intent(out) :: ierror</div><div>    end subroutine MPI_Send_f08ts</div><div>end interface MPI_Send</div></div></div>..<div>end module mpi_f08</div><div><br></div><div>Then for each subroutine, I create a separate file which implement the wrapper function in Fortran.  For example, send_f08ts.F90 has<br>
</div><div><br></div><div><div>subroutine MPI_Send_f08ts(buf, count, datatype, dest, tag, comm, ierror)</div><div>    use :: mpi_f08, only : MPI_Datatype, MPI_Comm</div><div>    use, intrinsic :: iso_c_binding, only : c_int</div>
<div>    use :: mpi_c_interface, only : c_Datatype, c_Comm</div><div>    use :: mpi_c_interface, only : MPIR_Send_cdesc</div><div><br></div><div>    implicit none</div><div>    ..</div><div>end subroutine MPI_Send_f08ts</div>
</div><div><br></div><div>Bill Long pointed out problems of the implementation. 1) When users supply a bad argument to MPI_Send(), the compiler complains "<span style="font-family:arial,sans-serif;font-size:13px">No specific match can be found for the generic subprogram call MPI_SEND</span>", instead of pointing out the offending arg. 2) The wrapper is not in a module, which <span style="font-family:arial,sans-serif;font-size:13px">eliminates many of the advantages of using modern Fortran.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">I met the first problem in my testing. I was wondering if it is possible to fix that, so I ask Fortran expert here for advices. </span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Thank you very much.</span></div>
<div><br></div><div><div><div dir="ltr">--Junchao Zhang</div></div>
</div></div>
_______________________________________________<br>mpiwg-fortran mailing list<br><a href="mailto:mpiwg-fortran@lists.mpi-forum.org">mpiwg-fortran@lists.mpi-forum.org</a><br>http://lists.mpi-forum.org/mailman/listinfo.cgi/mpiwg-fortran</blockquote></div><br></div></body></html>