[MPI3 Fortran] Results of recent J3 Fortran meeting

Rasmussen, Craig E rasmussn at lanl.gov
Mon Mar 28 11:05:45 CDT 2011


About a comment from Craig:
gfortran issues a warning when having a
INTEGER dummy argument in combination with BIND(C).
This means that the warning of gfortran is not necessary.
Compiling the interface, it would be okay to have an information message.
On the caller site, a warning would not be helpful
because it would cause a warning with each MPI call.
I do not know, where gfortran currently produces its warning.


So that everyone is clear on the warning message.  Here is an example of an interface but it could also be in a derived type definition with the BIND(C) attribute:

interface
  subroutine foo(i) BIND(C)
    integer :: i
  end subroutine
end interface

The gfortran warning is that the integer i MAY not be interoperable.  There is an error if the types don't match up at the calling site.  This is all as it should be.  We just need to ask gfortran to turn the warning off or to provide a compiler option so that the user can turn it off.


I'm not convinced there is a problem here.
If I understood all correctly, then you convinced me
that there is not a problem, because it is part of an MPI library
compilation to check which C integer type is equivalent
to Fortran INTEGER. Because MPI is doing all by call by reference
(i.e. not by VALUE), I expect that the problem is really solved.


Whether the call is by reference or by value is not the issue.  In Fortran the type and kind of the actual argument must agree with that of the dummy argument in the interface.

-craig





More information about the mpiwg-fortran mailing list